3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fibonacci($n,$first = 0,$second = 1) { $fib = array($first,$second); for($i=1;$i<$n;$i++) { $fib[] = $fib[$i]+$fib[$i-1]; } return $fib; } echo "<pre>"; print_r(fibonacci(100));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mUDXq
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                     '%3Cpre%3E'
   12     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'fibonacci'
          3        SEND_VAL                                                 100
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function fibonacci:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 8
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 8
Branch analysis from position: 17
Branch analysis from position: 8
filename:       /in/mUDXq
function name:  fibonacci
number of ops:  19
compiled vars:  !0 = $n, !1 = $first, !2 = $second, !3 = $fib, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      0
          2        RECV_INIT                                        !2      1
    4     3        INIT_ARRAY                                       ~5      !1
          4        ADD_ARRAY_ELEMENT                                ~5      !2
          5        ASSIGN                                                   !3, ~5
    5     6        ASSIGN                                                   !4, 1
          7      > JMP                                                      ->15
    7     8    >   FETCH_DIM_R                                      ~9      !3, !4
          9        SUB                                              ~10     !4, 1
         10        FETCH_DIM_R                                      ~11     !3, ~10
         11        ADD                                              ~12     ~9, ~11
         12        ASSIGN_DIM                                               !3
         13        OP_DATA                                                  ~12
    5    14        PRE_INC                                                  !4
         15    >   IS_SMALLER                                               !4, !0
         16      > JMPNZ                                                    ~14, ->8
    9    17    > > RETURN                                                   !3
   10    18*     > RETURN                                                   null

End of function fibonacci

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.07 ms | 1399 KiB | 16 Q