Welcome! Log In Create A New Profile


[PHP-DEV] array_filter(): by-ref parameter in callback

Posted by Christoph M. Becker 
Christoph M. Becker
[PHP-DEV] array_filter(): by-ref parameter in callback
January 07, 2017 02:20PM

There's a patch by Jesse Donat in PhDOE which suggest to add the
following info to the array_filter() man page:

| As of PHP7 the value of the callback may no longer be used by
| reference.

Actually, it seems that declaring the callback parameter by-ref is
allowed (i.e. doesn't raise a notice or warning), but assignments to the
parameter are silently ignored as of PHP 7.0.0, see

I have not been able to find any info about this in UPGRADING, so I
wonder whether this behavioral change was intentional, and which other
functions are affected as well.

Christoph M. Becker

PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Sorry, only registered users may post in this forum.

Click here to login