3v4l.org

run code in 300+ PHP versions simultaneously
<?php $itemx= [ 'Weapons'=>[ 'Sword'=> [ 'ID' => '1', 'Name' => 'Lurker', 'Value' => '12', 'Made' => 'Acient' ], 'Shield'=> [ 'ID' => '2', 'Name' => 'Obi', 'Value' => '22', 'Made' => 'Acient' ], 'Warhammer'=> [ 'ID' => '3', 'Name' => 'Clotch', 'Value' => '124', 'Made' => 'Acient' ] ], 'Drinks'=>[ 'Water'=> [ 'ID' => '4', 'Name' => 'Clean-water', 'Value' => '1', 'Made' => 'Acient' ], 'Wine'=> [ 'ID' => '5', 'Name' => 'Soff', 'Value' => '5', 'Made' => 'Acient' ], 'Vodka'=> [ 'ID' => '6', 'Name' => 'Laudur', 'Value' => '7', 'Made' => 'Acient' ] ] ]; $cat = 'Drinks'; $id = 4; var_export( array_find( $itemx[$cat], fn($row) => $row['ID'] == $id ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1RcIR
function name:  (null)
number of ops:  15
compiled vars:  !0 = $itemx, !1 = $cat, !2 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   51     1        ASSIGN                                                   !1, 'Drinks'
   52     2        ASSIGN                                                   !2, 4
   53     3        INIT_FCALL                                               'var_export'
   54     4        INIT_FCALL_BY_NAME                                       'array_find'
          5        CHECK_FUNC_ARG                                           
   55     6        FETCH_DIM_FUNC_ARG                               $6      !0, !1
          7        SEND_FUNC_ARG                                            $6
   56     8        DECLARE_LAMBDA_FUNCTION                          ~7      [0]
          9        BIND_LEXICAL                                             ~7, !2
   57    10        SEND_VAL_EX                                              ~7
   54    11        DO_FCALL                                      0  $8      
   57    12        SEND_VAR                                                 $8
   53    13        DO_ICALL                                                 
   58    14      > 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/1RcIR
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $row, !1 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   56     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        FETCH_DIM_R                                      ~2      !0, 'ID'
          3        IS_EQUAL                                         ~3      !1, ~2
          4      > RETURN                                                   ~3
   57     5*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
121.72 ms | 1000 KiB | 14 Q