From:
Operating system: Ubuntu
PHP version: 5.4.2
Package: Scripting Engine problem
Bug Type: Feature/Change Request
Bug description:Trait same property conflict in class extending
Description:
------------
Hi,
(version is actually 5.4RC9...)
The same property conflict happens when you have 2 traits (B uses A) where
A defines the property, class Foo uses A and class Bar uses B _and_ extends
Foo.
I would love to see the strict standard to be removed in this situation;
how can a property have a conflict with itself?
Test script:
---------------
<?php
trait A {
public $prop;
}
trait B {
use A;
}
class Foo {
use A;
}
class Bar extends Foo {
use B;
}
Expected result:
----------------
<void>
Actual result:
--------------
Strict Standards: Foo and B define the same property ($prop) in the
composition of Bar. This might be incompatible, to improve maintainability
consider using accessor methods in traits instead.
--
Edit bug report at https://bugs.php.net/bug.php?id=61943&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=61943&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=61943&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=61943&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=61943&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=61943&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=61943&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=61943&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=61943&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=61943&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=61943&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=61943&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=61943&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=61943&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=61943&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=61943&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=61943&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=61943&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=61943&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=61943&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=61943&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=61943&r=mysqlcfg