|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-12-14 18:15 UTC] andrey at phpteam dot pro
[2017-12-14 18:24 UTC] andrey at phpteam dot pro
-PHP Version: 7.2.0
+PHP Version: 7.1.11
[2017-12-14 18:24 UTC] andrey at phpteam dot pro
[2017-12-14 21:47 UTC] requinix@php.net
-Status: Open
+Status: Duplicate
[2017-12-14 21:47 UTC] requinix@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 01:00:01 2025 UTC |
Description: ------------ PHP 7.1.11 Using a function from trait ends up with using wrong function. Test script: --------------- <?php trait traitA { public function __invoke() { echo "traitA\n"; } } trait traitB { public function __invoke() { echo "traitB\n"; } } class JustAClass { use traitA { __invoke as protected hocus; } use traitB { __invoke as protected pocus; } public function __invoke() { $this->hocus(); $this->pocus(); } } $instance = new JustAClass(); $instance(); Expected result: ---------------- traitA traitB Actual result: -------------- traitA traitA