xref: /PHP-8.4/sapi/phpdbg/tests/watch_003.phpt (revision c756e978)
1--TEST--
2Test simple watchpoint with replace
3--SKIPIF--
4<?php
5if (getenv('SKIP_ASAN')) {
6    die("skip intentionally causes segfaults");
7}
8?>
9--PHPDBG--
10b 6
11r
12w $a[0]
13c
14
15
16q
17--EXPECTF--
18[Successful compilation of %s]
19prompt> [Breakpoint #0 added at %s:6]
20prompt> [Breakpoint #0 at %s:6, hits: 1]
21>00006: $a[0] = 2;
22 00007:
23 00008: $a = [0 => 3, 1 => 4];
24prompt> [Added watchpoint #0 for $a[0]]
25prompt> [Breaking on watchpoint $a[0]]
26Old value: 1
27New value: 2
28>00008: $a = [0 => 3, 1 => 4];
29 00009:
30prompt> [Breaking on watchpoint $a[0]]
31Old value: 2
32New value: 3
33>00009:
34prompt> [$a[0] has been removed, removing watchpoint]
35[Script ended normally]
36prompt>
37--FILE--
38<?php
39
40$a = [];
41
42$a[0] = 1;
43$a[0] = 2;
44
45$a = [0 => 3, 1 => 4];
46