xref: /PHP-7.3/sapi/phpdbg/tests/watch_001.phpt (revision 6baaccc9)
1--TEST--
2Test simple recursive watchpoint
3--INI--
4opcache.optimization_level=0
5--PHPDBG--
6b 3
7r
8w r $b
9c
10
11
12
13q
14--EXPECTF--
15[Successful compilation of %s]
16prompt> [Breakpoint #0 added at %s:3]
17prompt> [Breakpoint #0 at %s:3, hits: 1]
18>00003: $a = 1;
19 00004: $b = [$a];
20 00005:
21prompt> [Added recursive watchpoint #0 for $b]
22prompt> [Breaking on watchpoint $b]
23Old value:
24New value: Array ([0] => 1)
25>00006: unset($b);
26 00007: $b = 2;
27 00008:
28prompt> [Breaking on watchpoint $b]
29Old value inaccessible or destroyed
30New value:
31>00007: $b = 2;
32 00008:
33prompt> [Breaking on watchpoint $b]
34Old value:
35New value: 2
36>00008:
37prompt> [$b has been removed, removing watchpoint recursively]
38[Script ended normally]
39prompt>
40--FILE--
41<?php
42
43$a = 1;
44$b = [$a];
45
46unset($b);
47$b = 2;
48