3v4l.org

run code in 300+ PHP versions simultaneously
<?php function silnia($n) { return ($n <= 1) ? 1 : gmp_mul($n, silnia($n-1)); } $strSilnia = (string)silnia(60); $zeroCount = 0; for ($i = strlen($strSilnia)-1; $i >= 0; $i--) { echo $strSilnia[$i].PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 10
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 10
Branch analysis from position: 16
Branch analysis from position: 10
filename:       /in/tXGtR
function name:  (null)
number of ops:  17
compiled vars:  !0 = $strSilnia, !1 = $zeroCount, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'silnia'
          1        SEND_VAL                                                 60
          2        DO_FCALL                                      0  $3      
          3        CAST                                          6  ~4      $3
          4        ASSIGN                                                   !0, ~4
    9     5        ASSIGN                                                   !1, 0
   10     6        STRLEN                                           ~7      !0
          7        SUB                                              ~8      ~7, 1
          8        ASSIGN                                                   !2, ~8
          9      > JMP                                                      ->14
   12    10    >   FETCH_DIM_R                                      ~10     !0, !2
         11        CONCAT                                           ~11     ~10, '%0A'
         12        ECHO                                                     ~11
   10    13        PRE_DEC                                                  !2
         14    >   IS_SMALLER_OR_EQUAL                                      0, !2
         15      > JMPNZ                                                    ~13, ->10
   13    16    > > RETURN                                                   1

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

End of function silnia

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.38 ms | 1399 KiB | 14 Q