|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-03-05 17:32 UTC] donatj at gmail dot com
Description: ------------ http://3v4l.org/3NKUS The problem is illustrated here. It is causing a number of my tests to fail in 7 using build 20150201. Test script: --------------- <?php class Foo { function bar(){ echo "Futbal"; } } $baz = new Foo; $qux = array("quux" => "bar"); $baz->$qux["quux"](); Expected result: ---------------- "Futbal" Actual result: -------------- Notice: Array to string conversion in /in/3NKUS on line 13 Notice: Undefined property: Foo::$Array in /in/3NKUS on line 13 Fatal error: Function name must be a string in /in/3NKUS on line 13 Process exited with code 255. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 09:00:01 2025 UTC |
This is an intentional BC break in PHP 7, please write $baz->{$qux["quux"]}() instead. See https://github.com/php/php-src/blob/master/UPGRADING#L27 for a summary of related changes and https://wiki.php.net/rfc/uniform_variable_syntax for detailed information.