I thought of it after sending the email, so I'll post it again. By combining my 
two ideas, I think I can come up with a smarter proposal.

```
array_first(array $array, int|string &$key = null)
```

If you want to accurately determine whether an array is empty or not, you can 
satisfy your request by checking if the key is null. Users who do not think 
accurate determination is necessary can omit the second argument.

And if you also want a key, it can fulfill that request as well.

Regards.

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

Reply via email to