Bug #55554 [NEW]: Trait methods overriding legacy constructors
| From: | ryan at zuttonet dot com | Date: | Wed, 31 Aug 2011 15:49:30 +0000 |
| Subject: | Bug #55554 [NEW]: Trait methods overriding legacy constructors | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-163192@lists.php.net to get a copy of this message | ||
From:
Operating system: Ubuntu
PHP version: 5.4.0alpha3
Package: *Programming Data Structures
Bug Type: Bug
Bug description:Trait methods overriding legacy constructors
Description:
------------
For the sake of consistency, exactly one of the following should be
implemented:
1. Trait methods should be able to override __construct definitions
2. Trait methods should not be able to override legacy constructor
definitions
Currently, trait methods are not able to override __construct
definitions. Trait methods are able to override legacy constructor
definitions.
Test script:
---------------
Here are two test cases that will reproduce the defect:
https://gist.github.com/1183844
Expected result:
----------------
A trait-level __construct method (or a trait-level method aliased as
__construct)
should not be able to override any type of constructor in a class
Actual result:
--------------
Fatal error: Call to private SomeClass::__construct() from invalid context
--
Edit bug report at https://bugs.php.net/bug.php?id=55554&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55554&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55554&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55554&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=55554&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55554&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=55554&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=55554&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=55554&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=55554&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=55554&r=support
Expected behavior: https://bugs.php.net/fix.php?id=55554&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=55554&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=55554&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=55554&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55554&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=55554&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=55554&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=55554&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=55554&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=55554&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=55554&r=mysqlcfg