Bug #55085 [Opn]: Undocumented BC break with changing __construct() signature

From: Date: Fri, 01 Jul 2011 22:56:21 +0000
Subject: Bug #55085 [Opn]: Undocumented BC break with changing __construct() signature
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-6788@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: felipe@php.net Reported by: vrana@php.net Summary: Undocumented BC break with changing __construct() signature Status: Open Type: Bug -Package: Class/Object related +Package: Documentation problem Operating System: Irrelevant PHP Version: 5.4.0alpha1 Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.doc.bugs (#6788) next »