Re: "use strict" or similar in PHP?
| From: | Shawn McKenzie | Date: | Thu, 26 Feb 2009 21:38:13 +0000 |
| Subject: | Re: "use strict" or similar in PHP? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-288876@lists.php.net to get a copy of this message | ||
Hans Schultz wrote:
> Oh, I didn't mentioned that I tried that, I was thinking something like failing at
> compile time (like perl with "use strict" in programs)Thanks for reply,
> Hans
> --- On Thu, 2/26/09, Lewis Wright <lewiswright@gmail.com> wrote:
> From: Lewis Wright <lewiswright@gmail.com>
> Subject: Re: [PHP] "use strict" or similar in PHP?
> To: "Hans Schultz" <h.schultz78@yahoo.com>
> Cc: php-general@lists.php.net
> Date: Thursday, February 26, 2009, 9:07 PM
>
> Yes you can use:
>
> error_reporting(E_ALL);
>
> Which will enable notices. You can even do:
>
> error_reporting(E_ALL | E_STRICT);
>
> To enable strict messages.
>
> Lewis.
>
> 2009/2/26 Hans Schultz <h.schultz78@yahoo.com>:
>> Hello,
>> I am beginner with PHP and prior to PHP I have worked with java for some
>> time
>> and with perl for very short period. I can't help to notice some
> things that
>> are little annoyance for me with PHP, but I am sure someone more
> experienced
>> can help me :-)
>> 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.
>> Is there some way for PHP to cache some data on the page? I like very much
>> PHP's speed but it would be even better to be able to cache some
> frequently
>> used data from database?
>> Also regarding databases, I liked a lot java's way of sending data to
>> database
>> using parameters ("select * from user where username = ?" and
> then passing
>> parameter separately with database doing necessary escaping and
> everything).
>> Is there something like PHPDBC similar to JDBC?
>>
>> TIA,
>> Hans
>>
>>
>> --
>> Using Opera's revolutionary e-mail client:
>> http://www.opera.com/mail/
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
>
>
There is no "compile" time. PHP is interpreted so it is compiled and
then executed.
If you always want error reporting, then set it in php.ini.
--
Thanks!
-Shawn
http://www.spidean.com