Skip to content

Commit 9e6ce72

Browse files
committed
Fixed issue #2382: LazyProxyObject causes PHPStorm to drop out of debugging due to double XML attribute
1 parent cd5132d commit 9e6ce72

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib/var_export_xml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,10 +612,10 @@ void xdebug_var_export_xml_node(zval **struc, xdebug_str *name, xdebug_xml_node
612612

613613
#if PHP_VERSION_ID >= 80400
614614
if (ce->type != ZEND_INTERNAL_CLASS && zend_object_is_lazy(Z_OBJ_P(*struc))) {
615-
xdebug_xml_add_attribute(node, "type", "object");
616615
if (zend_object_is_lazy_proxy(Z_OBJ_P(*struc))) {
617616
xdebug_xml_expand_attribute_value(node, "facet", "lazy-proxy");
618617
} else if (!zend_lazy_object_initialized(Z_OBJ_P(*struc))) {
618+
xdebug_xml_add_attribute(node, "type", "object");
619619
xdebug_xml_expand_attribute_value(node, "facet", "lazy-ghost");
620620

621621
break; /* Jump out of the function */

tests/debugger/bug02371-003.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ dbgpRunFile( $filename, $commands );
4040

4141
-> property_get -i 4 -n $user
4242
<?xml version="1.0" encoding="iso-8859-1"?>
43-
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="4"><property name="$user" fullname="$user" type="object" facet="lazy-proxy" type="object" classname="User" children="1" numchildren="2" page="0" pagesize="32"><property name="id" fullname="$user-&gt;id" facet="public" type="int"><![CDATA[43]]></property><property name="name" fullname="$user-&gt;name" facet="public" type="string" size="5" encoding="base64"><![CDATA[Qmx1ZXk=]]></property></property></response>
43+
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="4"><property name="$user" fullname="$user" facet="lazy-proxy" type="object" classname="User" children="1" numchildren="2" page="0" pagesize="32"><property name="id" fullname="$user-&gt;id" facet="public" type="int"><![CDATA[43]]></property><property name="name" fullname="$user-&gt;name" facet="public" type="string" size="5" encoding="base64"><![CDATA[Qmx1ZXk=]]></property></property></response>
4444

4545
-> run -i 5
4646
<?xml version="1.0" encoding="iso-8859-1"?>
4747
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="5" status="break" reason="ok"><xdebug:message filename="file://bug02371-003.inc" lineno="20"></xdebug:message></response>
4848

4949
-> property_get -i 6 -n $user
5050
<?xml version="1.0" encoding="iso-8859-1"?>
51-
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="6"><property name="$user" fullname="$user" type="object" facet="lazy-proxy" type="object" classname="User" children="1" numchildren="2" page="0" pagesize="32"><property name="id" fullname="$user-&gt;id" facet="public" type="int"><![CDATA[43]]></property><property name="name" fullname="$user-&gt;name" facet="public" type="string" size="5" encoding="base64"><![CDATA[Qmx1ZXk=]]></property></property></response>
51+
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="6"><property name="$user" fullname="$user" facet="lazy-proxy" type="object" classname="User" children="1" numchildren="2" page="0" pagesize="32"><property name="id" fullname="$user-&gt;id" facet="public" type="int"><![CDATA[43]]></property><property name="name" fullname="$user-&gt;name" facet="public" type="string" size="5" encoding="base64"><![CDATA[Qmx1ZXk=]]></property></property></response>
5252

5353
-> detach -i 7
5454
<?xml version="1.0" encoding="iso-8859-1"?>

0 commit comments

Comments
 (0)