xref: /PHP-8.0/sapi/phpdbg/tests/watch_005.phpt (revision 57463cf7)
1--TEST--
2Test proper watch comparisons when having multiple levels of indirection from a zval to its value
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 3
14r
15w r $a
16c
17
18
19
20q
21--EXPECTF--
22[Successful compilation of %s]
23prompt> [Breakpoint #0 added at %s:3]
24prompt> [Breakpoint #0 at %s:3, hits: 1]
25>00003: $b = "a";
26 00004: $a = $b.$b;
27 00005: $c = &$a;
28prompt> [Added recursive watchpoint #0 for $a]
29prompt> [Breaking on watchpoint $a]
30Old value:
31New value: aa
32>00005: $c = &$a;
33 00006: $a[1] = "b";
34 00007:
35prompt> [Breaking on watchpoint $a]
36Old value inaccessible or destroyed
37New value (reference): aa
38>00006: $a[1] = "b";
39 00007:
40 00008: exit;
41prompt> [Breaking on watchpoint $a]
42Old value: aa
43New value: ab
44>00008: exit;
45 00009:
46prompt> [$a has been removed, removing watchpoint recursively]
47[Script ended normally]
48prompt>
49--FILE--
50<?php
51
52$b = "a";
53$a = $b.$b;
54$c = &$a;
55$a[1] = "b";
56
57exit;
58