View Issue Details

IDProjectCategoryView StatusLast Update
0001581XdebugUncategorizedpublic2018-10-17 15:18
Reporterpablosoria8286 Assigned Toderick  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionno change required 
PlatformLinuxOSUbuntuOS Version18.04
Product Version2.6.1 
Summary0001581: Local variables/function variables not shown when OPcache is enabled
Description

If you try to debug the code below with OPCache enabled and put a breakpoint in the local variables you will see that they are not displayed. If you deactivate OPCache everything works as expected. Important to notice that OPcache is correctly activated first than Xdebug and that if you want to test it through cli you have to activate OPcache (by default is off on cli).

Steps To Reproduce

Sample Code:

function hello($name){
$localVariable = 2;
return "Hello" . $name . $localVariable;
}

echo hello("World");

In fact the variable $localVariable doesn't even appear in the log file.
The same occurs whit this code with classes and the $localFoo:

class Foo {
public $member = 'Some value';

public function methodFoo() {
    $localFoo = "local";
    return $localFoo;
}

}

$newFoo = new Foo();
echo $newFoo->methodFoo();

Additional Information

PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.10-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans

TagsNo tags attached.
Attached Files
xdebug_remote.log (21,085 bytes)   
Log opened at 2018-10-17 01:32:17
I: Connecting to configured address/port: 127.0.0.1:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///home/pablo/public_html/test/index.php" language="PHP" xdebug:language_version="7.2.10-0ubuntu0.18.04.1" protocol_version="1.0" appid="29401" idekey="PHPSTORM"><engine version="2.6.1"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2018 by Derick Rethans]]></copyright></init>

<- feature_set -i 1 -n show_hidden -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="show_hidden" success="1"></response>

<- feature_set -i 2 -n max_depth -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_depth" success="1"></response>

<- feature_set -i 3 -n max_children -v 100
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_children" success="1"></response>

<- feature_set -i 4 -n extended_properties -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="4" feature="extended_properties" success="1"></response>

<- feature_set -i 5 -n notify_ok -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="5" feature="notify_ok" success="1"></response>

<- stdout -i 6 -c 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stdout" transaction_id="6" success="1"></response>

<- status -i 7
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="status" transaction_id="7" status="starting" reason="ok"></response>

<- step_into -i 8
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="8" status="break" reason="ok"><xdebug:message filename="file:///home/pablo/public_html/test/index.php" lineno="4"></xdebug:message></response>

<- eval -i 9 -- aXNzZXQoJF9TRVJWRVJbJ1BIUF9JREVfQ09ORklHJ10p
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="9"><property type="bool"><![CDATA[0]]></property></response>

<- eval -i 10 -- aXNzZXQoJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10p
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="10"><property type="bool"><![CDATA[1]]></property></response>

<- eval -i 11 -- KHN0cmluZykoJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10p
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="11"><property type="string" size="10" encoding="base64"><![CDATA[dGVzdC5sb2NhbA==]]></property></response>

<- eval -i 12 -- KHN0cmluZykoJF9TRVJWRVJbJ1NFUlZFUl9QT1JUJ10p
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="12"><property type="string" size="2" encoding="base64"><![CDATA[ODA=]]></property></response>

<- eval -i 13 -- KHN0cmluZykoJF9TRVJWRVJbJ1JFUVVFU1RfVVJJJ10p
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="13"><property type="string" size="1" encoding="base64"><![CDATA[Lw==]]></property></response>

<- breakpoint_set -i 14 -t line -f file:///home/pablo/public_html/test/index.php -n 30
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="14" id="294010022"></response>

<- breakpoint_set -i 15 -t line -f file:///home/pablo/public_html/test/index.php -n 43
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="15" id="294010023"></response>

<- breakpoint_set -i 16 -t line -f file:///home/pablo/public_html/test/index.php -n 5
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="16" id="294010024"></response>

