forked from xdebug/xdebug
-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented issue xdebug#304: File name and line number info for over…
…loaded var_dump().
- Loading branch information
Showing
9 changed files
with
268 additions
and
37 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,94 @@ | ||
--TEST-- | ||
Test for overloaded var_dump() on the CLI with file | ||
--INI-- | ||
xdebug.overload_var_dump=2 | ||
html_errors=0 | ||
xdebug.cli_color=0 | ||
xdebug.default_enable=1 | ||
xdebug.var_display_max_data=32 | ||
xdebug.var_display_max_depth=2 | ||
xdebug.var_display_max_children=8 | ||
--FILE-- | ||
<?php | ||
$array = array( | ||
"Hello, this is a very long string with some other useful info", | ||
array( | ||
"depth2" => array( | ||
"depth3" => array( | ||
"depth4" => false, | ||
) | ||
) | ||
), | ||
range(0, 16) | ||
); | ||
var_dump($array); | ||
|
||
ini_set('xdebug.cli_color', 2); | ||
var_dump($array); | ||
--EXPECTF-- | ||
%svardump-overload-cli-2.php:%d: | ||
array(3) { | ||
[0] => | ||
string(61) "Hello, this is a very long strin"... | ||
[1] => | ||
array(1) { | ||
'depth2' => | ||
array(1) { | ||
... | ||
} | ||
} | ||
[2] => | ||
array(17) { | ||
[0] => | ||
int(0) | ||
[1] => | ||
int(1) | ||
[2] => | ||
int(2) | ||
[3] => | ||
int(3) | ||
[4] => | ||
int(4) | ||
[5] => | ||
int(5) | ||
[6] => | ||
int(6) | ||
[7] => | ||
int(7) | ||
|
||
(more elements)... | ||
} | ||
} | ||
[1m%svardump-overload-cli-2.php[22m:[1m%d[22m: | ||
[1marray[22m([32m3[0m) { | ||
[0] [0m=>[0m | ||
[1mstring[22m([32m61[0m) "[31mHello, this is a very long strin[0m"... | ||
[1] [0m=>[0m | ||
[1marray[22m([32m1[0m) { | ||
'depth2' => | ||
[1marray[22m([32m1[0m) { | ||
... | ||
} | ||
} | ||
[2] [0m=>[0m | ||
[1marray[22m([32m17[0m) { | ||
[0] [0m=>[0m | ||
[1mint[22m([32m0[0m) | ||
[1] [0m=>[0m | ||
[1mint[22m([32m1[0m) | ||
[2] [0m=>[0m | ||
[1mint[22m([32m2[0m) | ||
[3] [0m=>[0m | ||
[1mint[22m([32m3[0m) | ||
[4] [0m=>[0m | ||
[1mint[22m([32m4[0m) | ||
[5] [0m=>[0m | ||
[1mint[22m([32m5[0m) | ||
[6] [0m=>[0m | ||
[1mint[22m([32m6[0m) | ||
[7] [0m=>[0m | ||
[1mint[22m([32m7[0m) | ||
|
||
(more elements)... | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--TEST-- | ||
Test for file display with xdebug_var_dump() | ||
--INI-- | ||
xdebug.default_enable=1 | ||
xdebug.auto_trace=0 | ||
xdebug.profiler_enable=0 | ||
html_errors=1 | ||
date.timezone=Europe/Oslo | ||
xdebug.var_display_max_children=11 | ||
xdebug.overload_var_dump=2 | ||
xdebug.file_link_format= | ||
--FILE-- | ||
<?php | ||
class TimeStuff { | ||
private $timestamp; | ||
private $user_defined; | ||
private $self; | ||
protected $tm; | ||
public $date; | ||
|
||
function TimeStuff($ts = null) | ||
{ | ||
$this->self = &$this; | ||
$this->timestamp = $ts === null ? time() : $ts; | ||
$this->user_defined = ($ts !== null); | ||
$this->date = date("Y-m-d H:i:s T", $this->timestamp); | ||
$this->tm = getdate($this->timestamp); | ||
} | ||
} | ||
|
||
$ts1 = new TimeStuff(1092515106); | ||
|
||
var_dump($ts1); | ||
?> | ||
--EXPECTF-- | ||
<pre class='xdebug-var-dump' dir='ltr'> | ||
<small>%sxdebug_var_dump_file.php:%d:</small> | ||
<b>object</b>(<i>TimeStuff</i>)[<i>1</i>] | ||
<i>private</i> 'timestamp' <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>1092515106</font> | ||
<i>private</i> 'user_defined' <font color='#888a85'>=></font> <small>boolean</small> <font color='#75507b'>true</font> | ||
<i>private</i> 'self' <font color='#888a85'>=></font> | ||
<i>&</i><b>object</b>(<i>TimeStuff</i>)[<i>1</i>] | ||
<i>protected</i> 'tm' <font color='#888a85'>=></font> | ||
<b>array</b> <i>(size=11)</i> | ||
'seconds' <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>6</font> | ||
'minutes' <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>25</font> | ||
'hours' <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>22</font> | ||
'mday' <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>14</font> | ||
'wday' <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>6</font> | ||
'mon' <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>8</font> | ||
'year' <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>2004</font> | ||
'yday' <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>226</font> | ||
'weekday' <font color='#888a85'>=></font> <small>string</small> <font color='#cc0000'>'Saturday'</font> <i>(length=8)</i> | ||
'month' <font color='#888a85'>=></font> <small>string</small> <font color='#cc0000'>'August'</font> <i>(length=6)</i> | ||
0 <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>1092515106</font> | ||
<i>public</i> 'date' <font color='#888a85'>=></font> <small>string</small> <font color='#cc0000'>'2004-08-14 22:25:06 CEST'</font> <i>(length=24)</i> | ||
</pre> |
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,57 @@ | ||
--TEST-- | ||
Test for file and link display with xdebug_var_dump() | ||
--INI-- | ||
xdebug.default_enable=1 | ||
xdebug.auto_trace=0 | ||
xdebug.profiler_enable=0 | ||
html_errors=1 | ||
date.timezone=Europe/Oslo | ||
xdebug.var_display_max_children=11 | ||
xdebug.overload_var_dump=2 | ||
xdebug.file_link_format=xdebug://%f@%l | ||
--FILE-- | ||
<?php | ||
class TimeStuff { | ||
private $timestamp; | ||
private $user_defined; | ||
private $self; | ||
protected $tm; | ||
public $date; | ||
|
||
function TimeStuff($ts = null) | ||
{ | ||
$this->self = &$this; | ||
$this->timestamp = $ts === null ? time() : $ts; | ||
$this->user_defined = ($ts !== null); | ||
$this->date = date("Y-m-d H:i:s T", $this->timestamp); | ||
$this->tm = getdate($this->timestamp); | ||
} | ||
} | ||
|
||
$ts1 = new TimeStuff(1092515106); | ||
|
||
var_dump($ts1); | ||
?> | ||
--EXPECTF-- | ||
<pre class='xdebug-var-dump' dir='ltr'> | ||
<small><a href='xdebug://%sxdebug_var_dump_file_link.php@%d'>%sxdebug_var_dump_file_link.php:%d</a>:</small> | ||
<b>object</b>(<i>TimeStuff</i>)[<i>1</i>] | ||
<i>private</i> 'timestamp' <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>1092515106</font> | ||
<i>private</i> 'user_defined' <font color='#888a85'>=></font> <small>boolean</small> <font color='#75507b'>true</font> | ||
<i>private</i> 'self' <font color='#888a85'>=></font> | ||
<i>&</i><b>object</b>(<i>TimeStuff</i>)[<i>1</i>] | ||
<i>protected</i> 'tm' <font color='#888a85'>=></font> | ||
<b>array</b> <i>(size=11)</i> | ||
'seconds' <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>6</font> | ||
'minutes' <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>25</font> | ||
'hours' <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>22</font> | ||
'mday' <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>14</font> | ||
'wday' <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>6</font> | ||
'mon' <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>8</font> | ||
'year' <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>2004</font> | ||
'yday' <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>226</font> | ||
'weekday' <font color='#888a85'>=></font> <small>string</small> <font color='#cc0000'>'Saturday'</font> <i>(length=8)</i> | ||
'month' <font color='#888a85'>=></font> <small>string</small> <font color='#cc0000'>'August'</font> <i>(length=6)</i> | ||
0 <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>1092515106</font> | ||
<i>public</i> 'date' <font color='#888a85'>=></font> <small>string</small> <font color='#cc0000'>'2004-08-14 22:25:06 CEST'</font> <i>(length=24)</i> | ||
</pre> |
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