|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-03-19 00:58 UTC] felipe@php.net
-Package: *General Issues
+Package: Scripting Engine problem
[2010-03-21 19:47 UTC] johannes@php.net
-Status: Open
+Status: Bogus
[2010-03-21 19:47 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 08:00:02 2025 UTC |
Description: ------------ If a class instance has a closure as property, PHP must call $this->closure->__invoke() instead of say that method class::closure() does not exist. Test script: --------------- <?php class foo { protected $closure = null; function __construct(\closure $closure) { $this->closure = $closure; } function callClosure() { return $this->closure('Closure::__invoke() was called'); } } $foo = new foo(function($string) { echo $string; }); $foo->callClosure(); ?> Expected result: ---------------- Closure::__invoke() was called Actual result: -------------- Call to undefined method foo::closure() in /path/to/script.php on line 14