3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a=array("abc"=>array("red","white","orange"),"def"=>array("green","vilot","yellow"),"xyz"=>array("blue","dark","pure")); function search_data($value, $array) { foreach ($array as $key => $val) { if(is_array($val) && in_array($value,$val)) { return $key; } } return null; } echo search_data("dark",$a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ic4ai
function name:  (null)
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'search_data'
          2        SEND_VAL                                                 'dark'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
          6      > RETURN                                                   1

Function search_data:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/ic4ai
function name:  search_data
number of ops:  19
compiled vars:  !0 = $value, !1 = $array, !2 = $val, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2      > FE_RESET_R                                       $4      !1, ->16
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->16
          4    >   ASSIGN                                                   !3, ~5
    6     5        TYPE_CHECK                                  128  ~7      !2
          6      > JMPZ_EX                                          ~7      ~7, ->12
          7    >   INIT_FCALL                                               'in_array'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $8      
         11        BOOL                                             ~7      $8
         12    > > JMPZ                                                     ~7, ->15
    8    13    >   FE_FREE                                                  $4
         14      > RETURN                                                   !3
    5    15    > > JMP                                                      ->3
         16    >   FE_FREE                                                  $4
   11    17      > RETURN                                                   null
   12    18*     > RETURN                                                   null

End of function search_data

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.06 ms | 1005 KiB | 15 Q