3v4l.org

run code in 300+ PHP versions simultaneously
<?php $t = array( array('a1'), array('a2'), array('a3'), array('a4'), array('a5'), array('a6'), array('a7'), array('a8'), array('a9'), array('a10') ); $count = 1; $max=20; function toto($arr=array()) { global $t; $count++; $arr += array_slice($t,count($arr),2); if(count($arr) < 6 && $count < $max) { $arr = toto($arr); } return $arr; } print_r(toto());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r5fY7
function name:  (null)
number of ops:  9
compiled vars:  !0 = $t, !1 = $count, !2 = $max
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   14     1        ASSIGN                                                   !1, 1
   15     2        ASSIGN                                                   !2, 20
   26     3        INIT_FCALL                                               'print_r'
          4        INIT_FCALL                                               'toto'
          5        DO_FCALL                                      0  $6      
          6        SEND_VAR                                                 $6
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function toto:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 20
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 15
filename:       /in/r5fY7
function name:  toto
number of ops:  22
compiled vars:  !0 = $arr, !1 = $t, !2 = $count, !3 = $max
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV_INIT                                        !0      <array>
   17     1        BIND_GLOBAL                                              !1, 't'
   18     2        PRE_INC                                                  !2
   19     3        INIT_FCALL                                               'array_slice'
          4        SEND_VAR                                                 !1
          5        COUNT                                            ~5      !0
          6        SEND_VAL                                                 ~5
          7        SEND_VAL                                                 2
          8        DO_ICALL                                         $6      
          9        ASSIGN_OP                                     1          !0, $6
   20    10        COUNT                                            ~8      !0
         11        IS_SMALLER                                       ~9      ~8, 6
         12      > JMPZ_EX                                          ~9      ~9, ->15
         13    >   IS_SMALLER                                       ~10     !2, !3
         14        BOOL                                             ~9      ~10
         15    > > JMPZ                                                     ~9, ->20
   21    16    >   INIT_FCALL_BY_NAME                                       'toto'
         17        SEND_VAR_EX                                              !0
         18        DO_FCALL                                      0  $11     
         19        ASSIGN                                                   !0, $11
   23    20    > > RETURN                                                   !0
   24    21*     > RETURN                                                   null

End of function toto

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.71 ms | 1399 KiB | 18 Q