3v4l.org

run code in 500+ PHP versions simultaneously
<?php function fibonacci($n = 200) { $arr = array(); $a = 0; $b = 1; while($n-- > 0) { array_push($arr, $a); $a = $b - $a; $b = $a + $b; } return $arr; } foreach(fibonacci() as $n => $i) { echo "$n: $i\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/3lbAc
function name:  (null)
number of ops:  13
compiled vars:  !0 = $i, !1 = $n
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                                   'fibonacci'
          1        DO_FCALL                                          0  $2      
          2      > FE_RESET_R                                           $3      $2, ->11
          3    > > FE_FETCH_R                                           ~4      $3, !0, ->11
          4    >   ASSIGN                                                       !1, ~4
   17     5        ROPE_INIT                                         4  ~7      !1
          6        ROPE_ADD                                          1  ~7      ~7, '%3A+'
          7        ROPE_ADD                                          2  ~7      ~7, !0
          8        ROPE_END                                          3  ~6      ~7, '%0A'
          9        ECHO                                                         ~6
   16    10      > JMP                                                          ->3
         11    >   FE_FREE                                                      $3
   18    12      > RETURN                                                       1

Function fibonacci:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 5
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 5
Branch analysis from position: 16
Branch analysis from position: 5
filename:       /in/3lbAc
function name:  fibonacci
number of ops:  18
compiled vars:  !0 = $n, !1 = $arr, !2 = $a, !3 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                            !0      200
    5     1        ASSIGN                                                       !1, <array>
    6     2        ASSIGN                                                       !2, 0
    7     3        ASSIGN                                                       !3, 1
    8     4      > JMP                                                          ->13
    9     5    >   INIT_FCALL                                                   'array_push'
          6        SEND_REF                                                     !1
          7        SEND_VAR                                                     !2
          8        DO_ICALL                                                     
   10     9        SUB                                                  ~8      !3, !2
         10        ASSIGN                                                       !2, ~8
   11    11        ADD                                                  ~10     !2, !3
         12        ASSIGN                                                       !3, ~10
    8    13    >   POST_DEC                                             ~12     !0
         14        IS_SMALLER                                                   0, ~12
         15      > JMPNZ                                                        ~13, ->5
   13    16    > > RETURN                                                       !1
   14    17*     > RETURN                                                       null

End of function fibonacci

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
178.59 ms | 3199 KiB | 15 Q