|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-08-09 14:24 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Package: Reproducible crash
+Package: Scripting Engine problem
-Assigned To:
+Assigned To: cmb
[2015-08-09 14:24 UTC] cmb@php.net
[2015-08-09 14:31 UTC] sebrogier at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 05:00:01 2025 UTC |
Description: ------------ I have an "Array to string conversion" error on the following code. This occurs only when the method is taken directly in the array. When I use a intermediate variable, there are no error. Test script: --------------- <?php class Foo { public function bar() { echo 'a'; } } $foo = new Foo(); foreach ([['bar']] as $test) { $method = $test[0]; $foo->$method(); // displays "a" ==> success } foreach ([['bar']] as $test) { $foo->$test[0](); // Notice "Array to string conversion" followed by // "Function name must be a string" }