3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [1, 2, 3, 4, 5]; $b = array_filter($a, fn ($x) => $x <= 3); $c = array_filter($a, fn ($x) => $x >= 3); var_dump(array_is_list($a)); var_dump(array_is_list($b)); var_dump(array_is_list($c));
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
bool(true) 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/VegUr:8 Stack trace: #0 {main} thrown in /in/VegUr on line 8
Process exited with code 255.

preferences:
65.08 ms | 407 KiB | 5 Q