3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function run($a, $b) { if($a < 1){ return $b; } return $this->run($a-1, $b*$a); } } $test = new Test(); echo $test->run(10,20);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bsjLn
function name:  (null)
number of ops:  9
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        INIT_METHOD_CALL                                         !0, 'run'
          4        SEND_VAL_EX                                              10
          5        SEND_VAL_EX                                              20
          6        DO_FCALL                                      0  $4      
          7        ECHO                                                     $4
          8      > RETURN                                                   1

Class Test:
Function run:
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
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bsjLn
function name:  run
number of ops:  13
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        IS_SMALLER                                               !0, 1
          3      > JMPZ                                                     ~2, ->5
    9     4    > > RETURN                                                   !1
   11     5    >   INIT_METHOD_CALL                                         'run'
          6        SUB                                              ~3      !0, 1
          7        SEND_VAL_EX                                              ~3
          8        MUL                                              ~4      !1, !0
          9        SEND_VAL_EX                                              ~4
         10        DO_FCALL                                      0  $5      
         11      > RETURN                                                   $5
   12    12*     > RETURN                                                   null

End of function run

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.84 ms | 1398 KiB | 13 Q