|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69194 Variable variables using an array to call a method broken
Submitted: 2015-03-05 17:32 UTC Modified: 2015-03-05 17:39 UTC
From: donatj at gmail dot com Assigned:
Status: Not a bug Package: Variables related
PHP Version: master-Git-2015-03-05 (Git) OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: donatj at gmail dot com
New email:
PHP Version: OS:


 [2015-03-05 17:32 UTC] donatj at gmail dot com

The problem is illustrated here. It is causing a number of my tests to fail in 7 using build 20150201.

Test script:

class Foo {
    function bar(){
        echo "Futbal";

$baz = new Foo;
$qux = array("quux" => "bar");

Expected result:

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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-05 17:39 UTC]
-Status: Open +Status: Not a bug
 [2015-03-05 17:39 UTC]
This is an intentional BC break in PHP 7, please write $baz->{$qux["quux"]}() instead.

See for a summary of related changes and for detailed information.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 28 02:01:31 2024 UTC