3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bcfact($n){ $factorial=$n; while (--$n>1) { echo $n. PHP_EOL; $factorial=bcmul($factorial,$n); } return $factorial; } echo PHP_EOL; echo PHP_EOL; echo PHP_EOL; print bcfact(50);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LsAWG
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     '%0A'
   13     1        ECHO                                                     '%0A'
   14     2        ECHO                                                     '%0A'
   16     3        INIT_FCALL                                               'bcfact'
          4        SEND_VAL                                                 50
          5        DO_FCALL                                      0  $0      
          6        ECHO                                                     $0
          7      > RETURN                                                   1

Function bcfact:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 3
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 3
Branch analysis from position: 13
Branch analysis from position: 3
filename:       /in/LsAWG
function name:  bcfact
number of ops:  15
compiled vars:  !0 = $n, !1 = $factorial
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, !0
    5     2      > JMP                                                      ->10
    6     3    >   CONCAT                                           ~3      !0, '%0A'
          4        ECHO                                                     ~3
    7     5        INIT_FCALL_BY_NAME                                       'bcmul'
          6        SEND_VAR_EX                                              !1
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0  $4      
          9        ASSIGN                                                   !1, $4
    5    10    >   PRE_DEC                                          ~6      !0
         11        IS_SMALLER                                               1, ~6
         12      > JMPNZ                                                    ~7, ->3
    9    13    > > RETURN                                                   !1
   10    14*     > RETURN                                                   null

End of function bcfact

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.95 ms | 1398 KiB | 17 Q