3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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(5.5);
based on NqSqQ
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/3J2Ql
function name:  (null)
number of ops:  9
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  12     1        ECHO                                                     '%0A'
  13     2        ECHO                                                     '%0A'
  14     3        ECHO                                                     '%0A'
  16     4        INIT_FCALL                                               'bcfact'
         5        SEND_VAL                                                 5.5
         6        DO_FCALL                                      0  $0      
         7        ECHO                                                     $0
         8      > RETURN                                                   1

Function bcfact:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 10
Branch analysis from position: 10
Jump found. Position 1 = 13, Position 2 = 3
Branch analysis from position: 13
Jump found. Position 1 = -2
Branch analysis from position: 3
Jump found. Position 1 = 13, Position 2 = 3
Branch analysis from position: 13
Branch analysis from position: 3
filename:       /in/3J2Ql
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                                       ~7      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 7.3.0