php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #69774 unnecessary disambiguation request in traits
Submitted: 2015-06-08 16:57 UTC Modified: 2015-06-09 14:13 UTC
From: youwish dot spambot at example dot org Assigned: cmb (profile)
Status: Duplicate Package: *General Issues
PHP Version: master-Git-2015-06-08 (Git) OS:
Private report: No CVE-ID: None
 [2015-06-08 16:57 UTC] youwish dot spambot at example dot org
Description:
------------
trait A { function sigh(){} }
trait B{ use A; }
trait C{ use A; }
class GAWD{
    use B;
    use C;
}

Fatal error: Trait method sigh has not been applied, because there are collisions with other trait methods on GAWD in...


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-08 18:03 UTC] cmb@php.net
-Type: Bug +Type: Feature/Change Request
 [2015-06-08 18:03 UTC] cmb@php.net
It is documented[1]:

| If two Traits insert a method with the same name, a fatal error
| is produced, if the conflict is not explicitly resolved.

Therefore this is not a bug – I'm changing to feature request.

[1] <http://php.net/manual/en/language.oop5.traits.php#language.oop5.traits.conflict>
 [2015-06-09 14:13 UTC] cmb@php.net
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2015-06-09 14:13 UTC] cmb@php.net
Well, actually this is a duplicate of bug #63911.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Jan 22 17:01:25 2019 UTC