3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fib ($n) { return round(pow((sqrt(5)+1)/2, $n) / sqrt(5)); } $x = 0; while ($x < 100) { echo fib($x++)+'\n'; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 2
Branch analysis from position: 10
Branch analysis from position: 2
filename:       /in/BIjrj
function name:  (null)
number of ops:  11
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 0
    6     1      > JMP                                                      ->8
    7     2    >   INIT_FCALL                                               'fib'
          3        POST_INC                                         ~2      !0
          4        SEND_VAL                                                 ~2
          5        DO_FCALL                                      0  $3      
          6        ADD                                              ~4      $3, '%5Cn'
          7        ECHO                                                     ~4
    6     8    >   IS_SMALLER                                               !0, 100
          9      > JMPNZ                                                    ~5, ->2
    8    10    > > RETURN                                                   1

Function fib:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BIjrj
function name:  fib
number of ops:  19
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'round'
          2        INIT_FCALL                                               'pow'
          3        INIT_FCALL                                               'sqrt'
          4        SEND_VAL                                                 5
          5        DO_ICALL                                         $1      
          6        ADD                                              ~2      $1, 1
          7        DIV                                              ~3      ~2, 2
          8        SEND_VAL                                                 ~3
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $4      
         11        INIT_FCALL                                               'sqrt'
         12        SEND_VAL                                                 5
         13        DO_ICALL                                         $5      
         14        DIV                                              ~6      $4, $5
         15        SEND_VAL                                                 ~6
         16        DO_ICALL                                         $7      
         17      > RETURN                                                   $7
    4    18*     > RETURN                                                   null

End of function fib

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.23 ms | 1399 KiB | 20 Q