3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fibonacciNumbers($n) { $sq5 = sqrt(5); $a = (1 + $sq5) / 2; $b = (1 - $sq5) / 2; return (pow($a, $n) - pow($b, $n)) / $sq5; } function getArr ($n) { $return = array(); for ($i = 1; $i <= $n; $i++) { $return[] = fibonacciNumbers($i); } return $return; } var_dump(getArr(10));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2qpmD
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'getarr'
          2        SEND_VAL                                                 10
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

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

End of function fibonaccinumbers

Function getarr:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 4
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 4
Branch analysis from position: 12
Branch analysis from position: 4
filename:       /in/2qpmD
function name:  getArr
number of ops:  14
compiled vars:  !0 = $n, !1 = $return, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        ASSIGN                                                   !1, <array>
   12     2        ASSIGN                                                   !2, 1
          3      > JMP                                                      ->10
   13     4    >   INIT_FCALL                                               'fibonaccinumbers'
          5        SEND_VAR                                                 !2
          6        DO_FCALL                                      0  $6      
          7        ASSIGN_DIM                                               !1
          8        OP_DATA                                                  $6
   12     9        PRE_INC                                                  !2
         10    >   IS_SMALLER_OR_EQUAL                                      !2, !0
         11      > JMPNZ                                                    ~8, ->4
   15    12    > > RETURN                                                   !1
   16    13*     > RETURN                                                   null

End of function getarr

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.37 ms | 1403 KiB | 21 Q