Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue #702: Support by-ref assignments in variable tracing
- Loading branch information
Showing
7 changed files
with
164 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--TEST-- | ||
Test for bug #702: Check whether variables tracing also works with =& | ||
--INI-- | ||
xdebug.default_enable=1 | ||
xdebug.profiler_enable=0 | ||
xdebug.auto_trace=0 | ||
xdebug.trace_format=0 | ||
xdebug.dump_globals=0 | ||
xdebug.show_mem_delta=0 | ||
xdebug.collect_vars=0 | ||
xdebug.collect_params=0 | ||
xdebug.collect_return=0 | ||
xdebug.collect_assignments=1 | ||
xdebug.force_error_reporting=0 | ||
--FILE-- | ||
<?php | ||
$tf = xdebug_start_trace(sys_get_temp_dir() . '/'. uniqid('xdt', TRUE)); | ||
|
||
$a = 42; | ||
$b =& $a; | ||
$b = 43; | ||
|
||
$array = [ 1, 2 ]; | ||
$array[] = 3; | ||
$array[] =& $array[2]; | ||
|
||
$array = [ 1, 2, [ 3, 4, 6 ] ]; | ||
$array[] = $array[2][1]; | ||
$array[] =& $array[2][1]; | ||
|
||
xdebug_stop_trace(); | ||
echo file_get_contents($tf); | ||
unlink($tf); | ||
?> | ||
--EXPECTF-- | ||
TRACE START [%d-%d-%d %d:%d:%d] | ||
=> $tf = '%s.xt' %sbug00702-1.php:2 | ||
=> $a = 42 %sbug00702-1.php:4 | ||
=> $b =& $a %sbug00702-1.php:5 | ||
=> $b = 43 %sbug00702-1.php:6 | ||
=> $array = array (0 => 1, 1 => 2) %sbug00702-1.php:8 | ||
=> $array[] = 3 %sbug00702-1.php:9 | ||
=> $array[] =& $array[2] %sbug00702-1.php:10 | ||
=> $array = array (0 => 1, 1 => 2, 2 => array (0 => 3, 1 => 4, 2 => 6)) %sbug00702-1.php:12 | ||
=> $array[] = 4 %sbug00702-1.php:13 | ||
=> $array[] =& $array[2][1] %sbug00702-1.php:14 | ||
%w%f %w%d -> xdebug_stop_trace() %sbug00702-1.php:16 | ||
%w%f %w%d | ||
TRACE END [%d-%d-%d %d:%d:%d] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--TEST-- | ||
Test for bug #702: Check whether variables tracing also works with =& (with object) | ||
--INI-- | ||
xdebug.default_enable=1 | ||
xdebug.profiler_enable=0 | ||
xdebug.auto_trace=0 | ||
xdebug.trace_format=0 | ||
xdebug.dump_globals=0 | ||
xdebug.show_mem_delta=0 | ||
xdebug.collect_vars=0 | ||
xdebug.collect_params=0 | ||
xdebug.collect_return=0 | ||
xdebug.collect_assignments=1 | ||
xdebug.force_error_reporting=0 | ||
--FILE-- | ||
<?php | ||
$tf = xdebug_start_trace(sys_get_temp_dir() . '/'. uniqid('xdt', TRUE)); | ||
|
||
$a = new stdClass; | ||
$b =& $a; | ||
$b = 43; | ||
|
||
$object = new stdClass; | ||
$object->foo = 'bar'; | ||
$object->array = [ 1, 2, 3, 5, 8, 13 ]; | ||
$object->bar =& $object->foo; | ||
$object->array[] =& $object->foo; | ||
$object->array[] =& $object->array[4]; | ||
|
||
xdebug_stop_trace(); | ||
echo file_get_contents($tf); | ||
unlink($tf); | ||
?> | ||
--EXPECTF-- | ||
TRACE START [%d-%d-%d %d:%d:%d] | ||
=> $tf = '%s.xt' %sbug00702-2.php:2 | ||
=> $a = class stdClass { } %sbug00702-2.php:4 | ||
=> $b =& $a %sbug00702-2.php:5 | ||
=> $b = 43 %sbug00702-2.php:6 | ||
=> $object = class stdClass { } %sbug00702-2.php:8 | ||
=> $object->foo = 'bar' %sbug00702-2.php:9 | ||
=> $object->array = array (0 => 1, 1 => 2, 2 => 3, 3 => 5, 4 => 8, 5 => 13) %sbug00702-2.php:10 | ||
=> $object->bar =& $object->foo %sbug00702-2.php:11 | ||
=> $object->array[] =& $object->foo %sbug00702-2.php:12 | ||
=> $object->array[] =& $object->array[4] %sbug00702-2.php:13 | ||
%w%f %w%d -> xdebug_stop_trace() %sbug00702-2.php:15 | ||
%w%f %w%d | ||
TRACE END [%d-%d-%d %d:%d:%d] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters