3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fib($n) { return ((4 << $n*(3+$n)) / ((4 << 2*$n) - (2 << $n) - 1) & ((2 << $n) - 1)); } for ($i = 10; $i < 20; $i++) { echo "Fib {$i}: " . fib($i) . "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 2
Branch analysis from position: 14
Branch analysis from position: 2
filename:       /in/qm30S
function name:  (null)
number of ops:  15
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 10
          1      > JMP                                                      ->12
    8     2    >   ROPE_INIT                                     3  ~3      'Fib+'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_END                                      2  ~2      ~3, '%3A+'
          5        INIT_FCALL                                               'fib'
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0  $5      
          8        CONCAT                                           ~6      ~2, $5
          9        CONCAT                                           ~7      ~6, '%0A'
         10        ECHO                                                     ~7
    7    11        PRE_INC                                                  !0
         12    >   IS_SMALLER                                               !0, 20
         13      > JMPNZ                                                    ~9, ->2
    9    14    > > RETURN                                                   1

Function fib:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qm30S
function name:  fib
number of ops:  15
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ADD                                              ~1      3, !0
          2        MUL                                              ~2      !0, ~1
          3        SL                                               ~3      4, ~2
          4        MUL                                              ~4      !0, 2
          5        SL                                               ~5      4, ~4
          6        SL                                               ~6      2, !0
          7        SUB                                              ~7      ~5, ~6
          8        SUB                                              ~8      ~7, 1
          9        DIV                                              ~9      ~3, ~8
         10        SL                                               ~10     2, !0
         11        SUB                                              ~11     ~10, 1
         12        BW_AND                                           ~12     ~9, ~11
         13      > RETURN                                                   ~12
    5    14*     > RETURN                                                   null

End of function fib

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.5 ms | 1399 KiB | 14 Q