3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f($n) { $v = array(0,1); for($i=0;$i<$n;$i++) { if ( $i >= 2 ) $v[$i] = $v[$i-1] + $v[$i-2]; echo $v[$i] . ' '; } } f(10);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AYWAU
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'f'
          1        SEND_VAL                                                 10
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 4
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 4
Branch analysis from position: 19
Branch analysis from position: 4
Branch analysis from position: 13
filename:       /in/AYWAU
function name:  f
number of ops:  20
compiled vars:  !0 = $n, !1 = $v, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->17
    5     4    >   IS_SMALLER_OR_EQUAL                                      2, !2
          5      > JMPZ                                                     ~5, ->13
    6     6    >   SUB                                              ~7      !2, 1
          7        FETCH_DIM_R                                      ~8      !1, ~7
          8        SUB                                              ~9      !2, 2
          9        FETCH_DIM_R                                      ~10     !1, ~9
         10        ADD                                              ~11     ~8, ~10
         11        ASSIGN_DIM                                               !1, !2
         12        OP_DATA                                                  ~11
    7    13    >   FETCH_DIM_R                                      ~12     !1, !2
         14        CONCAT                                           ~13     ~12, '+'
         15        ECHO                                                     ~13
    4    16        PRE_INC                                                  !2
         17    >   IS_SMALLER                                               !2, !0
         18      > JMPNZ                                                    ~15, ->4
    9    19    > > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.5 ms | 1399 KiB | 14 Q