# array_filter(): by-ref parameter in callback

- Thread: https://externals.io/message/97553
- Original archive: https://news-web.php.net/php.internals/97553
- Started by Christoph M. Becker on 2017-01-07T13:13:35+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #97553 — Christoph M. Becker — 2017-01-07T13:13:35+00:00

URL: https://externals.io/message/97553#97553

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
