Re: Re: "use strict" or similar in PHP?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 9:21 AM -0500 3/1/09, Robert Cummings wrote:
On Sun, 2009-03-01 at 08:36 -0500, tedd wrote:
 The OP asked:

 >Is there in PHP something like "use strict" from perl? I find it pretty
 >annoying to need to run script over and over again just to find out that I
 >made typo in variable name.

 And I've been waiting for an answer myself, but I haven't seen one.

  From what I remember, in perl if you use "use strict;" it requires to
 to define your variables (my) before using them. If you make a
 variable typo in your code, then you'll trigger an error when you try
 to run it.

  From what I've seen of php, even with using strict error reporting,
 you can do that all day long without generating an error.

So the answer appears to be "No, you can't do that in PHP." Is that the answer?

You can do anything you want... :)

Rob:

Just to show that your words of wisdom don't go unnoticed, see here:

http://php1.net/oop/strict/

That's pretty slick.

Now if I only understood WT* you did, I would be a better programmer for it.

Thanks,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux