|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-11-13 09:33 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 18:00:02 2026 UTC |
use $x->{$arr[1]}();