Bug #76700 [Opn->Ver]: false-positive "Error: Call to protected method" when using trait aliases

From: Date: Fri, 03 Aug 2018 16:14:55 +0000
Subject: Bug #76700 [Opn->Ver]: false-positive "Error: Call to protected method" when using trait aliases
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216565@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76700&edit=1 ID: 76700 Updated by: pmmaga@php.net Reported by: nicolas dot grekas+php at gmail dot com Summary: false-positive "Error: Call to protected method" when using trait aliases -Status: Open +Status: Verified Type: Bug Package: Scripting Engine problem PHP Version: 7.3.0beta1 -Assigned To: +Assigned To: pmmaga Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2018-08-03 15:36:13] nicolas dot grekas+php at gmail dot com Description: ------------ See test script, or https://3v4l.org/Tti7T Works on PHP < 7.3 Test script: --------------- <?php trait T1 { protected function aa() { echo 123; } } trait T2 { use T1 { aa as public; } } class A { use T1; } class B extends A { use T2; } $b = new B(); $b->aa(); Expected result: ---------------- 123 Actual result: -------------- Fatal error: Uncaught Error: Call to protected method A::aa() from context '' ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76700&edit=1

« previous php.bugs (#216565) next »