3v4l.org

run code in 300+ PHP versions simultaneously
<?php $userdb = [ [ 'uid' => [ ['10770'], ['523465'], ['4042389'] ], 'name' => 'Sandra Shush', 'url' => 'urlof100' ], [ 'uid' => [ ['102320'], ['532465'], ['40432389'] ], 'name' => 'Stefanie Mcmohn', 'pic_square' => 'urlof100' ] ]; $find = '523465'; echo array_find_key( $userdb, fn($item) => in_array([$find], $item['uid']) ) ?? 'not found';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3KGhU
function name:  (null)
number of ops:  12
compiled vars:  !0 = $userdb, !1 = $find
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   24     1        ASSIGN                                                   !1, '523465'
   25     2        INIT_FCALL_BY_NAME                                       'array_find_key'
   26     3        SEND_VAR_EX                                              !0
   27     4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          5        BIND_LEXICAL                                             ~4, !1
   28     6        SEND_VAL_EX                                              ~4
   25     7        DO_FCALL                                      0  $5      
   28     8        COALESCE                                         ~6      $5
          9        QM_ASSIGN                                        ~6      'not+found'
         10        ECHO                                                     ~6
         11      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3KGhU
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $item, !1 = $find
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        INIT_FCALL                                               'in_array'
          3        INIT_ARRAY                                       ~2      !1
          4        SEND_VAL                                                 ~2
          5        FETCH_DIM_R                                      ~3      !0, 'uid'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
   28     9*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.75 ms | 1010 KiB | 14 Q