Closed AndreyChursin closed 1 week ago
Hi. Can you please reproduce the issue wile having log:true
in your launch.json
configuration and attach the log from Debug Console. This will show what data is transferred and we can check where the problem comes from.
I tried the code you offered here and here is the raw communication between Xdebug and VScode
Xdebug reports the $itsShouldBeFloatValue
variable as type float
and value 10
.
xd(1) -> <?xml version="1.0" encoding="iso-8859-1"?><response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="12" context="0">
<property name="$itsShouldBeFloatValue" fullname="$itsShouldBeFloatValue" type="float">
<![CDATA[10]]></property></response>
This is also how I pass it to VSCode.
<- variablesResponse
Response {
seq: 0,
type: 'response',
request_seq: 13,
command: 'variables',
success: true,
body:
{ variables:
[ { name: '$itsShouldBeFloatValue',
value: '10',
type: 'float',
variablesReference: 0,
presentationHint: {},
evaluateName: '$itsShouldBeFloatValue',
indexedVariables: undefined } ] } }
The float
gets shown on variable hover.
Now, I could reformat the value if it's float to 10.0
, but then again PHP internally does not do that it seems:
var_dump($itsShouldBeFloatValue);
echo $itsShouldBeFloatValue;
echo "\n";
Output:
double(10)
10
I'll close this as I believe it works as it should, but feel free to reopen it with some reference to why this should be different.
Best!
PHP version: 8.1.28 Xdebug version: v3.3.2 VS Code extension version: v1.34.0
Your launch.json:
Xdebug php.ini config:
Xdebug logfile (from setting
xdebug.log
in php.ini): VS Code extension logfile (from setting"log": true
in launch.json):Code snippet to reproduce:
But if: