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