On Tue, Oct 17, 2023, at 05:10, Levi Morrison via internals wrote:
> It's true that sentiment may have shifted in this time. However, a
> common argument at that time still stands: `null` is not a good
> sentintenal for failure because the value inside the array very well
> could have been null. 

What about a signature like:

```php
array_first(array $array, mixed $value_if_missing = null);
```

That would let you specify your own sentinel (or default) where appropriate, 
without losing the convenience of this function.

mjec

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to