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