3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fib ($n) { if ($n == 0) { return 0; } if ($n == 1) { return 1; } return fib( $n - 1 ) + fib( $n - 2 ); } print fib(40);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TKskX
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'fib'
          1        SEND_VAL                                                 40
          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 = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
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
filename:       /in/TKskX
function name:  fib
number of ops:  18
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, ->4
    6     3    > > RETURN                                                   0
    9     4    >   IS_EQUAL                                                 !0, 1
          5      > JMPZ                                                     ~2, ->7
   11     6    > > RETURN                                                   1
   14     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
   15    17*     > RETURN                                                   null

End of function fib

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
196.54 ms | 1398 KiB | 14 Q