xref: /php-src/sapi/phpdbg/tests/gh15210_002.phpt (revision 4d71580e)
1--TEST--
2GH-15210 use after free after continue
3--SKIPIF--
4<?php
5if (getenv('SKIP_ASAN')) {
6    die("skip intentionally causes segfaults");
7}
8?>
9--PHPDBG--
10b 4
11r
12w $a[0]
13c
14c
15q
16--FILE--
17<?php
18header_register_callback(function() { echo "sent";});
19$a = [0];
20$a[0] = 1;
21?>
22--EXPECTF--
23[Successful compilation of %s]
24prompt> [Breakpoint #0 added at %s:%d]
25prompt> [Breakpoint #0 at %s:%d, hits: 1]
26>00004: $a[0] = 1;
27 00005: ?>
28 00006:
29prompt> [Added watchpoint #0 for $a[0]]
30prompt> [Breaking on watchpoint $a[0]]
31Old value: [Breaking on watchpoint $a[0]]
32Old value: 0
33New value: 1
34>00002: header_register_callback(function() { echo "sent";});
35 00003: $a = [0];
36 00004: $a[0] = 1;
37prompt> sent0
38New value: 1
39
40[$a[0] has been removed, removing watchpoint]
41[Script ended normally]
42prompt>
43