View Issue Details

IDProjectCategoryView StatusLast Update
0001527XdebugUncategorizedpublic2018-02-18 15:35
Reporterokriz Assigned Toderick  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionno change required 
Product Version2.6.0 
Summary0001527: true shown as false in PhpStorm Debug->Variables view under UTF-8 Keys (array, stdClass)
Description

When inspecting a variable (array or stdClass) with UTF-8 key(s) in PhpStorm:

  • Debug->Variables: shows boolean true as boolean false on expand of those keys
  • Evaluate Expression: shows boolean true as boolean false on expand of those keys
  • Evaluate Expression: shows boolean true as boolean true on evaluate the whole statement
  • Debug Console: shows boolean true as boolean true for both cases

Discovered while inspecting json_decoded'ed structures containing German Umlauts

Steps To Reproduce

Test file will get attached
inspect as in description (btw: this Mantis DB does not support UTF-8 Characters U+2EEA, U+2002 as well) ;)

Additional Information

Tested and reproduced this behavior with:

PhpStorm 2017.3
Build #PS-173.3727.138, built on November 28, 2017
JRE: 1.8.0_152-release-1024-b6 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.13.3

in combination with:

PHP 7.2.0 (cli) (built: Dec 12 2017 17:02:58) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies
with Xdebug v2.6.0alpha1, Copyright (c) 2002-2017, by Derick Rethans

as well as:

PhpStorm 2017.3.4
Build #PS-173.4548.32, built on January 30, 2018
JRE: 1.8.0_152-release-1024-b11 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.13.3

in combination with

PHP 7.2.2 (cli) (built: Feb 14 2018 18:26:07) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

Executed with:
1) php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 -dxdebug.remote_log=/tmp/xdebug.log XDEBUG_TEST.php
2) php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 -dxdebug.remote_log=/tmp/xdebug.log -dxdebug.extended_properties=1 XDEBUG_TEST.php
3) php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 -dxdebug.remote_log=/tmp/xdebug.log -dxdebug.extended_properties=1 -dxdebug.encoding=UTF-8 XDEBUG_TEST.php

TagsNo tags attached.
Attached Files
XDEBUG_TEST.php (422 bytes)   
<?php
$json = <<<'JSON'
{
    "\u00fc": {"true": true, "false": false},
    "ü2": {"true": true, "false": false},
    "ue": {"true": true, "false": false},
    "⻪": {"true": true, "false": false}
}
JSON;

$jsonArray = json_decode($json, true);
$jsonStdClass = json_decode($json, false);

$t1 = $jsonArray["⻪"]["true"];
$t2 = $jsonArray["⻪"]["false"];
$t1_1 = true === $t1;
$t2_1 = false === $t2;

$breakHere = true;
XDEBUG_TEST.php (422 bytes)   
xdebug.log (38,841 bytes)
Operating SystemMac OS X High Sierra 10.13.3
PHP Version7.2.0-7.2.4

Activities

okriz

2018-02-15 15:18

reporter   ~0004593

I checked the xdebug.log remote log and it seems alright. Not sure what causes this strange behavior. Maybe it's on jetbrains - not sure how the different debug views are executed

derick

2018-02-18 15:35

administrator   ~0004594

Hi,

I can reproduce this with PhpStorm, but I also believe that's where the problem lies. The output in Xdebug for:

property_get -i 44 -n "$jsonArray[\"ü2\"]" -d 0 -c 0 -p 0

returns (correctly):

<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="44"><property type="array" children="1" numchildren="2" page="0" pagesize="100"><name encoding="base64"><![CDATA[JGpzb25BcnJheVsiw7wyIl0=]]></name><fullname encoding="base64"><![CDATA[JGpzb25BcnJheVsiw7wyIl0=]]></fullname><property name="true" type="bool"><fullname encoding="base64"><![CDATA[JGpzb25BcnJheVsiw7wyIl1bInRydWUiXQ==]]></fullname><value encoding="base64"><![CDATA[MQ==]]></value></property><property name="false" type="bool"><fullname encoding="base64"><![CDATA[JGpzb25BcnJheVsiw7wyIl1bImZhbHNlIl0=]]></fullname><value encoding="base64"><![CDATA[MA==]]></value></property></property></response>

The values (<![CDATA[MQ==]]>) and (<![CDATA[MA==]]>) are "1" and "0" respectively, but PhpStorm shows them both as false in the UI.

I filed the following ticket with them: https://youtrack.jetbrains.com/issue/WI-40762

And I'm closing this issue, as this is not a bug in Xdebug. Thanks for the detailed report!

cheers,
Derick

Issue History

Date Modified Username Field Change
2018-02-15 15:14 okriz New Issue
2018-02-15 15:14 okriz File Added: XDEBUG_TEST.php
2018-02-15 15:15 okriz File Added: xdebug.log
2018-02-15 15:15 okriz File Added: Bildschirmfoto 2018-02-15 um 15.59.11.png
2018-02-15 15:16 okriz File Added: Bildschirmfoto 2018-02-15 um 15.59.39.png
2018-02-15 15:16 okriz File Added: Bildschirmfoto 2018-02-15 um 15.59.51.png
2018-02-15 15:16 okriz File Added: Bildschirmfoto 2018-02-15 um 16.00.04.png
2018-02-15 15:17 okriz File Added: Bildschirmfoto 2018-02-15 um 16.00.22.png
2018-02-15 15:18 okriz Note Added: 0004593
2018-02-18 15:35 derick Note Added: 0004594
2018-02-18 15:35 derick Status new => resolved
2018-02-18 15:35 derick Resolution open => no change required
2018-02-18 15:35 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