3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fibonacciNumbers($n) { if ($n < 3) { return 1; } else { return fibonacciNumbers($n-1) + fibonacciNumbers($n-2); } } function getArr($n) { $return = array(); for ($i = 1; $i <= $n; $i++) { $return[] = fibonacciNumbers($i); } return $return; } var_dump(getArr(6));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LKGIH
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'getarr'
          2        SEND_VAL                                                 6
          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
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LKGIH
function name:  fibonacciNumbers
number of ops:  16
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        IS_SMALLER                                               !0, 3
          2      > JMPZ                                                     ~1, ->5
    5     3    > > RETURN                                                   1
          4*       JMP                                                      ->15
    7     5    >   INIT_FCALL_BY_NAME                                       'fibonacciNumbers'
          6        SUB                                              ~2      !0, 1
          7        SEND_VAL_EX                                              ~2
          8        DO_FCALL                                      0  $3      
          9        INIT_FCALL_BY_NAME                                       'fibonacciNumbers'
         10        SUB                                              ~4      !0, 2
         11        SEND_VAL_EX                                              ~4
         12        DO_FCALL                                      0  $5      
         13        ADD                                              ~6      $3, $5
         14      > RETURN                                                   ~6
    9    15*     > 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/LKGIH
function name:  getArr
number of ops:  14
compiled vars:  !0 = $n, !1 = $return, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        ASSIGN                                                   !1, <array>
   13     2        ASSIGN                                                   !2, 1
          3      > JMP                                                      ->10
   14     4    >   INIT_FCALL                                               'fibonaccinumbers'
          5        SEND_VAR                                                 !2
          6        DO_FCALL                                      0  $6      
          7        ASSIGN_DIM                                               !1
          8        OP_DATA                                                  $6
   13     9        PRE_INC                                                  !2
         10    >   IS_SMALLER_OR_EQUAL                                      !2, !0
         11      > JMPNZ                                                    ~8, ->4
   16    12    > > RETURN                                                   !1
   17    13*     > RETURN                                                   null

End of function getarr

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.37 ms | 1403 KiB | 17 Q