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

From: Date: Fri, 13 Jan 2012 02:35:09 +0000
Subject: Doc #60737 [Opn]: Note that set_exception_handler accepts NULL as parameter
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7776@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60737&edit=1 ID: 60737 User updated by: four dot zerooneunauthorized at gmail dot com Reported by: four dot zerooneunauthorized at gmail dot com Summary: Note that set_exception_handler accepts NULL as parameter Status: Open Type: Documentation Problem Package: Documentation problem Operating System: Irrelevant PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Sorry - wrong URL for my related change request for the return value of this 'set_exception_handler' function. That should instead be https://bugs.php.net/bug.php?id=60738 Previous Comments: ------------------------------------------------------------------------ [2012-01-13 02:28:35] four dot zerooneunauthorized at gmail dot com FYI - Relating to the return value of 'set_exception_handler', I opened change request https://bugs.php.net/bug.php?id=60737 to have the return value of this function changed to instead be the details (string or array) of the previous callback function as is currently documented instead of '(bool) true'. ------------------------------------------------------------------------ [2012-01-13 01:38:25] four dot zerooneunauthorized at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=60737&edit=1

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