|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-08-15 21:07 UTC] php-bugs at majkl578 dot cz
[2011-08-15 22:16 UTC] gron@php.net
[2011-08-15 22:20 UTC] gron@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: gron
[2011-08-15 22:20 UTC] gron@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 03:00:01 2025 UTC |
Description: ------------ A fatal error occurs when a method is called from a trait, which is implemented in the parent class of the class that utilises the trait. Feels related to #55355 that was fixed. Test script: --------------- <?php trait Required { function setRequired() { $this->setAttribute('required', true); return $this; } abstract function setAttribute($name, $value); } class Input { protected $attributes = []; function setAttribute($name, $value) { $this->attributes[$name] = $value; } } class Text extends Input { use Required; } $t = new Text(); $t->setRequired(); Expected result: ---------------- No fatal error. Actual result: -------------- PHP Fatal error: Call to undefined method Text::setAttribute() in /home/jared/Temp/trait2.php on line 7 Fatal error: Call to undefined method Text::setAttribute() in /home/jared/Temp/trait2.php on line 7