[PHP-BUG] Bug #70908 [NEW]: function name must be string
[email protected] ("hebxiaojb at 163 dot com")
| Newsgroups | php.standards |
|---|---|
| Message-ID | <[email protected]> |
From: hebxiaojb at 163 dot com
Operating system: CentOS
PHP version: 7.0.0RC7
Package: PHP Language Specification
Bug Type: Bug
Bug description:function name must be string
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 bug report at https://bugs.php.net/bug.php?id=70908&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70908&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70908&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70908&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70908&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70908&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70908&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70908&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70908&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70908&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70908&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70908&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70908&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70908&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70908&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70908&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70908&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70908&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70908&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70908&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70908&r=mysqlcfg