# Drop map/reduction/filter warnings

- Thread: https://externals.io/message/91057
- Original archive: https://news-web.php.net/php.internals/91057
- Started by Tim Bezhashvyly on 2016-02-02T21:53:01+00:00
- Messages: 3
- 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

---

## #91057 — Tim Bezhashvyly — 2016-02-02T21:53:01+00:00

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

Dear internals,

I would like to propose the following RFC:

If an exception is thrown inside array_reduce, array_map, array_filter, etc callback don't flush meaningless warnings like:

> An error occurred while invoking the reduction callback ...

but pass an exception from a closure outside.

Currently this can be achieved by muting array_* with a @ but this is ugly.

Regards,
Tim

---

## #91058 — Marco Pivetta — 2016-02-02T21:57:27+00:00

URL: https://externals.io/message/91057#91058 · In reply to: #91057

This is already the case for PHP 7.x: https://3v4l.org/0Qinj

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

On 2 February 2016 at 22:53, Tim Bezhashvyly <tim.bezhashvyly@gmail.com>
wrote:

> Dear internals,
>
> I would like to propose the following RFC:
>
> If an exception is thrown inside array_reduce, array_map, array_filter,
> etc callback don't flush meaningless warnings like:
>
> > […]
>
> but pass an exception from a closure outside.
>
> Currently this can be achieved by muting array_* with a @ but this is ugly.
>
> Regards,
> Tim

---

## #91059 — Nikita Popov — 2016-02-02T21:58:17+00:00

URL: https://externals.io/message/91057#91059 · In reply to: #91057

On Tue, Feb 2, 2016 at 10:53 PM, Tim Bezhashvyly <tim.bezhashvyly@gmail.com>
wrote:

> Dear internals,
>
> I would like to propose the following RFC:
>
> If an exception is thrown inside array_reduce, array_map, array_filter,
> etc callback don't flush meaningless warnings like:
>
> > […]
>
> but pass an exception from a closure outside.
>
> Currently this can be achieved by muting array_* with a @ but this is ugly.
>

This has already been fixed in PHP 7, see for example https://3v4l.org/GmnIV
.

Nikita
