|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-04-11 09:37 UTC] sascha dot wildgrube at steganos dot com
This is not really a bug. It is a behaviour by design that has troubled php developers for years: The variable-can-be-instantiated-by-first-use-Effect!
Just look at that:
for ($nIndex=0; $nIndex < 23; $nIndx++)
{
whatever();
}
Most compilers will produce an error like "what the hell is nIndx? Not php. php will produce an endless loop. That is weak! And it is still the number one time eater when programming php. Change that and php as a tool can virtually DOUBLE efficiency! Make the need of variable initialization an option so that the community is not pissed off and existing sources are not rendered useless but for god's sake add it for future use. PLEASE, PLEASE, PLEASE WITH SUGAR, PLEASE WITH SUGAR AND CREAM!!!!
Thanks!
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 12:00:01 2025 UTC |
Put something like this: function myErrorHandler ($errno, $errstr, $errfile, $errline) { die("<p>$errstr in line $errline of $errfile. Dieing now.</p>"); } error_reporting(E_ALL); set_error_handler(myErrorHandler); in an include file, and perhaps use the auto_prepend_file php.ini setting to automagically include it in all your scripts.