3v4l.org

run code in 300+ PHP versions simultaneously
<?php function oddprod( $l, $h ){ $p = 1; !( $l % 2 ) or $l++; !( $h % 2 ) or $h++; while( $l <= $h ) { $p *= $l; $l += 2; } return $p;}function factorial( $n ){ $f = 1; for( $i = 1; $i < $n; $i++ ) $f *= oddprod( 3, 2 ** ($i + 1) - 1 ); return 2 ** (2 ** $n - 1) * $f;}print factorial( 15 );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o3cmH
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   INIT_FCALL                                               'factorial'
          1        SEND_VAL                                                 15
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function oddprod:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 47) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 14
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 14
Branch analysis from position: 18
Branch analysis from position: 14
Branch analysis from position: 13
Branch analysis from position: 8
filename:       /in/o3cmH
function name:  oddprod
number of ops:  20
compiled vars:  !0 = $l, !1 = $h, !2 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        ASSIGN                                                   !2, 1
          3        MOD                                              ~4      !0, 2
          4        BOOL_NOT                                         ~5      ~4
          5      > JMPNZ_EX                                         ~5      ~5, ->8
          6    >   POST_INC                                         ~6      !0
          7        BOOL                                             ~5      ~6
          8    >   MOD                                              ~7      !1, 2
          9        BOOL_NOT                                         ~8      ~7
         10      > JMPNZ_EX                                         ~8      ~8, ->13
         11    >   POST_INC                                         ~9      !1
         12        BOOL                                             ~8      ~9
         13    > > JMP                                                      ->16
         14    >   ASSIGN_OP                                     3          !2, !0
         15        ASSIGN_OP                                     1          !0, 2
         16    >   IS_SMALLER_OR_EQUAL                                      !0, !1
         17      > JMPNZ                                                    ~12, ->14
         18    > > RETURN                                                   !2
         19*     > RETURN                                                   null

End of function oddprod

Function factorial:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 4
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 4
Branch analysis from position: 15
Branch analysis from position: 4
filename:       /in/o3cmH
function name:  factorial
number of ops:  21
compiled vars:  !0 = $n, !1 = $f, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        ASSIGN                                                   !1, 1
          2        ASSIGN                                                   !2, 1
          3      > JMP                                                      ->13
          4    >   INIT_FCALL                                               'oddprod'
          5        SEND_VAL                                                 3
          6        ADD                                              ~5      !2, 1
          7        POW                                              ~6      2, ~5
          8        SUB                                              ~7      ~6, 1
          9        SEND_VAL                                                 ~7
         10        DO_FCALL                                      0  $8      
         11        ASSIGN_OP                                     3          !1, $8
         12        PRE_INC                                                  !2
         13    >   IS_SMALLER                                               !2, !0
         14      > JMPNZ                                                    ~11, ->4
         15    >   POW                                              ~12     2, !0
         16        SUB                                              ~13     ~12, 1
         17        POW                                              ~14     2, ~13
         18        MUL                                              ~15     !1, ~14
         19      > RETURN                                                   ~15
         20*     > RETURN                                                   null

End of function factorial

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.58 ms | 1403 KiB | 15 Q