Posted by Al on 02/01/06 04:31
Jim Carlock wrote:
> I put my vote in for the
>
> Option Explicit '(.asp/vbscript) (use strict //perl)
>
> as a requested improvement.
>
> http://bugs.php.net/bug.php?id=14285&thanks=6
>
> Only 17 votes there right at the moment. If anyone else would like
> such an improvement, go to the link above and vote.
>
> Jim Carlock
> Post replies to the newsgroup.
Well if you set your error level thingy to E_ALL it'll throw a notice
if you use a variable that you haven't instantiated. But instantiation
basically means 'setting'. So you can do this code:
<?php
$counter = 3;
$countr = $counter + 1; // notice the error (and i only didn't use
$countr++ because that might actually throw the notice)
echo $counter;
?>
and it won't throw a notice as you're using the NEW $countr variable in
a setting sense. However it does help you a little with regards to
CHECKING a variable, e.g.:
<?php
$counter = 3;
echo $countr;
?>
that should throw a notice with errors at E_ALL.
But that's nowhere near a nice Option Explicit.
[Back to original message]
|