[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-doc-bugs
Subject:    [DOC-BUGS] #45628 [Opn->Asn]: set_error_handler() return type wrongly documented
From:       kalle () php ! net
Date:       2008-10-26 22:40:53
Message-ID: 200810262240.m9QMermG001821 () y1 ! php ! net
[Download RAW message or body]

 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


-- 
PHP Documentation Bugs Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic