3v4l.org

run code in 300+ PHP versions simultaneously
<?php function factorial($n) { if ($n) { return $n * fact($n-1); } else { return 1; } } var_dump(factorial(0));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ROXGo
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'factorial'
          2        SEND_VAL                                                 0
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function factorial:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 9
Branch analysis from position: 2
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ROXGo
function name:  factorial
number of ops:  11
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1      > JMPZ                                                     !0, ->9
    5     2    >   INIT_FCALL_BY_NAME                                       'fact'
          3        SUB                                              ~1      !0, 1
          4        SEND_VAL_EX                                              ~1
          5        DO_FCALL                                      0  $2      
          6        MUL                                              ~3      !0, $2
          7      > RETURN                                                   ~3
          8*       JMP                                                      ->10
    7     9    > > RETURN                                                   1
    9    10*     > RETURN                                                   null

End of function factorial

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.96 ms | 1397 KiB | 16 Q