Bug #68172 [Com]: Function name must be a string
| From: | pegasus at vaultwiki dot org | Date: | Tue, 07 Oct 2014 04:25:53 +0000 |
| Subject: | Bug #68172 [Com]: Function name must be a string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-187909@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68172&edit=1
ID: 68172
Comment by: pegasus at vaultwiki dot org
Reported by: pegasus at vaultwiki dot org
Summary: Function name must be a string
Status: Open
Type: Bug
Package: Scripting Engine problem
Operating System: Centos 6 64-bit
PHP Version: master-Git-2014-10-07 (Git)
Block user comment: N
Private report: N
New Comment:
I can accept that vBulletin 4 will not be usable with the next iteration of PHP using
vBulletin's official distro (I doubt they are updating that branch anymore). It was easy enough
to modify the source on my installation, so it's not an issue for me. Hopefully others
won't be caught off-guard by this issue.
Previous Comments:
------------------------------------------------------------------------
[2014-10-07 03:35:48] sixd@php.net
See https://wiki.php.net/rfc/uniform_variable_syntax
------------------------------------------------------------------------
[2014-10-07 03:00:48] pegasus at vaultwiki dot org
Description:
------------
Assuming an object scope, where $info['callback'] = 'callbackMethod' and
'callbackMethod' is a method on $this object.
The following code works under 5.6.0:
####
$out = $this->$info['callback']($data);
####
But in Master it throws a fatal error (Function name must be a string).
Changing it to the following and it again works as expected:
####
$out = $this->{$info['callback']}($data);
####
Unfortunately this code is from another vendor, so I cannot expect them to change this although
using curly braces may be better practice in general to specify the proper evaluation order.
Expected result:
----------------
No fatal error.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68172&edit=1