3v4l.org

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

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

End of function ackermann

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.27 ms | 2292 KiB | 14 Q