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'; $key = null; foreach ($userdb as $index => ['uid' => $uids]) { if (in_array([$find], $uids)) { $key = $index; break; } } echo $key ?? 'not found';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 18
Branch analysis from position: 18
filename:       /in/avEj7
function name:  (null)
number of ops:  23
compiled vars:  !0 = $userdb, !1 = $find, !2 = $key, !3 = $uids, !4 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   24     1        ASSIGN                                                   !1, '523465'
   25     2        ASSIGN                                                   !2, null
   27     3      > FE_RESET_R                                       $8      !0, ->18
          4    > > FE_FETCH_R                                       ~12     $8, $9, ->18
          5    >   FETCH_LIST_R                                     $10     $9, 'uid'
          6        ASSIGN                                                   !3, $10
          7        FREE                                                     $9
          8        ASSIGN                                                   !4, ~12
   28     9        INIT_FCALL                                               'in_array'
         10        INIT_ARRAY                                       ~14     !1
         11        SEND_VAL                                                 ~14
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                         $15     
         14      > JMPZ                                                     $15, ->17
   29    15    >   ASSIGN                                                   !2, !4
   30    16      > JMP                                                      ->18
   27    17    > > JMP                                                      ->4
         18    >   FE_FREE                                                  $8
   34    19        COALESCE                                         ~17     !2
         20        QM_ASSIGN                                        ~17     'not+found'
         21        ECHO                                                     ~17
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.03 ms | 1010 KiB | 14 Q