Edit report at https://bugs.php.net/bug.php?id=68475&edit=1
ID: 68475
Updated by: jpauli@php.net
Reported by: nicolas dot grekas+php at gmail dot com
Summary: call_user_func($a) not equivalent to $a()
-Status: Assigned
+Status: Closed
Type: Feature/Change Request
Package: Scripting Engine problem
PHP Version: 5.6.3
Assigned To: jpauli
Block user comment: N
Private report: N
New Comment:
Please try using this snapshot:
http://snaps.php.net/php-trunk-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
This is fixed in PHP7
Previous Comments:
------------------------------------------------------------------------
[2015-05-12 07:49:19] jpauli@php.net
Linking https://github.com/php/php-src/pull/1264
------------------------------------------------------------------------
[2015-05-07 08:44:03] me at evertpot dot com
Personally I think the major issue here is not so much that if call_user_func($a) is not equivalent
to $a(), but rather that both is_callable and the callable typehint accepts a value that can't
be invoked with $x().
------------------------------------------------------------------------
[2015-01-09 11:47:04] jpauli@php.net
I don't think we need to RFC that.
What we want, is uniformisation and consistency in the way we can call a PHP function from a PHP
string.
No new idea, no debatte, no RFC needed.
------------------------------------------------------------------------
[2015-01-08 20:16:32] aharvey@php.net
I might prefer unifying the VM code with the code call_user_func() and friends use: something like
https://github.com/LawnGnome/php-src/compare/call-static-methods?expand=1
(albeit I think we'd want to refactor the critical code path out of
zend_is_callable_check_func() into a separate function to minimise the overhead). Having two sources
of truth for what a string callable can look like is what got us in this mess. :)
Whatever the approach, let's do this in PHP 7. Julien, do you want to write the RFC, or shall
I?
------------------------------------------------------------------------
[2014-12-16 13:19:24] jpauli@php.net
I agree that for consistency, this should be supported
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=68475
--
Edit this bug report at https://bugs.php.net/bug.php?id=68475&edit=1