3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f($n) { if ($n <= 1) { return 1; } return $n * f($n - 1); } function factorial($number) { $result = 1; while ($number > 0) { $result *= $number; $number--; } return $result; } echo f(100000) . PHP_EOL; echo factorial(100000);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FVDot
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'f'
          1        SEND_VAL                                                 100000
          2        DO_FCALL                                      0  $0      
          3        CONCAT                                           ~1      $0, '%0A'
          4        ECHO                                                     ~1
   22     5        INIT_FCALL                                               'factorial'
          6        SEND_VAL                                                 100000
          7        DO_FCALL                                      0  $2      
          8        ECHO                                                     $2
          9      > RETURN                                                   1

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

End of function f

Function factorial:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 3
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 3
Branch analysis from position: 7
Branch analysis from position: 3
filename:       /in/FVDot
function name:  factorial
number of ops:  9
compiled vars:  !0 = $number, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        ASSIGN                                                   !1, 1
   12     2      > JMP                                                      ->5
   13     3    >   ASSIGN_OP                                     3          !1, !0
   14     4        PRE_DEC                                                  !0
   12     5    >   IS_SMALLER                                               0, !0
          6      > JMPNZ                                                    ~5, ->3
   16     7    > > RETURN                                                   !1
   17     8*     > RETURN                                                   null

End of function factorial

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.41 ms | 1016 KiB | 15 Q