|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-10-28 22:38 UTC] felipe@php.net
-Status: Open
+Status: Bogus
-Package: Class/Object related
+Package: Scripting Engine problem
[2010-10-28 22:38 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 02:00:02 2025 UTC |
Description: ------------ The magic invoke function fails to trigger if an object belongs to another object. Test script: --------------- class A { public function __invoke() { echo 'hello from A '; } } class B { protected $a; public function __invoke() { echo 'hello from B '; $this->a = new A(); $this->a(); } } $b = new B(); $b(); Expected result: ---------------- hello from B hello from A Actual result: -------------- hello from B Fatal error: Call to undefined method B::a() in C:\xampp\gazelle\tools\htdocs\testing.php on line 15