xref: /PHP-7.0/sapi/phpdbg/tests/watch_001.phpt (revision fe378c27)
1--TEST--
2Test simple recursive watchpoint
3--PHPDBG--
4b 3
5r
6w r $b
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: $a = 1;
17 00004: $b = [$a];
18 00005:
19prompt> [Set recursive watchpoint on $b]
20prompt> [Breaking on watchpoint $b]
21Old value:
22New value: Array ([0] => 1)
23>00006: unset($b);
24 00007: $b = 2;
25 00008:
26prompt> [Breaking on watchpoint $b]
27Old value inaccessible or destroyed
28New value:
29>00007: $b = 2;
30 00008:
31prompt> [Breaking on watchpoint $b]
32Old value:
33New value: 2
34>00008:
35prompt> [$b was removed, removing watchpoint recursively]
36[Script ended normally]
37prompt>
38--FILE--
39<?php
40
41$a = 1;
42$b = [$a];
43
44unset($b);
45$b = 2;
46