|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-12-01 05:52 UTC] laruence@php.net
[2012-12-01 05:52 UTC] laruence@php.net
[2012-12-01 14:05 UTC] stealz at op dot pl
[2012-12-03 09:16 UTC] laruence@php.net
-Status: Open
+Status: Not a bug
[2012-12-03 09:16 UTC] laruence@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 10:00:02 2025 UTC |
Description: ------------ I think PHP should check whether traits were used already (ex. in parent class) and ignore them instead using again. It causes fatal error due to collisions which are obvious, because trait name is the same. What's interesting, collisions refer only to methods. PHP seems not to see the problem if double-used trait contains properties only. Test script: --------------- trait LifeOrganism { public $age; // it's fine #public function live() {} // uncomment to get Fatal error } trait Man { use LifeOrganism; } trait Elephant { use LifeOrganism; } class ElephantMan { use Man, Elephant; } Expected result: ---------------- Ignore trait which was already used. Actual result: -------------- Fatal error.