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

From: Date: Sun, 26 Oct 2008 22:40:53 +0000
Subject: #45628 [Opn->Asn]: set_error_handler() return type wrongly documented
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-1256@lists.php.net to get a copy of this message
ID: 45628 Updated by: kalle@php.net Reported By: sebastian@php.net -Status: Open +Status: Assigned Bug Type: Documentation problem Operating System: Irrelevant PHP Version: Irrelevant -Assigned To: +Assigned To: kalle 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 (#1256) next »