Doc #63157 [NEW]: Wrong Documentation of Class ErrorException
| From: | xianrenb at gmail dot com | Date: | Tue, 25 Sep 2012 01:04:57 +0000 |
| Subject: | Doc #63157 [NEW]: Wrong Documentation of Class ErrorException | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-8901@lists.php.net to get a copy of this message | ||
From: xianrenb at gmail dot com
Operating system:
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:Wrong Documentation of Class ErrorException
Description:
------------
---
From manual page: http://www.php.net/class.errorexception
---
I think doc bug #63125 (https://bugs.php.net/bug.php?id=63125) was
closed as "Not a bug" without proper reasons, so I have to open a new
bug.
Please see the comments I made in the above bug report.
I think the documentation should match the source code, as in
https://github.com/php/php-src/blob/master/Zend/zend_exceptions.c
(24
Sep, 2012),
lines 221~228:
/* {{{ proto ErrorException::__construct(string message, int code, int
severity [, string filename [, int lineno [, Exception previous]]])
ErrorException constructor */
ZEND_METHOD(error_exception, __construct)
{
char *message = NULL, *filename = NULL;
long code = 0, severity = E_ERROR, lineno;
zval *object, *previous = NULL;
int argc = ZEND_NUM_ARGS(), message_len, filename_len;
Expected result:
----------------
Class synopsis documented as:
ErrorException extends Exception {
/* Properties */
protected int $severity ;
/* Methods */
public __construct ([ string $message = "" [, int $code = 0 [, int
$severity = E_ERROR [, string $filename = __FILE__ [, int $lineno =
__LINE__ [, Exception $previous = NULL ]]]]]] )
final public int getSeverity ( void )
/* Inherited methods */
final public string Exception::getMessage ( void )
final public Exception Exception::getPrevious ( void )
final public mixed Exception::getCode ( void )
final public string Exception::getFile ( void )
final public int Exception::getLine ( void )
final public array Exception::getTrace ( void )
final public string Exception::getTraceAsString ( void )
public string Exception::__toString ( void )
final private void Exception::__clone ( void )
}
Example documented as:
<?php
function exception_error_handler($errno, $errstr, $errfile, $errline ) {
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
set_error_handler("exception_error_handler");
/* Trigger exception */
strpos();
?>
Actual result:
--------------
Class synopsis documented as:
ErrorException extends Exception {
/* Properties */
protected int $severity ;
/* Methods */
public __construct ([ string $message = "" [, int $code = 0 [, int
$severity = 1 [, string $filename = __FILE__ [, int $lineno = __LINE__
[, Exception $previous = NULL ]]]]]] )
final public int getSeverity ( void )
/* Inherited methods */
final public string Exception::getMessage ( void )
final public Exception Exception::getPrevious ( void )
final public mixed Exception::getCode ( void )
final public string Exception::getFile ( void )
final public int Exception::getLine ( void )
final public array Exception::getTrace ( void )
final public string Exception::getTraceAsString ( void )
public string Exception::__toString ( void )
final private void Exception::__clone ( void )
}
Example documented as:
<?php
function exception_error_handler($errno, $errstr, $errfile, $errline ) {
throw new ErrorException($errstr, $errno, 0, $errfile, $errline);
}
set_error_handler("exception_error_handler");
/* Trigger exception */
strpos();
?>
--
Edit bug report at https://bugs.php.net/bug.php?id=63157&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63157&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63157&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63157&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=63157&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=63157&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63157&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=63157&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=63157&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=63157&r=support
Expected behavior: https://bugs.php.net/fix.php?id=63157&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=63157&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=63157&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=63157&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63157&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63157&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=63157&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=63157&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63157&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63157&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=63157&r=mysqlcfg