Bug #55085 [NEW]: Undocumented BC break with changing __construct() signature
| From: | vrana@php.net | Date: | Thu, 30 Jun 2011 11:42:44 +0000 |
| Subject: | Bug #55085 [NEW]: Undocumented BC break with changing __construct() signature | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-161427@lists.php.net to get a copy of this message | ||
From:
Operating system: Irrelevant
PHP version: 5.4.0alpha1
Package: Class/Object related
Bug Type: Bug
Bug description:Undocumented BC break with changing __construct() signature
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 bug report at https://bugs.php.net/bug.php?id=55085&edit=1
--
Try a snapshot (PHP 5.2): https://bugs.php.net/fix.php?id=55085&r=trysnapshot52
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55085&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55085&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=55085&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55085&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=55085&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=55085&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=55085&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=55085&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=55085&r=support
Expected behavior: https://bugs.php.net/fix.php?id=55085&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=55085&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=55085&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=55085&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55085&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=55085&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=55085&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=55085&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=55085&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=55085&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=55085&r=mysqlcfg
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55085&r=trysnapshot54