<- stack_get -i 17
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="17"><stack where="{main}" level="0" type="file" filename="file:///home/pablo/public_html/test/index.php" lineno="4"></stack></response>

<- run -i 18
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="18" status="break" reason="ok"><xdebug:message filename="file:///home/pablo/public_html/test/index.php" lineno="5"></xdebug:message></response>

<- stack_get -i 19
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="19"><stack where="hello" level="0" type="file" filename="file:///home/pablo/public_html/test/index.php" lineno="5"></stack><stack where="{main}" level="1" type="file" filename="file:///home/pablo/public_html/test/index.php" lineno="9"></stack></response>

<- context_names -i 20
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="20"><context name="Locals" id="0"></context><context name="Superglobals" id="1"></context><context name="User defined constants" id="2"></context></response>

<- context_get -i 21 -d 0 -c 0
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="21" context="0"><property name="$name" fullname="$name" type="string" size="5" encoding="base64"><![CDATA[V29ybGQ=]]></property></response>

<- context_get -i 22 -d 0 -c 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="22" context="1"><property name="$_COOKIE" fullname="$_COOKIE" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_ENV" fullname="$_ENV" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_FILES" fullname="$_FILES" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_GET" fullname="$_GET" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_POST" fullname="$_POST" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_REQUEST" fullname="$_REQUEST" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_SERVER" fullname="$_SERVER" type="array" children="1" numchildren="33" page="0" pagesize="100"><property name="USER" fullname="$_SERVER[&quot;USER&quot;]" type="string" size="8" encoding="base64"><![CDATA[d3d3LWRhdGE=]]></property><property name="HOME" fullname="$_SERVER[&quot;HOME&quot;]" type="string" size="8" encoding="base64"><![CDATA[L3Zhci93d3c=]]></property><property name="HTTP_ACCEPT_LANGUAGE" fullname="$_SERVER[&quot;HTTP_ACCEPT_LANGUAGE&quot;]" type="string" size="53" encoding="base64"><![CDATA[ZXMsY2E7cT0wLjksZW4tR0I7cT0wLjgsZW47cT0wLjcsZnItRlI7cT0wLjYsZnI7cT0wLjU=]]></property><property name="HTTP_ACCEPT_ENCODING" fullname="$_SERVER[&quot;HTTP_ACCEPT_ENCODING&quot;]" type="string" size="13" encoding="base64"><![CDATA[Z3ppcCwgZGVmbGF0ZQ==]]></property><property name="HTTP_ACCEPT" fullname="$_SERVER[&quot;HTTP_ACCEPT&quot;]" type="string" size="85" encoding="base64"><![CDATA[dGV4dC9odG1sLGFwcGxpY2F0aW9uL3hodG1sK3htbCxhcHBsaWNhdGlvbi94bWw7cT0wLjksaW1hZ2Uvd2VicCxpbWFnZS9hcG5nLCovKjtxPTAuOA==]]></property><property name="HTTP_USER_AGENT" fullname="$_SERVER[&quot;HTTP_USER_AGENT&quot;]" type="string" size="105" encoding="base64"><![CDATA[TW96aWxsYS81LjAgKFgxMTsgTGludXggeDg2XzY0KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvNjkuMC4zNDk3LjEwMCBTYWZhcmkvNTM3LjM2]]></property><property name="HTTP_UPGRADE_INSECURE_REQUESTS" fullname="$_SERVER[&quot;HTTP_UPGRADE_INSECURE_REQUESTS&quot;]" type="string" size="1" encoding="base64"><![CDATA[MQ==]]></property><property name="HTTP_CACHE_CONTROL" fullname="$_SERVER[&quot;HTTP_CACHE_CONTROL&quot;]" type="string" size="9" encoding="base64"><![CDATA[bWF4LWFnZT0w]]></property><property name="HTTP_CONNECTION" fullname="$_SERVER[&quot;HTTP_CONNECTION&quot;]" type="string" size="10" encoding="base64"><![CDATA[a2VlcC1hbGl2ZQ==]]></property><property name="HTTP_HOST" fullname="$_SERVER[&quot;HTTP_HOST&quot;]" type="string" size="10" encoding="base64"><![CDATA[dGVzdC5sb2NhbA==]]></property><property name="SCRIPT_FILENAME" fullname="$_SERVER[&quot;SCRIPT_FILENAME&quot;]" type="string" size="38" encoding="base64"><![CDATA[L2hvbWUvcGFibG8vcHVibGljX2h0bWwvdGVzdC9pbmRleC5waHA=]]></property><property name="REDIRECT_STATUS" fullname="$_SERVER[&quot;REDIRECT_STATUS&quot;]" type="string" size="3" encoding="base64"><![CDATA[MjAw]]></property><property name="SERVER_NAME" fullname="$_SERVER[&quot;SERVER_NAME&quot;]" type="string" size="10" encoding="base64"><![CDATA[dGVzdC5sb2NhbA==]]></property><property name="SERVER_PORT" fullname="$_SERVER[&quot;SERVER_PORT&quot;]" type="string" size="2" encoding="base64"><![CDATA[ODA=]]></property><property name="SERVER_ADDR" fullname="$_SERVER[&quot;SERVER_ADDR&quot;]" type="string" size="9" encoding="base64"><![CDATA[MTI3LjAuMC4x]]></property><property name="REMOTE_PORT" fullname="$_SERVER[&quot;REMOTE_PORT&quot;]" type="string" size="5" encoding="base64"><![CDATA[NDk1MzY=]]></property><property name="REMOTE_ADDR" fullname="$_SERVER[&quot;REMOTE_ADDR&quot;]" type="string" size="9" encoding="base64"><![CDATA[MTI3LjAuMC4x]]></property><property name="SERVER_SOFTWARE" fullname="$_SERVER[&quot;SERVER_SOFTWARE&quot;]" type="string" size="12" encoding="base64"><![CDATA[bmdpbngvMS4xNC4w]]></property><property name="GATEWAY_INTERFACE" fullname="$_SERVER[&quot;GATEWAY_INTERFACE&quot;]" type="string" size="7" encoding="base64"><![CDATA[Q0dJLzEuMQ==]]></property><property name="REQUEST_SCHEME" fullname="$_SERVER[&quot;REQUEST_SCHEME&quot;]" type="string" size="4" encoding="base64"><![CDATA[aHR0cA==]]></property><property name="SERVER_PROTOCOL" fullname="$_SERVER[&quot;SERVER_PROTOCOL&quot;]" type="string" size="8" encoding="base64"><![CDATA[SFRUUC8xLjE=]]></property><property name="DOCUMENT_ROOT" fullname="$_SERVER[&quot;DOCUMENT_ROOT&quot;]" type="string" size="28" encoding="base64"><![CDATA[L2hvbWUvcGFibG8vcHVibGljX2h0bWwvdGVzdA==]]></property><property name="DOCUMENT_URI" fullname="$_SERVER[&quot;DOCUMENT_URI&quot;]" type="string" size="10" encoding="base64"><![CDATA[L2luZGV4LnBocA==]]></property><property name="REQUEST_URI" fullname="$_SERVER[&quot;REQUEST_URI&quot;]" type="string" size="1" encoding="base64"><![CDATA[Lw==]]></property><property name="SCRIPT_NAME" fullname="$_SERVER[&quot;SCRIPT_NAME&quot;]" type="string" size="10" encoding="base64"><![CDATA[L2luZGV4LnBocA==]]></property><property name="CONTENT_LENGTH" fullname="$_SERVER[&quot;CONTENT_LENGTH&quot;]" type="string" size="0" encoding="base64"><![CDATA[]]></property><property name="CONTENT_TYPE" fullname="$_SERVER[&quot;CONTENT_TYPE&quot;]" type="string" size="0" encoding="base64"><![CDATA[]]></property><property name="REQUEST_METHOD" fullname="$_SERVER[&quot;REQUEST_METHOD&quot;]" type="string" size="3" encoding="base64"><![CDATA[R0VU]]></property><property name="QUERY_STRING" fullname="$_SERVER[&quot;QUERY_STRING&quot;]" type="string" size="0" encoding="base64"><![CDATA[]]></property><property name="FCGI_ROLE" fullname="$_SERVER[&quot;FCGI_ROLE&quot;]" type="string" size="9" encoding="base64"><![CDATA[UkVTUE9OREVS]]></property><property name="PHP_SELF" fullname="$_SERVER[&quot;PHP_SELF&quot;]" type="string" size="10" encoding="base64"><![CDATA[L2luZGV4LnBocA==]]></property><property name="REQUEST_TIME_FLOAT" fullname="$_SERVER[&quot;REQUEST_TIME_FLOAT&quot;]" type="float"><![CDATA[1539739937.3225]]></property><property name="REQUEST_TIME" fullname="$_SERVER[&quot;REQUEST_TIME&quot;]" type="int"><![CDATA[1539739937]]></property></property></response>

