Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 67 lines (61 sloc) 2.153 kb
657ff72 @derickr - Added the new setting "xdebug.collect_assignments" which enables the e...
authored
1 --TEST--
2 Test for tracing array assignments in user-readable function traces
3 --INI--
4 xdebug.default_enable=1
5 xdebug.profiler_enable=0
6 xdebug.auto_trace=0
7 xdebug.trace_format=0
8 xdebug.collect_vars=1
9 xdebug.collect_params=3
8247891 @derickr - Fixed testcases; it's xdebug.collect_return and not xdebug.collect_ret...
authored
10 xdebug.collect_return=0
657ff72 @derickr - Added the new setting "xdebug.collect_assignments" which enables the e...
authored
11 xdebug.collect_assignments=1
6e78cb0 @derickr - Use lower case setting names so that they work case sensitively
authored
12 xdebug.dump.GET=
38adef7 @derickr - Revert super global settings to upper case letters as per docs. This n...
authored
13 xdebug.dump.SERVER=
657ff72 @derickr - Added the new setting "xdebug.collect_assignments" which enables the e...
authored
14 --FILE--
15 <?php
16 $tf = xdebug_start_trace('/tmp/'. uniqid('xdt', TRUE));
17
18 function test()
19 {
20 $t = array( 'a' => 4, 'b' => 9, 'c' => 13 );
21 $t['d'] = 89;
22 $t['a'] += $b;
23 @$t['a'] += $b;
24 $t['c'] /= 7;
25 $t['b'] *= 9;
26 }
27 $t = array();
28 $t['a'] = 98;
29 $t['b'] = 4;
30 $t['b'] -= 8;
31 $t['b'] *= -0.5;
32 $t['b'] <<= 1;
33 $t['c'] = $t['b'] / 32;
34
35 test(1, 2, 3);
36
37 xdebug_stop_trace();
38 echo file_get_contents($tf);
39 unlink($tf);
40 ?>
41 --EXPECTF--
42 Notice: Undefined variable: b in %sassignment-trace2.php on line 8
43
44 Call Stack:
45 %w%f %w%d 1. {main}() %sassignment-trace2.php:0
46 %w%f %w%d 2. test(1, 2, 3) %sassignment-trace2.php:21
47
48 TRACE START [%d-%d-%d %d:%d:%d]
7d648b7 @derickr Fixed bug #821: Variable assignments (beginning with =>) should be inden...
authored
49 => $tf = '/tmp/%s.xt' %sassignment-trace2.php:2
50 => $t = array () %sassignment-trace2.php:13
51 => $t['a'] = 98 %sassignment-trace2.php:14
52 => $t['b'] = 4 %sassignment-trace2.php:15
53 => $t['b'] -= 8 %sassignment-trace2.php:16
54 => $t['b'] *= -0.5 %sassignment-trace2.php:17
55 => $t['b'] <<= 1 %sassignment-trace2.php:18
56 => $t['c'] = 0.125 %sassignment-trace2.php:19
657ff72 @derickr - Added the new setting "xdebug.collect_assignments" which enables the e...
authored
57 %w%f %w%d -> test(1, 2, 3) %sassignment-trace2.php:21
7d648b7 @derickr Fixed bug #821: Variable assignments (beginning with =>) should be inden...
authored
58 => $t = array ('a' => 4, 'b' => 9, 'c' => 13) %sassignment-trace2.php:6
59 => $t['d'] = 89 %sassignment-trace2.php:7
60 => $t['a'] += NULL %sassignment-trace2.php:8
61 => $t['a'] += NULL %sassignment-trace2.php:9
62 => $t['c'] /= 7 %sassignment-trace2.php:10
63 => $t['b'] *= 9 %sassignment-trace2.php:11
657ff72 @derickr - Added the new setting "xdebug.collect_assignments" which enables the e...
authored
64 %w%f %w%d -> xdebug_stop_trace() %sassignment-trace2.php:23
65 %w%f %w%d
66 TRACE END [%d-%d-%d %d:%d:%d]
Something went wrong with that request. Please try again.