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); } } print (new Test)->run(10,20);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CZnT8
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $0      'Test'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'run'
          3        SEND_VAL_EX                                              10
          4        SEND_VAL_EX                                              20
          5        DO_FCALL                                      0  $2      
          6        ECHO                                                     $2
          7      > 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/CZnT8
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:
154.27 ms | 1394 KiB | 13 Q