#31675 [NEW]: restore_error_handler() not work inside error handler

From: Date: Mon, 24 Jan 2005 06:35:16 +0000
Subject: #31675 [NEW]: restore_error_handler() not work inside error handler
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969366137@lists.php.net to get a copy of this message
From: zxd at zhangxiaodong dot net Operating system: RedHat Linux AS3 2.4.21-20 i686 PHP version: 5.0.3 PHP Bug Type: Documentation problem Bug description: restore_error_handler() not work inside error handler Description: ------------ when call restore_error_handler() inside an error handler function, it not works. Reproduce code: --------------- <?php function t35_handler($no, $msg){ echo __LINE__.__METHOD__."\n"; restore_error_handler(); echo __LINE__.__METHOD__."\n"; } function t35(){ echo "old handler=".set_error_handler("t35_handler")."\n"; trigger_error("error1"); echo "old handler=".set_error_handler("t35_handler")."\n"; trigger_error("error2"); } ?> Expected result: ---------------- old handler= 4t35_handler 6t35_handler old handler= 4t35_handler 6t35_handler Actual result: -------------- old handler= 4t35_handler 6t35_handler old handler=t35_handler 4t35_handler 6t35_handler -- Edit bug report at http://bugs.php.net/?id=31675&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31675&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31675&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31675&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=31675&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=31675&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=31675&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=31675&r=needscript Try newer version: http://bugs.php.net/fix.php?id=31675&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=31675&r=support Expected behavior: http://bugs.php.net/fix.php?id=31675&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=31675&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=31675&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=31675&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31675&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=31675&r=dst IIS Stability: http://bugs.php.net/fix.php?id=31675&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=31675&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=31675&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=31675&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=31675&r=mysqlcfg

« previous php.doc (#969366137) next »