3v4l.org

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

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

End of function fantastic3

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.61 ms | 1390 KiB | 14 Q