<- context_get -i 23 -d 0 -c 2
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="23" context="2"></response>

<- step_over -i 24
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="24" status="break" reason="ok"><xdebug:message filename="file:///home/pablo/public_html/test/index.php" lineno="6"></xdebug:message></response>

<- stack_get -i 25
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="25"><stack where="hello" level="0" type="file" filename="file:///home/pablo/public_html/test/index.php" lineno="6"></stack><stack where="{main}" level="1" type="file" filename="file:///home/pablo/public_html/test/index.php" lineno="9"></stack></response>

<- context_get -i 26 -d 0 -c 0
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="26" context="0"><property name="$name" fullname="$name" type="string" size="5" encoding="base64"><![CDATA[V29ybGQ=]]></property></response>

<- context_get -i 27 -d 0 -c 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="27" context="1"><property name="$_COOKIE" fullname="$_COOKIE" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_ENV" fullname="$_ENV" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_FILES" fullname="$_FILES" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_GET" fullname="$_GET" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_POST" fullname="$_POST" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_REQUEST" fullname="$_REQUEST" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_SERVER" fullname="$_SERVER" type="array" children="1" numchildren="33" page="0" pagesize="100"><property name="USER" fullname="$_SERVER[&quot;USER&quot;]" type="string" size="8" encoding="base64"><![CDATA[d3d3LWRhdGE=]]></property><property name="HOME" fullname="$_SERVER[&quot;HOME&quot;]" type="string" size="8" encoding="base64"><![CDATA[L3Zhci93d3c=]]></property><property name="HTTP_ACCEPT_LANGUAGE" fullname="$_SERVER[&quot;HTTP_ACCEPT_LANGUAGE&quot;]" type="string" size="53" encoding="base64"><![CDATA[ZXMsY2E7cT0wLjksZW4tR0I7cT0wLjgsZW47cT0wLjcsZnItRlI7cT0wLjYsZnI7cT0wLjU=]]></property><property name="HTTP_ACCEPT_ENCODING" fullname="$_SERVER[&quot;HTTP_ACCEPT_ENCODING&quot;]" type="string" size="13" encoding="base64"><![CDATA[Z3ppcCwgZGVmbGF0ZQ==]]></property><property name="HTTP_ACCEPT" fullname="$_SERVER[&quot;HTTP_ACCEPT&quot;]" type="string" size="85" encoding="base64"><![CDATA[dGV4dC9odG1sLGFwcGxpY2F0aW9uL3hodG1sK3htbCxhcHBsaWNhdGlvbi94bWw7cT0wLjksaW1hZ2Uvd2VicCxpbWFnZS9hcG5nLCovKjtxPTAuOA==]]></property><property name="HTTP_USER_AGENT" fullname="$_SERVER[&quot;HTTP_USER_AGENT&quot;]" type="string" size="105" encoding="base64"><![CDATA[TW96aWxsYS81LjAgKFgxMTsgTGludXggeDg2XzY0KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvNjkuMC4zNDk3LjEwMCBTYWZhcmkvNTM3LjM2]]></property><property name="HTTP_UPGRADE_INSECURE_REQUESTS" fullname="$_SERVER[&quot;HTTP_UPGRADE_INSECURE_REQUESTS&quot;]" type="string" size="1" encoding="base64"><![CDATA[MQ==]]></property><property name="HTTP_CACHE_CONTROL" fullname="$_SERVER[&quot;HTTP_CACHE_CONTROL&quot;]" type="string" size="9" encoding="base64"><![CDATA[bWF4LWFnZT0w]]></property><property name="HTTP_CONNECTION" fullname="$_SERVER[&quot;HTTP_CONNECTION&quot;]" type="string" size="10" encoding="base64"><![CDATA[a2VlcC1hbGl2ZQ==]]></property><property name="HTTP_HOST" fullname="$_SERVER[&quot;HTTP_HOST&quot;]" type="string" size="10" encoding="base64"><![CDATA[dGVzdC5sb2NhbA==]]></property><property name="SCRIPT_FILENAME" fullname="$_SERVER[&quot;SCRIPT_FILENAME&quot;]" type="string" size="38" encoding="base64"><![CDATA[L2hvbWUvcGFibG8vcHVibGljX2h0bWwvdGVzdC9pbmRleC5waHA=]]></property><property name="REDIRECT_STATUS" fullname="$_SERVER[&quot;REDIRECT_STATUS&quot;]" type="string" size="3" encoding="base64"><![CDATA[MjAw]]></property><property name="SERVER_NAME" fullname="$_SERVER[&quot;SERVER_NAME&quot;]" type="string" size="10" encoding="base64"><![CDATA[dGVzdC5sb2NhbA==]]></property><property name="SERVER_PORT" fullname="$_SERVER[&quot;SERVER_PORT&quot;]" type="string" size="2" encoding="base64"><![CDATA[ODA=]]></property><property name="SERVER_ADDR" fullname="$_SERVER[&quot;SERVER_ADDR&quot;]" type="string" size="9" encoding="base64"><![CDATA[MTI3LjAuMC4x]]></property><property name="REMOTE_PORT" fullname="$_SERVER[&quot;REMOTE_PORT&quot;]" type="string" size="5" encoding="base64"><![CDATA[NDk1MzY=]]></property><property name="REMOTE_ADDR" fullname="$_SERVER[&quot;REMOTE_ADDR&quot;]" type="string" size="9" encoding="base64"><![CDATA[MTI3LjAuMC4x]]></property><property name="SERVER_SOFTWARE" fullname="$_SERVER[&quot;SERVER_SOFTWARE&quot;]" type="string" size="12" encoding="base64"><![CDATA[bmdpbngvMS4xNC4w]]></property><property name="GATEWAY_INTERFACE" fullname="$_SERVER[&quot;GATEWAY_INTERFACE&quot;]" type="string" size="7" encoding="base64"><![CDATA[Q0dJLzEuMQ==]]></property><property name="REQUEST_SCHEME" fullname="$_SERVER[&quot;REQUEST_SCHEME&quot;]" type="string" size="4" encoding="base64"><![CDATA[aHR0cA==]]></property><property name="SERVER_PROTOCOL" fullname="$_SERVER[&quot;SERVER_PROTOCOL&quot;]" type="string" size="8" encoding="base64"><![CDATA[SFRUUC8xLjE=]]></property><property name="DOCUMENT_ROOT" fullname="$_SERVER[&quot;DOCUMENT_ROOT&quot;]" type="string" size="28" encoding="base64"><![CDATA[L2hvbWUvcGFibG8vcHVibGljX2h0bWwvdGVzdA==]]></property><property name="DOCUMENT_URI" fullname="$_SERVER[&quot;DOCUMENT_URI&quot;]" type="string" size="10" encoding="base64"><![CDATA[L2luZGV4LnBocA==]]></property><property name="REQUEST_URI" fullname="$_SERVER[&quot;REQUEST_URI&quot;]" type="string" size="1" encoding="base64"><![CDATA[Lw==]]></property><property name="SCRIPT_NAME" fullname="$_SERVER[&quot;SCRIPT_NAME&quot;]" type="string" size="10" encoding="base64"><![CDATA[L2luZGV4LnBocA==]]></property><property name="CONTENT_LENGTH" fullname="$_SERVER[&quot;CONTENT_LENGTH&quot;]" type="string" size="0" encoding="base64"><![CDATA[]]></property><property name="CONTENT_TYPE" fullname="$_SERVER[&quot;CONTENT_TYPE&quot;]" type="string" size="0" encoding="base64"><![CDATA[]]></property><property name="REQUEST_METHOD" fullname="$_SERVER[&quot;REQUEST_METHOD&quot;]" type="string" size="3" encoding="base64"><![CDATA[R0VU]]></property><property name="QUERY_STRING" fullname="$_SERVER[&quot;QUERY_STRING&quot;]" type="string" size="0" encoding="base64"><![CDATA[]]></property><property name="FCGI_ROLE" fullname="$_SERVER[&quot;FCGI_ROLE&quot;]" type="string" size="9" encoding="base64"><![CDATA[UkVTUE9OREVS]]></property><property name="PHP_SELF" fullname="$_SERVER[&quot;PHP_SELF&quot;]" type="string" size="10" encoding="base64"><![CDATA[L2luZGV4LnBocA==]]></property><property name="REQUEST_TIME_FLOAT" fullname="$_SERVER[&quot;REQUEST_TIME_FLOAT&quot;]" type="float"><![CDATA[1539739937.3225]]></property><property name="REQUEST_TIME" fullname="$_SERVER[&quot;REQUEST_TIME&quot;]" type="int"><![CDATA[1539739937]]></property></property></response>

