Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: XDEBUG_2_2_0
Fetching contributors…

Cannot retrieve contributors at this time

file 91 lines (86 sloc) 1.221 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
--TEST--
Test with xdebug_get_declared_vars()
--INI--
xdebug.default_enable=1
xdebug.auto_trace=0
xdebug.collect_params=0
xdebug.auto_profile=0
xdebug.profiler_enable=0
xdebug.dump_globals=0
xdebug.collect_vars=1
xdebug.show_local_vars=0
xdebug.overload_var_dump=0
--FILE--
<?php
function a($a,$b) {
var_dump(xdebug_get_declared_vars());
}
a(52, 52);

function b($a,$b) {
echo $a;
echo $b, "\n";
var_dump(xdebug_get_declared_vars());
}
b(52, 52);

function c($a,$b) {
echo $a;
echo $b, "\n";
unset($b);
var_dump(xdebug_get_declared_vars());
}
c(3.14, 159);

function d($a,$b) {
$c = 3;
$d = 4;
echo $a, "\n";
var_dump(xdebug_get_declared_vars());
}
d(1, 2);

function s()
{
$c = 42;
$d = 54;
echo $c, $d, "\n";
var_dump(xdebug_get_declared_vars());
}

register_shutdown_function('s');
?>
--EXPECTF--
array(2) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
}
5252
array(2) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
}
3.14159
array(2) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
}
1
array(4) {
[0]=>
string(1) "d"
[1]=>
string(1) "a"
[2]=>
string(1) "c"
[3]=>
string(1) "b"
}
4254
array(2) {
[0]=>
string(1) "d"
[1]=>
string(1) "c"
}
Something went wrong with that request. Please try again.