3v4l.org

run code in 300+ PHP versions simultaneously
<?php function p($x) { echo "x"; if (x<= 2) { return 2; } else { return p(x-1)+p(x-2) -1; } } var_dump(p(p(5)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LClUW
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'p'
          2        INIT_FCALL                                               'p'
          3        SEND_VAL                                                 5
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_FCALL                                      0  $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

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

End of function p

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.72 ms | 1399 KiB | 17 Q