3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fibonachi($n) { $array = array(0); if ($n === 1) $array[1] = 1; else if ($n > 1) { $array[1] = 1; $array[2] = 1; for ($i = 2; $i < $n; $i++) { $array[$i] = bcadd($array[$i-1], $array[$i-2]); } } return $array; } $array = fibonachi(3); for ($i = 0; $i < count($array); $i++) { echo " ".$array[$i]; }
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 = 13, Position 2 = 6
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 6
Branch analysis from position: 13
Branch analysis from position: 6
filename:       /in/XhGSt
function name:  (null)
number of ops:  14
compiled vars:  !0 = $array, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'fibonachi'
          1        SEND_VAL                                                 3
          2        DO_FCALL                                      0  $2      
          3        ASSIGN                                                   !0, $2
   21     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->10
   22     6    >   FETCH_DIM_R                                      ~5      !0, !1
          7        CONCAT                                           ~6      '+', ~5
          8        ECHO                                                     ~6
   21     9        PRE_INC                                                  !1
         10    >   COUNT                                            ~8      !0
         11        IS_SMALLER                                               !1, ~8
         12      > JMPNZ                                                    ~9, ->6
   23    13    > > RETURN                                                   1

Function fibonachi:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 30
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 15
Branch analysis from position: 30
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 15
Branch analysis from position: 30
Branch analysis from position: 15
Branch analysis from position: 30
filename:       /in/XhGSt
function name:  fibonachi
number of ops:  32
compiled vars:  !0 = $n, !1 = $array, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, <array>
    6     2        IS_IDENTICAL                                             !0, 1
          3      > JMPZ                                                     ~4, ->7
          4    >   ASSIGN_DIM                                               !1, 1
          5        OP_DATA                                                  1
          6      > JMP                                                      ->30
    7     7    >   IS_SMALLER                                               1, !0
          8      > JMPZ                                                     ~6, ->30
    8     9    >   ASSIGN_DIM                                               !1, 1
         10        OP_DATA                                                  1
    9    11        ASSIGN_DIM                                               !1, 2
         12        OP_DATA                                                  1
   11    13        ASSIGN                                                   !2, 2
         14      > JMP                                                      ->28
   12    15    >   INIT_FCALL_BY_NAME                                       'bcadd'
         16        CHECK_FUNC_ARG                                           
         17        SUB                                              ~11     !2, 1
         18        FETCH_DIM_FUNC_ARG                               $12     !1, ~11
         19        SEND_FUNC_ARG                                            $12
         20        CHECK_FUNC_ARG                                           
         21        SUB                                              ~13     !2, 2
         22        FETCH_DIM_FUNC_ARG                               $14     !1, ~13
         23        SEND_FUNC_ARG                                            $14
         24        DO_FCALL                                      0  $15     
         25        ASSIGN_DIM                                               !1, !2
         26        OP_DATA                                                  $15
   11    27        PRE_INC                                                  !2
         28    >   IS_SMALLER                                               !2, !0
         29      > JMPNZ                                                    ~17, ->15
   16    30    > > RETURN                                                   !1
   17    31*     > RETURN                                                   null

End of function fibonachi

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.28 ms | 1403 KiB | 14 Q