xref: /PHP-8.4/sapi/phpdbg/tests/gh12675.phpt (revision df2af7ff)
1--TEST--
2GH-12675 (MEMORY_LEAK in phpdbg_prompt.c)
3--INI--
4opcache.enable=0
5--PHPDBG--
6ev file_put_contents("gh12675_1.tmp", "<?php echo 'hi';\necho 2;")
7ev file_put_contents("gh12675_2.tmp", "<?php echo 'hi';")
8exec nonexistent.php
9exec gh12675_1.tmp
10exec gh12675_1.tmp
11b gh12675_1.tmp:2
12r
13exec gh12675_2.tmp
14n
15q
16--EXPECTF--
17prompt> 24
18prompt> 16
19prompt> [Cannot stat nonexistent.php, ensure the file exists]
20prompt> [Set execution context: %sgh12675_1.tmp]
21[Successful compilation of %sgh12675_1.tmp]
22prompt> [Execution context not changed]
23prompt> [Breakpoint #0 added at %sgh12675_1.tmp:2]
24prompt> hi
25[Breakpoint #0 at %sgh12675_1.tmp:2, hits: 1]
26>00002: echo 2;
27prompt> Do you really want to stop execution to set a new execution context? (type y or n): prompt>
28--CLEAN--
29<?php
30@unlink("gh12675_1.tmp");
31@unlink("gh12675_2.tmp");
32?>
33