|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-11-24 11:19 UTC] jani@php.net
-Package: Feature/Change Request
+Package: Scripting Engine problem
[2020-01-08 13:32 UTC] nikic@php.net
[2020-01-08 13:32 UTC] nikic@php.net
-Status: Open
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 03:00:02 2025 UTC |
Description: ------------ In the past, to call a variable as a function, the variable had to be a string: $var = 'strlen'; $var(/*args*/); calls strlen. But in the present, the message is a bit misleading, since it must not necessarily be a string: $foo = function() {echo "bar";}; I consider this to be a very minor thing, but consider the message wrong, anyway. Reproduce code: --------------- function badLambdaCreator($argument) { function($test) use ($argument) { /*Do something*/ }; /*No return given :O*/ } $foo = badLambdaCreator(10); $foo(50); //Fatal error telling you to use strings, //while a lambda is fine too. Expected result: ---------------- A fatal error that also includes lambdas (I guess callbacks work? I'm not sure what name is the most appropiate). Actual result: -------------- An error that tells you that **ONLY** strings can be used.