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

From: Date: Fri, 25 Jul 2008 14:35:33 +0000
Subject: #45628 [Opn]: set_error_handler() return type wrongly documented
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-1015@lists.php.net to get a copy of this message
ID: 45628 Updated by: sebastian@php.net Reported By: sebastian@php.net Status: Open Bug Type: Documentation problem Operating System: Irrelevant PHP Version: Irrelevant New Comment: The code is broken for the error case, the docs are broken for the "not set" case. Previous Comments: ------------------------------------------------------------------------ [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 (#1015) next »