Commit d4e5fcd
[PHP 8.5] Add
Adds polyfills for the PHP 8.5's `array_first` and `array_last`
functions.
The polyfills would have been a bit cleaner if we used the
`array_key_first` and `array_key_last` functions, but they were added
in PHP 7.3, and are not available on PHP 7.2.
This adds the same tests from php-src patch.
- [RFC: `array_first()` and `array_last()`](https://wiki.php.net/rfc/array_first_last)
- [php-src commit](php/php-src@168343d)
- [PHP.Watch polyfill for PHP 8.0+](https://php.watch/versions/8.5/array_first-array_last)
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>array_first and array_last
1 parent 6fedf31 commit d4e5fcd
3 files changed
+23
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
36 | 50 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
0 commit comments