Bug #70908 [Opn->Nab]: function name must be string
| From: | requinix@php.net | Date: | Fri, 13 Nov 2015 12:25:28 +0000 |
| Subject: | Bug #70908 [Opn->Nab]: function name must be string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-197229@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70908&edit=1
ID: 70908
Updated by: requinix@php.net
Reported by: hebxiaojb at 163 dot com
Summary: function name must be string
-Status: Open
+Status: Not a bug
Type: Bug
-Package: PHP Language Specification
+Package: *General Issues
Operating System: CentOS
PHP Version: 7.0.0RC7
Block user comment: N
Private report: N
New Comment:
https://wiki.php.net/rfc/uniform_variable_syntax
Previous Comments:
------------------------------------------------------------------------
[2015-11-13 10:46:15] laruence@php.net
use $x->{$arr[1]}();
------------------------------------------------------------------------
[2015-11-13 09:33:30] hebxiaojb at 163 dot com
Description:
------------
PHP Notice: Array to string conversion in /data/x.php on line 11
PHP Notice: Undefined property: x::$Array in /data/x.php on line 11
PHP Fatal error: Uncaught Error: Function name must be a string in /data/x.php:11
Stack trace:
#0 {main}
thrown in /data/x.php on line 11
Test script:
---------------
<?php
class x {
function x() {
}
function common() {
}
}
$x = new x();
$arr = ['x', 'common'];
$x->$arr[1]();
Actual result:
--------------
PHP Notice: Array to string conversion in /data/x.php on line 11
PHP Notice: Undefined property: x::$Array in /data/x.php on line 11
PHP Fatal error: Uncaught Error: Function name must be a string in /data/x.php:11
Stack trace:
#0 {main}
thrown in /data/x.php on line 11
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70908&edit=1