Doc #60737 [Opn->Csd]: Note that set_exception_handler accepts NULL as parameter
| From: | frozenfire@php.net | Date: | Sat, 14 Jan 2012 06:03:19 +0000 |
| Subject: | Doc #60737 [Opn->Csd]: Note that set_exception_handler accepts NULL as parameter | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-7781@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
Updated by: frozenfire@php.net
Reported by: four dot zerooneunauthorized at gmail dot com
Summary: Note that set_exception_handler accepts NULL as
parameter
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: Irrelevant
PHP Version: Irrelevant
-Assigned To:
+Assigned To: frozenfire
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2012-01-14 06:02:49] frozenfire@php.net
Automatic comment from SVN on behalf of frozenfire
Revision: http://svn.php.net/viewvc/?view=revision&revision=322259
Log: set_exception_handler accepts null to reset handler to default state. Closes bug #60737.
------------------------------------------------------------------------
[2012-01-13 02:35:09] four dot zerooneunauthorized at gmail dot com
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
------------------------------------------------------------------------
[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