Reply to Re: global variables, Apache, PHP4.4.1Win32, WinXP

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация