Bug #68172 [Opn->Nab]: Function name must be a string

From: Date: Tue, 07 Oct 2014 12:50:12 +0000
Subject: Bug #68172 [Opn->Nab]: Function name must be a string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187914@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 Updated by: nikic@php.net Reported by: pegasus at vaultwiki dot org Summary: Function name must be a string -Status: Open +Status: Not a bug 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: As sixd pointed out, this is an intentional BC break. I'll probably provide tooling for automatically finding and fixing issues like these. Previous Comments: ------------------------------------------------------------------------ [2014-10-07 04:25:52] pegasus at vaultwiki dot org 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. ------------------------------------------------------------------------ [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

« previous php.bugs (#187914) next »