3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = [ 'main' => [ 'number1' => '9000.99', 'number2' => 'nonono' ] ]; $arr2 = [ 'key1' => ['number1','b','c'] ]; function read($arr, $arr2) { foreach ($arr as $key => $value) { if (is_array($value)) { read($value, $arr2); } else { echo $key; foreach($arr2 as $action) { var_dump($action); if(array_key_exists($key, array_flip($action))){ echo $value; } } } } } read($arr1, $arr2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/702b7
function name:  (null)
number of ops:  7
compiled vars:  !0 = $arr1, !1 = $arr2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1        ASSIGN                                                   !1, <array>
   36     2        INIT_FCALL                                               'read'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function read:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 27
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 27
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 25
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 25
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 24
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 24
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 25
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/702b7
function name:  read
number of ops:  29
compiled vars:  !0 = $arr, !1 = $arr2, !2 = $value, !3 = $key, !4 = $action
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   17     2      > FE_RESET_R                                       $5      !0, ->27
          3    > > FE_FETCH_R                                       ~6      $5, !2, ->27
          4    >   ASSIGN                                                   !3, ~6
   18     5        TYPE_CHECK                                  128          !2
          6      > JMPZ                                                     ~8, ->12
   19     7    >   INIT_FCALL_BY_NAME                                       'read'
          8        SEND_VAR_EX                                              !2
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0          
   18    11      > JMP                                                      ->26
   22    12    >   ECHO                                                     !3
   23    13      > FE_RESET_R                                       $10     !1, ->25
         14    > > FE_FETCH_R                                               $10, !4, ->25
   24    15    >   INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !4
         17        DO_ICALL                                                 
   25    18        INIT_FCALL                                               'array_flip'
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                         $12     
         21        ARRAY_KEY_EXISTS                                         !3, $12
         22      > JMPZ                                                     ~13, ->24
   27    23    >   ECHO                                                     !2
   23    24    > > JMP                                                      ->14
         25    >   FE_FREE                                                  $10
   17    26    > > JMP                                                      ->3
         27    >   FE_FREE                                                  $5
   34    28      > RETURN                                                   null

End of function read

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.66 ms | 1468 KiB | 16 Q