3v4l.org

run code in 300+ PHP versions simultaneously
<?php function printAll(&$a) { if (!is_array($a)) { //echo $a . "<br/>"; return; } foreach($a as $b =>$c) { if(is_array($c)) { if($a =="nutts"){$a["test"] = array();} // trying to loop though multidimensional array and add array echo "here is a step $b<br/>"; printAll($c); } // end if array } // end foreach //printAll($a); }// end printAll $array = array('hello', "natts"=>array('world', '!', array('whats'), 'up'), array('?')); printAll($aarray); var_dump($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XKreQ
function name:  (null)
number of ops:  8
compiled vars:  !0 = $array, !1 = $aarray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   ASSIGN                                                   !0, <array>
   26     1        INIT_FCALL                                               'printall'
          2        SEND_REF                                                 !1
          3        DO_FCALL                                      0          
   27     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function printall:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 22
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 22
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 21
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 14
Branch analysis from position: 21
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/XKreQ
function name:  printAll
number of ops:  24
compiled vars:  !0 = $a, !1 = $c, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        TYPE_CHECK                                  128  ~3      !0
          2        BOOL_NOT                                         ~4      ~3
          3      > JMPZ                                                     ~4, ->5
    6     4    > > RETURN                                                   null
    8     5    > > FE_RESET_R                                       $5      !0, ->22
          6    > > FE_FETCH_R                                       ~6      $5, !1, ->22
          7    >   ASSIGN                                                   !2, ~6
   10     8        TYPE_CHECK                                  128          !1
          9      > JMPZ                                                     ~8, ->21
   12    10    >   IS_EQUAL                                                 !0, 'nutts'
         11      > JMPZ                                                     ~9, ->14
         12    >   ASSIGN_DIM                                               !0, 'test'
         13        OP_DATA                                                  <array>
   13    14    >   ROPE_INIT                                     3  ~12     'here+is+a+step+'
         15        ROPE_ADD                                      1  ~12     ~12, !2
         16        ROPE_END                                      2  ~11     ~12, '%3Cbr%2F%3E'
         17        ECHO                                                     ~11
   14    18        INIT_FCALL_BY_NAME                                       'printAll'
         19        SEND_VAR_EX                                              !1
         20        DO_FCALL                                      0          
    8    21    > > JMP                                                      ->6
         22    >   FE_FREE                                                  $5
   18    23      > RETURN                                                   null

End of function printall

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.9 ms | 1403 KiB | 16 Q