3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fib($number) { if ($number == 0 || $number == 0) { return $number; } return fib($number - 1) + fib($number - 2); } echo fib(8);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FJ29V
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'fib'
          1        SEND_VAL                                                 8
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function fib:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/FJ29V
function name:  fib
number of ops:  18
compiled vars:  !0 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        IS_EQUAL                                         ~1      !0, 0
          2      > JMPNZ_EX                                         ~1      ~1, ->5
          3    >   IS_EQUAL                                         ~2      !0, 0
          4        BOOL                                             ~1      ~2
          5    > > JMPZ                                                     ~1, ->7
    5     6    > > RETURN                                                   !0
    8     7    >   INIT_FCALL_BY_NAME                                       'fib'
          8        SUB                                              ~3      !0, 1
          9        SEND_VAL_EX                                              ~3
         10        DO_FCALL                                      0  $4      
         11        INIT_FCALL_BY_NAME                                       'fib'
         12        SUB                                              ~5      !0, 2
         13        SEND_VAL_EX                                              ~5
         14        DO_FCALL                                      0  $6      
         15        ADD                                              ~7      $4, $6
         16      > RETURN                                                   ~7
    9    17*     > RETURN                                                   null

End of function fib

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.62 ms | 1398 KiB | 14 Q