Re: Schroedinger's Bug - may require exorcism...

From: Date: Wed, 30 Nov 2005 16:56:57 +0000
Subject: Re: Schroedinger's Bug - may require exorcism...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-226655@lists.php.net to get a copy of this message
On Wed, 2005-11-30 at 11:48, tg-php@gryffyndevelopment.com wrote: > What to do next? I'd check to see if your page is being inadvertantly called twice > (I've seen this happen when people used frames.. or like someone else mentioned, doing a double > include() or sometimes redirecting back to itself via header())... anything that could possibly > re-initiate the page, check into. > > Failing that, do it old school... just inserted die() statements to break execution at various > points and see where the probably first starts occuring and focus in that area. Crude but it works. > At least helps narrow down where the problem could be. > > It doesn't do something silly like include() itself inside a conditional somewhere does > it? > > You might also echo/var_dump/print_r/whatever some of your key variables (especially input > variables like $_GET/$_POST/etc and variables used in conditionals) and try to isolate what > combination causes your problem. Since it doesn't do it all the time, I'd guess you could > have something like: > > $x = 4; > > if ($x > 1) { > include('someinclude.inc'); > } > > if ($x < 5) { > include('someinclude.inc'); > } Which reminds me... make sure your using include() where appropriate, and include_once() where appropriate. Obviously include_once() should ALWAYS be used when the source contains function or class definitions. Cheers, Rob -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

« previous php.general (#226655) next »