php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #63443 ErrorException __construct API changed between 5.2 and 5.3
Submitted: 2012-11-05 16:49 UTC Modified: 2012-11-06 01:58 UTC
From: benoit dot burnichon at airtag dot com Assigned: aharvey (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2012-11-05 16:49 UTC] benoit dot burnichon at airtag dot com
Description:
------------
---
From manual page: http://www.php.net/class.errorexception
---
The __construct API of ErrorException has changed between 5.2 and 5.3. I could 
not find any mention of this in the online documentation.

In the 5.2.17 code (current latest 5.2 branch tag), it could be found

File Zend/zend_exceptions.c:
<code class="C">
/* {{{ proto ErrorException::__construct(string message, int code, int severity 
[, string filename [, int lineno]])
   ErrorException constructor */
ZEND_METHOD(error_exception, __construct)
</code>

The commit that modified the API is 2bf3bfc746f0f034ef9c443ae697b0c3f4b5d3dc 
which is contained in all 5.3.X tags.

File: Zend/zend_exceptions.c
<code class="diff">
@@ -158,8 +182,8 @@ ZEND_METHOD(error_exception, __construct)
 	zval  *object, *previous = NULL;
 	int    argc = ZEND_NUM_ARGS(), message_len, filename_len;
 
-	if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, 
"|sllslO", &message, &message_len, &code, &severity, &filename, &filename_len, 
&lineno, &previous, default_exception_ce) == FAILURE) {
-		zend_error(E_ERROR, "Wrong parameters for ErrorException([string 
$exception [, long $code, [ long $severity, [ string $filename, [ long $lineno 
]]]]])");
+	if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, 
"|sllslO!", &message, &message_len, &code, &severity, &filename, &filename_len, 
&lineno, &previous, default_exception_ce) == FAILURE) {
+		zend_error(E_ERROR, "Wrong parameters for ErrorException([string 
$exception [, long $code, [ long $severity, [ string $filename, [ long $lineno  
[, Exception $previous = NULL]]]]]])");
 	}
 
 	object = getThis();
</code>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-06 01:58 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=328246
Log: Add a changelog for ErrorException::__construct() noting the addition of the
$previous parameter.

Fixes doc bug #63443 (ErrorException __construct API changed between 5.2 and
5.3).
 [2012-11-06 01:58 UTC] aharvey@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: aharvey
 [2012-11-06 01:58 UTC] aharvey@php.net
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.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 17:00:02 2026 UTC