Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- defined() doesn't work correctly
November 2, 2006, 1:47 pm
rate this thread
I'm using this function:
function die_quietly( $text='', $title='', $file='', $line='', $sql='' )
global $wowdb, $roster_conf, $wordings, $roster_menu;
// die_quitely died quietly
print '<pre>The quiet die function suffered a fatal error.
Die information below'."\n";
print 'First die data:'."\n";
print "\n".'Second die data'."\n";
$GLOBALS['die_data'] = func_get_args();
// Snip stuff that generates a graphical error page
The purpose of this function is creating a graphical error page if
something in my package causes a fatal error, rather than just dying.
The purpose of the quoted part is preventing undesired recursion if
something inside the die_quietly() function calls the die_quietly()
This code however doesn't work correctly. defined(ROSTER_DIED) seems to
return false on the second function call, and return true on the third.
Which means it returns the reason die_quietly failed twice, but not the
reason die_quietly was originally called.
Can anyone explain to me why this happens?
Remove caps to reply