#45628 [Asn->Csd]: set_error_handler() return type wrongly documented

From: Date: Sat, 01 Nov 2008 06:11:59 +0000
Subject: #45628 [Asn->Csd]: set_error_handler() return type wrongly documented
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-1286@lists.php.net to get a copy of this message
ID: 45628 Updated by: kalle@php.net Reported By: sebastian@php.net -Status: Assigned +Status: Closed Bug Type: Documentation problem Operating System: Irrelevant PHP Version: Irrelevant Assigned To: kalle 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: ------------------------------------------------------------------------ [2008-07-25 14:35:32] sebastian@php.net The code is broken for the error case, the docs are broken for the "not set" case. ------------------------------------------------------------------------ [2008-07-25 14:24:52] sebastian@php.net Description: ------------ The documentation for set_error_handler() seems to be wrong: <?php function handler($errno, $errstr, $errfile, $errline, $errcontext) {} var_dump(set_error_handler('handler')); var_dump(set_error_handler('handler')); NULL string(7) "handler" So NULL is not used for errors. NULL means the default error handler here apparently. Whereas the documentation reads: "Returns a string containing the previously defined error handler (if any), or NULL on error. If the previous handler was a class method, this function will return an indexed array with the class and the method name." The code reads: "Returns the previously defined error handler, or false on error." ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45628&edit=1

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