3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ilk = 5; $iki = 3; $ust = fact($ilk); echo $ust; $alt = fact($iki) * fact($ilk - $iki); echo $ust / $alt; function fact(int $sayi){ for(; $sayi>0; $sayi--){ if(!isset($sonuc)){ $sonuc = $sayi; }else{ $sonuc *= $sayi; } } return $sonuc; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SKTEm
function name:  (null)
number of ops:  19
compiled vars:  !0 = $ilk, !1 = $iki, !2 = $ust, !3 = $alt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 5
    4     1        ASSIGN                                                   !1, 3
    6     2        INIT_FCALL_BY_NAME                                       'fact'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $6      
          5        ASSIGN                                                   !2, $6
    7     6        ECHO                                                     !2
    8     7        INIT_FCALL_BY_NAME                                       'fact'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0  $8      
         10        INIT_FCALL_BY_NAME                                       'fact'
         11        SUB                                              ~9      !0, !1
         12        SEND_VAL_EX                                              ~9
         13        DO_FCALL                                      0  $10     
         14        MUL                                              ~11     $8, $10
         15        ASSIGN                                                   !3, ~11
    9    16        DIV                                              ~13     !2, !3
         17        ECHO                                                     ~13
   20    18      > RETURN                                                   1

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

End of function fact

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.03 ms | 1395 KiB | 13 Q