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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: youwish dot spambot at example dot org
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 13:01:29 2024 UTC