<- context_get -i 28 -d 0 -c 2
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="28" context="2"></response>

<- run -i 29
-> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[Q29udGVudC10eXBlOiB0ZXh0L2h0bWw7IGNoYXJzZXQ9VVRGLTg=]]></stream>

-> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo=]]></stream>

-> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo=]]></stream>

-> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[SGVsbG9Xb3JsZDI=]]></stream>

-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="29" status="stopping" reason="ok"></response>

<- run -i 30
Log closed at 2018-10-17 01:32:24

xdebug_remote.log (21,085 bytes)   
Operating SystemUbuntu 18.04
PHP Version7.2.10-7.2.14

Activities

derick

2018-10-17 15:18

administrator   ~0004703

Hi,

This is a feature of OPCache. It optimised PHP code by sometimes removing variables if they are not needed. If you look at the opcodes that are generated, you see the following for your first example:

<pre>
function name: hello
number of ops: 7
compiled vars: !0 = $name
line #* E I O op fetch ext return operands

2 0 E > EXT_NOP
1 RECV !0
3 2 EXT_STMT
4 3 EXT_STMT
4 CONCAT 0000002:0000002 'Hello', !0
5 FAST_CONCAT 0000002:0000001 0000002:0000002, '2'
6 > RETURN 0000002:0000001

branch: # 0; line: 2- 4; sop: 0; eop: 6; out0: -2
path #1: 0,
End of function hello
</pre>

There is no sign of $localVariable, and the "2" is just used inline in opcode 5 (the FAST_CONCAT).

There is nothing I can do about this, and I would recommend you disable OPCache when debugging.

cheers,
Derick

Issue History

Date Modified Username Field Change
2018-10-17 01:33 pablosoria8286 New Issue
2018-10-17 01:33 pablosoria8286 File Added: xdebug_remote.log
2018-10-17 15:18 derick Note Added: 0004703
2018-10-17 15:18 derick Status new => resolved
2018-10-17 15:18 derick Resolution open => no change required
2018-10-17 15:18 derick Assigned To => derick
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized