3v4l.org

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

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

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.52 ms | 1399 KiB | 14 Q