3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = ['a', 'b', 'c']; var_dump(array_is_list($array)); $filter = array_filter($array, fn ($item) => $item != 'a'); var_dump(array_is_list($filter));
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
bool(true) bool(false)
Output for 8.0.1 - 8.0.30
Fatal error: Uncaught Error: Call to undefined function array_is_list() in /in/JZS9N:5 Stack trace: #0 {main} thrown in /in/JZS9N on line 5
Process exited with code 255.

preferences:
76.25 ms | 1101 KiB | 4 Q