array_filter(): by-ref parameter in callback
| From: | Christoph M. Becker | Date: | Sat, 07 Jan 2017 13:13:35 +0000 |
| Subject: | array_filter(): by-ref parameter in callback | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-97553@lists.php.net to get a copy of this message | ||
Hi!
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
<https://3v4l.org/T0fvi>.
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