3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrayoo = [ 0 => [ 0 => [1,2,3], // +1 1 => [4,5] // +1 ], 1 => [ 0 => [ 0 => [6], // +1 1 => 7 ], // +1 1 => [8,9,10] // +1 ] ]; function monkeys($array, $count) { foreach ($array as $sub) { if (! is_array($sub)) { return 1; } else { var_dump($count); $count += monkeys($sub, $count); return $count; } } } $count = 0; var_dump(monkeys($arrayoo,$count)); var_dump($count);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DI0Mu
function name:  (null)
number of ops:  13
compiled vars:  !0 = $arrayoo, !1 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   28     1        ASSIGN                                                   !1, 0
   29     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'monkeys'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
   30     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function monkeys:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 21
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 21
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/DI0Mu
function name:  monkeys
number of ops:  23
compiled vars:  !0 = $array, !1 = $count, !2 = $sub
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   17     2      > FE_RESET_R                                       $3      !0, ->21
          3    > > FE_FETCH_R                                               $3, !2, ->21
   18     4    >   TYPE_CHECK                                  128  ~4      !2
          5        BOOL_NOT                                         ~5      ~4
          6      > JMPZ                                                     ~5, ->10
   19     7    >   FE_FREE                                                  $3
          8      > RETURN                                                   1
          9*       JMP                                                      ->20
   21    10    >   INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
   22    13        INIT_FCALL_BY_NAME                                       'monkeys'
         14        SEND_VAR_EX                                              !2
         15        SEND_VAR_EX                                              !1
         16        DO_FCALL                                      0  $7      
         17        ASSIGN_OP                                     1          !1, $7
   23    18        FE_FREE                                                  $3
         19      > RETURN                                                   !1
   17    20*       JMP                                                      ->3
         21    >   FE_FREE                                                  $3
   26    22      > RETURN                                                   null

End of function monkeys

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.98 ms | 1403 KiB | 16 Q