3v4l.org

run code in 300+ PHP versions simultaneously
<?php $userdb = [ [ 'uid' => '100', 'name' => 'Sandra Shush', 'pic_square' => 'urlof100' ], [ 'uid' => '5465', 'name' => 'Stefanie Mcmohn', 'pic_square' => 'urlof100' ], [ 'uid' => '40489', 'name' => 'Michael', 'pic_square' => 'urlof40489' ] ]; $uid = 100; var_export( array_find_key( $userdb, fn($row) => $row['uid'] == $uid ) );
Output for 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
0
Output for 8.1.0 - 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/hZ3rq:23 Stack trace: #0 {main} thrown in /in/hZ3rq on line 23
Process exited with code 255.

preferences:
62.3 ms | 992 KiB | 4 Q