|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76773 Traits used on the parent are ignored for child classes
Submitted: 2018-08-21 12:43 UTC Modified: 2018-08-23 11:14 UTC
From: nicolas dot grekas+php at gmail dot com Assigned: daverandom (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 7.3.0beta2 OS:
Private report: No CVE-ID: None
 [2018-08-21 12:43 UTC] nicolas dot grekas+php at gmail dot com
See test script or

Test script:

trait MyTrait
    public function hello()
        echo __CLASS__, "\n";

        if (\is_callable(array('parent', __FUNCTION__))) {

class ParentClass
    use MyTrait;

class ChildClass extends ParentClass
    use MyTrait;

$c = new ChildClass();

Expected result:

(as is the case since 5.4)

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-21 16:49 UTC]
-Status: Open +Status: Verified -Assigned To: +Assigned To: pmmaga
 [2018-08-21 16:49 UTC]
This regression has apparently been introduced by commit
179ed6e[1].  Pedro, could you please have a look at this issue?

[1] <;a=commit;h=179ed6e>
 [2018-08-21 18:44 UTC]
-Assigned To: pmmaga +Assigned To: daverandom
 [2018-08-21 18:44 UTC]
Indeed, that is the cause. daverandom already came up with a fix in thus I'm assigning it to him. Thanks cmb for the heads up and thanks Nicolas for the report.
 [2018-08-22 12:09 UTC]
Automatic comment on behalf of daverandom
Log: Fix #76773 - Methods with a concrete scope need to be added again
 [2018-08-22 12:09 UTC]
-Status: Verified +Status: Closed
 [2018-08-23 10:53 UTC] nicolas dot grekas+php at gmail dot com
I don't know if this is related, but today the engine cannot load any traits, see
 [2018-08-23 11:06 UTC]
I think it's more likely to be related to, please report a new bug
 [2018-08-23 11:14 UTC] nicolas dot grekas+php at gmail dot com
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Dec 06 15:01:27 2023 UTC