3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a=8; function getfibseries ($n) { if ($n == 0) { return 0; } else if ($n == 1) { return 1; } else { return getfibseries( $n - 1 ) + getfibseries ( $n - 2 ); } } echo "the 9th term is " .getfibseries($a) ; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sXB6i
function name:  (null)
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 8
   16     1        INIT_FCALL                                               'getfibseries'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        CONCAT                                           ~3      'the+9th+term+is+', $2
          5        ECHO                                                     ~3
   17     6      > RETURN                                                   1

Function getfibseries:
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
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sXB6i
function name:  getfibseries
number of ops:  20
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        IS_EQUAL                                                 !0, 0
          2      > JMPZ                                                     ~1, ->5
    6     3    > > RETURN                                                   0
          4*       JMP                                                      ->19
    8     5    >   IS_EQUAL                                                 !0, 1
          6      > JMPZ                                                     ~2, ->9
   10     7    > > RETURN                                                   1
          8*       JMP                                                      ->19
   12     9    >   INIT_FCALL_BY_NAME                                       'getfibseries'
         10        SUB                                              ~3      !0, 1
         11        SEND_VAL_EX                                              ~3
         12        DO_FCALL                                      0  $4      
         13        INIT_FCALL_BY_NAME                                       'getfibseries'
         14        SUB                                              ~5      !0, 2
         15        SEND_VAL_EX                                              ~5
         16        DO_FCALL                                      0  $6      
         17        ADD                                              ~7      $4, $6
         18      > RETURN                                                   ~7
   14    19*     > RETURN                                                   null

End of function getfibseries

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.03 ms | 1398 KiB | 14 Q