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--) { if ($strSilnia[i] == 0) $zeroCount += 1; else break; } echo $strSilnia[81]; echo $zeroCount;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 10
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 10
Branch analysis from position: 20
Branch analysis from position: 10
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
filename:       /in/2Lrfh
function name:  (null)
number of ops:  24
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                                                      ->18
   12    10    >   FETCH_CONSTANT                                   ~10     'i'
         11        FETCH_DIM_R                                      ~11     !0, ~10
         12        IS_EQUAL                                                 ~11, 0
         13      > JMPZ                                                     ~12, ->16
         14    >   ASSIGN_OP                                     1          !1, 1
         15      > JMP                                                      ->17
   13    16    > > JMP                                                      ->20
   10    17    >   PRE_DEC                                                  !2
         18    >   IS_SMALLER_OR_EQUAL                                      !2, 0
         19      > JMPNZ                                                    ~15, ->10
   15    20    >   FETCH_DIM_R                                      ~16     !0, 81
         21        ECHO                                                     ~16
   16    22        ECHO                                                     !1
         23      > 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/2Lrfh
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:
167.23 ms | 1398 KiB | 15 Q