php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #55085 Undocumented BC break with changing __construct() signature
Submitted: 2011-06-30 07:42 UTC Modified: 2011-09-17 10:01 UTC
From: vrana@php.net Assigned: nikic (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.4.0alpha1 OS: Irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: vrana@php.net
New email:
PHP Version: OS:

 

 [2011-06-30 07:42 UTC] 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()


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-01 18:56 UTC] felipe@php.net
-Package: Class/Object related +Package: Documentation problem
 [2011-07-01 18:56 UTC] 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-09-17 09:15 UTC] nikic@php.net
-Type: Bug +Type: Documentation Problem
 [2011-09-17 09:54 UTC] nikic@php.net
Automatic comment from SVN on behalf of nikic
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=316904
Log: Fix Doc Bug #55085: Undocumented BC break with changing __construct() signature
 [2011-09-17 10:01 UTC] nikic@php.net
Automatic comment from SVN on behalf of nikic
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=316905
Log: Followup for Doc Bug #55085: Undocumented BC break with changing __construct() signature
 [2011-09-17 10:01 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2011-09-17 10:01 UTC] nikic@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.

===

I updated the abstract documentation and the OOP changelog.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 01 01:01:28 2024 UTC