3v4l.org

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

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

End of function fib

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.09 ms | 1399 KiB | 14 Q