3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = array( 'a' => array( 'a' => 'apple', 'b' => 'banana', 'c' => 'cranberry', 'd' => 'mango', 'e' => 'pineapple' ), 'b' => array( 'a' => 'apple', 'b' => 'banana', 'c' => 'cranberry', 'd' => 'mango', 'e' => 'pineapple' ), 'c' => 'cranberry', 'd' => 'mango', 'e' => 'pineapple' ); function test(&$child, $entry) { $i = 1; foreach ($child AS $key => $fruit) { if (!is_numeric($key)) { $child[$i] = $fruit; unset($child[$key]); $i++; } } } $i = 1; foreach ($arr AS $key => $fruit) { $arr[$i] = $fruit; if (is_array($fruit)) { test($arr[$i], $fruit); } unset($arr[$key]); $i++; } var_dump($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 14
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/XrVYT
function name:  (null)
number of ops:  22
compiled vars:  !0 = $arr, !1 = $i, !2 = $fruit, !3 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   37     1        ASSIGN                                                       !1, 1
   39     2      > FE_RESET_R                                           $6      !0, ->17
          3    > > FE_FETCH_R                                           ~7      $6, !2, ->17
          4    >   ASSIGN                                                       !3, ~7
   41     5        ASSIGN_DIM                                                   !0, !1
          6        OP_DATA                                                      !2
   43     7        TYPE_CHECK                                      128          !2
          8      > JMPZ                                                         ~10, ->14
   45     9    >   INIT_FCALL                                                   'test'
         10        FETCH_DIM_W                                          $11     !0, !1
         11        SEND_REF                                                     $11
         12        SEND_VAR                                                     !2
         13        DO_FCALL                                          0          
   48    14    >   UNSET_DIM                                                    !0, !3
   49    15        PRE_INC                                                      !1
   39    16      > JMP                                                          ->3
         17    >   FE_FREE                                                      $6
   52    18        INIT_FCALL                                                   'var_dump'
         19        SEND_VAR                                                     !0
         20        DO_ICALL                                                     
         21      > RETURN                                                       1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 13
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/XrVYT
function name:  test
number of ops:  16
compiled vars:  !0 = $child, !1 = $entry, !2 = $i, !3 = $fruit, !4 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   22     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   24     2        ASSIGN                                                       !2, 1
   26     3      > FE_RESET_R                                           $6      !0, ->14
          4    > > FE_FETCH_R                                           ~7      $6, !3, ->14
          5    >   ASSIGN                                                       !4, ~7
   28     6        FRAMELESS_ICALL_1                is_numeric          ~9      !4
          7        BOOL_NOT                                             ~10     ~9
          8      > JMPZ                                                         ~10, ->13
   30     9    >   ASSIGN_DIM                                                   !0, !2
         10        OP_DATA                                                      !3
   31    11        UNSET_DIM                                                    !0, !4
   32    12        PRE_INC                                                      !2
   26    13    > > JMP                                                          ->4
         14    >   FE_FREE                                                      $6
   35    15      > RETURN                                                       null

End of function test

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
194.49 ms | 3000 KiB | 17 Q