Doc #55085 [Opn->Csd]: Undocumented BC break with changing __construct() signature
| From: | nikic@php.net | Date: | Sat, 17 Sep 2011 10:01:39 +0000 |
| Subject: | Doc #55085 [Opn->Csd]: Undocumented BC break with changing __construct() signature | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-7227@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55085&edit=1
ID: 55085
Updated by: nikic@php.net
Reported by: vrana@php.net
Summary: Undocumented BC break with changing __construct()
signature
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: Irrelevant
PHP Version: 5.4.0alpha1
-Assigned To:
+Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
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.
===
I updated the abstract documentation and the OOP changelog.
Previous Comments:
------------------------------------------------------------------------
[2011-09-17 10:01:00] nikic@php.net
Automatic comment from SVN on behalf of nikic
Revision: http://svn.php.net/viewvc/?view=revision&revision=316905
Log: Followup for Doc Bug #55085: Undocumented BC break with changing __construct() signature
------------------------------------------------------------------------
[2011-09-17 09:54:48] nikic@php.net
Automatic comment from SVN on behalf of nikic
Revision: http://svn.php.net/viewvc/?view=revision&revision=316904
Log: Fix Doc Bug #55085: Undocumented BC break with changing __construct() signature
------------------------------------------------------------------------
[2011-07-01 18:56:21] felipe@php.net
This change was introduced by fixing bug #51421, I reverted it from 5.2 and 5.3 for the BC issues,
and missed to add it to 5.4/trunk NEWS.
------------------------------------------------------------------------
[2011-06-30 07:42:44] vrana@php.net
Description:
------------
PHP 5.* allows changing an abstract __construct() signature without any notice. PHP 5.4 issues fatal
error.
I didn't find this BC break in news.txt so I think that it is a bug.
Test script:
---------------
<?php
abstract class P {
abstract function __construct();
}
class C extends P {
function __construct($a) {
}
}
?>
Expected result:
----------------
Nothing - same as in PHP 5.*.
The strange thing is that if we replace "abstract function __construct();" by
"function __construct() {}" then the behavior is same as in previous versions.
Actual result:
--------------
Fatal error: Declaration of C::__construct() must be compatible with that of P::__construct()
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55085&edit=1