Doc #60737 [NEW]: Note that set_exception_handler accepts NULL as parameter

From: Date: Fri, 13 Jan 2012 01:38:26 +0000
Subject: Doc #60737 [NEW]: Note that set_exception_handler accepts NULL as parameter
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7774@lists.php.net to get a copy of this message
From: Operating system: Irrelevant PHP version: Irrelevant Package: Documentation problem Bug Type: Documentation Problem Bug description:Note that set_exception_handler accepts NULL as parameter Description: ------------ --- From manual page: http://www.php.net/function.set-exception-handler --- It should be noted on this doc page that this 'set_exception_handler' function accepts NULL as the parameter (at least as of PHP 5.3.6). Passing in NULL appears to remove the reference to the previous handler function, effectively resetting this feature to default state (nothing). And, passing in NULL causes 'set_exception_handler' to return '(bool) true' rather than returning the previous handler function details as is currently documented. Test script: --------------- function testhandler1($errno= null, $errstr= null, $errfile= null, $errline = null) { error_log(print_r(func_get_args(), true)); } function testhandler2($errno= null, $errstr= null, $errfile= null, $errline = null) { error_log(print_r(func_get_args(), true)); } var_dump(set_exception_handler('testhandler1')); var_dump(set_exception_handler('testhandler2')); var_dump(set_exception_handler(null)); Actual result: -------------- NULL string(12) "testhandler1" bool(true) -- Edit bug report at https://bugs.php.net/bug.php?id=60737&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60737&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60737&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60737&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60737&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60737&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60737&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60737&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60737&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60737&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60737&r=support Expected behavior: https://bugs.php.net/fix.php?id=60737&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60737&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60737&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60737&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60737&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60737&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60737&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60737&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60737&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60737&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60737&r=mysqlcfg

« previous php.doc.bugs (#7774) next »