Bug #69084 [NEW]: Unclear error message when not implementing a renamed abstract trait function
From: fredemmott
Operating system: n/a
PHP version: 5.6.5
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Unclear error message when not implementing a renamed abstract trait function
Description:
------------
It reports that the non-renamed function has not been implemented, even
when it has. eg http://3v4l.org/vDEP9#v5411
Test script:
---------------
<?php
trait Foo {
abstract public function doStuff();
public function main() {
$this->doStuff();
}
}
class Bar {
use Foo {
Foo::doStuff as doOtherStuff;
}
public function doStuff() {
var_dump(__FUNCTION__);
}
}
$b = new Bar();
$b->main();
Expected result:
----------------
Complaint about doOtherStuff not being implemented.
Actual result:
--------------
Fatal error: Class Bar contains 1 abstract method and must therefore be
declared abstract or implement the remaining methods (Bar::doStuff) in
/in/vDEP9 on line 19
--
Edit bug report at https://bugs.php.net/bug.php?id=69084&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69084&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69084&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69084&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69084&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69084&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69084&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69084&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69084&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69084&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69084&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69084&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69084&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69084&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69084&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69084&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69084&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69084&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69084&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69084&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69084&r=mysqlcfg
Thread (2 messages)
- fredemmott@php.net