FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Converting Perl to PHP, testing CLI with $_POST (newbie)
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Converting Perl to PHP, testing CLI with $_POST (newbie) [message #172104 is a reply to message #172101] Sun, 30 January 2011 22:06 Go to previous messageGo to previous message
Felix Saphir is currently offline  Felix Saphir
Messages: 8
Registered: December 2010
Karma:
Junior Member
P E Schoen <paul(at)pstech-inc(dot)com> wrote:
> "Felix Saphir" wrote in message
> news:ii4fdo$1ui$02$1(at)news(dot)t-online(dot)com...
>
>> That's virtually impossible, there shouldn't be a difference
>> between using a variable and a string constant. Check your
>> code for typos (e.g. you're using $dbFile and $dbfile). Are
>> you sure about the value of $dbfile/$dbFile?
>
> Ah, sorry, I just took a closer look and indeed (even in the
> code I posted) I had a lower case "f". The fonts in my editor
> and for newsgroups do not show much difference. That's where
> stronger type checking and variable declaration are useful, and

PHP reports undefined variables, if you set error_reporting
appropriately. I usually go with the value -1 for debugging.


> I'm also still used to Delphi which is case-insensitive.

My Delphi sources don't compile from time to time. Guess why ...


>> Oh, the manual is a good read in any case. Just a few
>> starting points to what I was referring to:
>
>> Variable scope:
> <http://www.php.net/manual/en/language.variables.scope.php>
>
>> Object member visibility:
> <http://www.php.net/manual/en/language.oop5.visibility.php>
>
>> Object constructors and inheritance:
> <http://www.php.net/manual/en/language.oop5.decon.php>
>
> Good points. I had read the Variable Scope and it seemed to me
> that a function would see and be able to use the global
> variable, but apparently not in this case within "class MyDB
> extends SQLite3". The public method is default and the keyword
> is not needed, but certainly passing the database filename in
> the function argument is much preferred, and the explicit public
> declaration is better than relying on the default.

I guess you already found out, that Delphi has a much more relaxed
approach to protected and private declarations than PHP?

> However, the
> following is even simpler and I don't see why I shouldn't use
> it:
>
> $db = new SQLite3($dbFile);

Looks fine.

Felix
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: passing variable to a nested array
Next Topic: Stats comp.lang.php (last 7 days)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 21:01:14 GMT 2024

Total time taken to generate the page: 0.04614 seconds