3v4l.org

run code in 500+ PHP versions simultaneously
<?php $list[7362][0]['value'] = 'apple'; $list[7362][1]['value'] = 'orange'; $list[9215][0]['value'] = 'lemon'; $find = 'orange'; var_export( array_find_key( $list, fn($row) => array_any( $row, fn($sub) => $sub['value'] === $find ) ) );
Output for 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
7362
Output for 8.1.32 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30
Fatal error: Uncaught Error: Call to undefined function array_find_key() in /in/JAkkD:10 Stack trace: #0 {main} thrown in /in/JAkkD on line 10
Process exited with code 255.

preferences:
48.42 ms | 861 KiB | 4 Q