3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function doStuff($number) { return $this->doStuffInternal($number, []); } public function doStuffInternal($number, array $numbers) { if ($number > 0) { $numbers[] = $number; return $this->doStuffInternal($number - 1, $numbers); } return $numbers; } } $foo = new Foo(); var_dump($foo->doStuff(10)); // no problem here var_dump($foo->doStuffInternal(10, ['herp!'])); // ah shit
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aMKmc
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'doStuff'
          5        SEND_VAL_EX                                              10
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
   27     9        INIT_FCALL                                               'var_dump'
         10        INIT_METHOD_CALL                                         !0, 'doStuffInternal'
         11        SEND_VAL_EX                                              10
         12        SEND_VAL_EX                                              <array>
         13        DO_FCALL                                      0  $6      
         14        SEND_VAR                                                 $6
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class Foo:
Function dostuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aMKmc
function name:  doStuff
number of ops:  7
compiled vars:  !0 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        INIT_METHOD_CALL                                         'doStuffInternal'
          2        SEND_VAR_EX                                              !0
          3        SEND_VAL_EX                                              <array>
          4        DO_FCALL                                      0  $1      
          5      > RETURN                                                   $1
    9     6*     > RETURN                                                   null

End of function dostuff

Function dostuffinternal:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aMKmc
function name:  doStuffInternal
number of ops:  14
compiled vars:  !0 = $number, !1 = $numbers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        IS_SMALLER                                               0, !0
          3      > JMPZ                                                     ~2, ->12
   15     4    >   ASSIGN_DIM                                               !1
          5        OP_DATA                                                  !0
   16     6        INIT_METHOD_CALL                                         'doStuffInternal'
          7        SUB                                              ~4      !0, 1
          8        SEND_VAL_EX                                              ~4
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0  $5      
         11      > RETURN                                                   $5
   18    12    > > RETURN                                                   !1
   19    13*     > RETURN                                                   null

End of function dostuffinternal

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
306.92 ms | 1400 KiB | 15 Q