-
-
Notifications
You must be signed in to change notification settings - Fork 564
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:xdebug/xdebug
- Loading branch information
Showing
11 changed files
with
251 additions
and
9 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
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,23 @@ | ||
--TEST-- | ||
Test for bug #987: Hidden property names not shown with var_dump (CLI) | ||
--INI-- | ||
html_errors=0 | ||
xdebug.cli_color=0 | ||
xdebug.default_enable=1 | ||
--FILE-- | ||
<?php | ||
$object = (object) array('key' => 'value', 1 => 0, -4 => "foo", 3.14 => false); | ||
|
||
var_dump($object); | ||
?> | ||
--EXPECTF-- | ||
class stdClass#1 (4) { | ||
public $key => | ||
string(5) "value" | ||
public ${1} => | ||
int(0) | ||
public ${-4} => | ||
string(3) "foo" | ||
public ${3} => | ||
bool(false) | ||
} |
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,20 @@ | ||
--TEST-- | ||
Test for bug #987: Hidden property names not shown with var_dump (HTML) | ||
--INI-- | ||
html_errors=1 | ||
xdebug.cli_color=0 | ||
xdebug.default_enable=1 | ||
--FILE-- | ||
<?php | ||
$object = (object) array('key' => 'value', 1 => 0, -4 => "foo", 3.14 => false); | ||
|
||
var_dump($object); | ||
?> | ||
--EXPECTF-- | ||
<pre class='xdebug-var-dump' dir='ltr'> | ||
<b>object</b>(<i>stdClass</i>)[<i>1</i>] | ||
<i>public</i> 'key' <font color='#888a85'>=></font> <small>string</small> <font color='#cc0000'>'value'</font> <i>(length=5)</i> | ||
<i>public</i> 1 <font color='#888a85'>=></font> <small>int</small> <font color='#4e9a06'>0</font> | ||
<i>public</i> -4 <font color='#888a85'>=></font> <small>string</small> <font color='#cc0000'>'foo'</font> <i>(length=3)</i> | ||
<i>public</i> 3 <font color='#888a85'>=></font> <small>boolean</small> <font color='#75507b'>false</font> | ||
</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,23 @@ | ||
--TEST-- | ||
Test for bug #987: Hidden property names not shown with var_dump (CLI colours) | ||
--INI-- | ||
html_errors=0 | ||
xdebug.cli_color=2 | ||
xdebug.default_enable=1 | ||
--FILE-- | ||
<?php | ||
$object = (object) array('key' => 'value', 1 => 0, -4 => "foo", 3.14 => false); | ||
|
||
var_dump($object); | ||
?> | ||
--EXPECTF-- | ||
[1mclass[22m [31mstdClass[0m#1 ([32m4[0m) { | ||
[32m[1mpublic[22m[0m $key [0m=>[0m | ||
[1mstring[22m([32m5[0m) "[31mvalue[0m" | ||
[32m[1mpublic[22m[0m ${1} [0m=>[0m | ||
[1mint[22m([32m0[0m) | ||
[32m[1mpublic[22m[0m ${-4} [0m=>[0m | ||
[1mstring[22m([32m3[0m) "[31mfoo[0m" | ||
[32m[1mpublic[22m[0m ${3} [0m=>[0m | ||
[1mbool[22m([35mfalse[0m) | ||
} |
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,25 @@ | ||
--TEST-- | ||
Test for bug #987: Hidden property names not shown with stack trace | ||
--INI-- | ||
html_errors=0 | ||
xdebug.cli_color=0 | ||
xdebug.default_enable=1 | ||
error_reporting=-1 | ||
xdebug.collect_params=4 | ||
xdebug.show_local_vars=0 | ||
--FILE-- | ||
<?php | ||
$object = (object) array('key' => 'value', 1 => 0, -4 => "foo", 3.14 => false); | ||
|
||
function foo($a, $b) | ||
{ | ||
} | ||
|
||
foo($object); | ||
?> | ||
--EXPECTF-- | ||
Warning: Missing argument 2 for foo(), called in %sbug00987-004.php on line 8 and defined in %sbug00987-004.php on line 4 | ||
|
||
Call Stack: | ||
%f %d 1. {main}() %sbug00987-004.php:0 | ||
%f %d 2. foo($a = class stdClass { public $key = 'value'; public $1 = 0; public $-4 = 'foo'; public $3 = FALSE }, $b = ???) %sbug00987-004.php:8 |
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,17 @@ | ||
<?php | ||
$a = new StdClass; | ||
$a->foo = 1; | ||
$a->bar = 2; | ||
$a->baz = array( false, 3.14, "foo" ); | ||
class b { static $foo = 73; }; $a->b = new b; | ||
$o = (object) array( | ||
'key' => 'value', | ||
1 => 0, | ||
-4 => "foo", | ||
3.14 => false, | ||
-2 => array( 5, 6, 7, 8 => array( "a", "b", "c" ) ), | ||
5 => $a, | ||
); | ||
|
||
echo gettype($o), "\n"; | ||
?> |
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,85 @@ | ||
--TEST-- | ||
Test for bug #987: Hidden property names not shown while debugging | ||
--FILE-- | ||
<?php | ||
require 'dbgp/dbgpclient.php'; | ||
$data = file_get_contents(dirname(__FILE__) . '/bug00987-005.inc'); | ||
|
||
$commands = array( | ||
'step_into', | ||
'breakpoint_set -t line -n 16', | ||
'run', | ||
'property_get -n $o', | ||
'property_get -n $o->-4', | ||
'property_get -n $o->3', | ||
'property_get -n $o->-2[2]', | ||
'property_get -n $o->-2[8]', | ||
'property_get -n $o->-2[8]["c"]', | ||
'property_get -n $o->5', | ||
'property_get -n $o->5->bar', | ||
'property_get -n $o->5->baz[2]', | ||
'property_get -n $o->5->b', | ||
'property_get -n $o->5->b::foo', | ||
); | ||
|
||
dbgpRun( $data, $commands ); | ||
?> | ||
--EXPECTF-- | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///tmp/xdebug-dbgp-test.php" language="PHP" protocol_version="1.0" appid="" idekey=""><engine version=""><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2013 by Derick Rethans]]></copyright></init> | ||
|
||
-> step_into -i 1 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="1" status="break" reason="ok"><xdebug:message filename="file:///tmp/xdebug-dbgp-test.php" lineno="2"></xdebug:message></response> | ||
|
||
-> breakpoint_set -i 2 -t line -n 16 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="2" id=""></response> | ||
|
||
-> run -i 3 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="3" status="break" reason="ok"><xdebug:message filename="file:///tmp/xdebug-dbgp-test.php" lineno="16"></xdebug:message></response> | ||
|
||
-> property_get -i 4 -n $o | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="4"><property name="$o" fullname="$o" address="" type="object" classname="stdClass" children="1" numchildren="6" page="0" pagesize="32"><property name="key" fullname="$o->key" facet="public" address="" type="string" size="5" encoding="base64"><![CDATA[dmFsdWU=]]></property><property name="1" fullname="$o->1" facet="public" address="" type="int"><![CDATA[0]]></property><property name="-4" fullname="$o->-4" facet="public" address="" type="string" size="3" encoding="base64"><![CDATA[Zm9v]]></property><property name="3" fullname="$o->3" facet="public" address="" type="bool"><![CDATA[0]]></property><property name="-2" fullname="$o->-2" facet="public" address="" type="array" children="1" numchildren="4"></property><property name="5" fullname="$o->5" facet="public" address="" type="object" classname="stdClass" children="1" numchildren="4"></property></property></response> | ||
|
||
-> property_get -i 5 -n $o->-4 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="5"><property name="$o->-4" fullname="$o->-4" address="" type="string" size="3" encoding="base64"><![CDATA[Zm9v]]></property></response> | ||
|
||
-> property_get -i 6 -n $o->3 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="6"><property name="$o->3" fullname="$o->3" address="" type="bool"><![CDATA[0]]></property></response> | ||
|
||
-> property_get -i 7 -n $o->-2[2] | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="7"><property name="$o->-2[2]" fullname="$o->-2[2]" address="" type="int"><![CDATA[7]]></property></response> | ||
|
||
-> property_get -i 8 -n $o->-2[8] | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="8"><property name="$o->-2[8]" fullname="$o->-2[8]" address="" type="array" children="1" numchildren="3" page="0" pagesize="32"><property name="0" fullname="$o->-2[8][0]" address="" type="string" size="1" encoding="base64"><![CDATA[YQ==]]></property><property name="1" fullname="$o->-2[8][1]" address="" type="string" size="1" encoding="base64"><![CDATA[Yg==]]></property><property name="2" fullname="$o->-2[8][2]" address="" type="string" size="1" encoding="base64"><![CDATA[Yw==]]></property></property></response> | ||
|
||
-> property_get -i 9 -n $o->-2[8]["c"] | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="9" status="break" reason="ok"><error code="300"><message><![CDATA[can not get property]]></message></error></response> | ||
|
||
-> property_get -i 10 -n $o->5 | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="10"><property name="$o->5" fullname="$o->5" address="" type="object" classname="stdClass" children="1" numchildren="4" page="0" pagesize="32"><property name="foo" fullname="$o->5->foo" facet="public" address="" type="int"><![CDATA[1]]></property><property name="bar" fullname="$o->5->bar" facet="public" address="" type="int"><![CDATA[2]]></property><property name="baz" fullname="$o->5->baz" facet="public" address="" type="array" children="1" numchildren="3"></property><property name="b" fullname="$o->5->b" facet="public" address="" type="object" classname="b" children="1" numchildren="1"></property></property></response> | ||
|
||
-> property_get -i 11 -n $o->5->bar | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="11"><property name="$o->5->bar" fullname="$o->5->bar" address="" type="int"><![CDATA[2]]></property></response> | ||
|
||
-> property_get -i 12 -n $o->5->baz[2] | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="12"><property name="$o->5->baz[2]" fullname="$o->5->baz[2]" address="" type="string" size="3" encoding="base64"><![CDATA[Zm9v]]></property></response> | ||
|
||
-> property_get -i 13 -n $o->5->b | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="13"><property name="$o->5->b" fullname="$o->5->b" address="" type="object" classname="b" children="1" numchildren="1" page="0" pagesize="32"><property name="foo" fullname="$o->5->b::foo" facet="static public" address="" type="int"><![CDATA[73]]></property></property></response> | ||
|
||
-> property_get -i 14 -n $o->5->b::foo | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="14"><property name="$o->5->b::foo" fullname="$o->5->b::foo" address="" type="int"><![CDATA[73]]></property></response> |
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,23 @@ | ||
--TEST-- | ||
Test for bug #987: Hidden property names not shown with var_dump | ||
--INI-- | ||
html_errors=0 | ||
xdebug.cli_color=0 | ||
xdebug.default_enable=1 | ||
error_reporting=-1 | ||
xdebug.collect_params=4 | ||
xdebug.show_local_vars=0 | ||
--FILE-- | ||
<?php | ||
$xml = '<?xml version="1.0" encoding="UTF-8" ?> | ||
<root> | ||
</root>'; | ||
$temp = simplexml_load_string($xml, "SimpleXMLElement", LIBXML_NOERROR); | ||
var_dump($temp); | ||
?> | ||
--EXPECTF-- | ||
class SimpleXMLElement#1 (1) { | ||
public ${0} => | ||
string(1) " | ||
" | ||
} |
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