View Issue Details

IDProjectCategoryView StatusLast Update
0002257XdebugUncategorizedpublic2024-06-07 10:03
Reporternym Assigned Toderick  
Status assignedResolutionopen 
Product Version3.2.0 
Summary0002257: xdebug is base64 encoding long strings, resulting in code fault

I have a very long string in hexadecimal format, convert it with hex2bin at this point Xdebug on Sublime Text is showing me the variable base64 encoded for some reason, if I echo the variable it prints correctly, if I try to $r=json_decode($r, true); it returns null, because it assumed the variable is really its base64 encoded representation.

Steps To Reproduce
<!doctype html>
<html lang="en">

$r = $_GET['r']; //r is any string in hex (obtained with bin2hex in javascript, see notes) format containing special characters such as ÉGOÏSTE 

$r = hex2bin($r);       

//here xdebug on sublime text show it as a base64 encoded string

echo $r;

$r=json_decode($r, true); //since the variable is now base64 and not jus rrepresented as that, this returns null

//the code fail here since there is a null check.

//the problem is xdebug represent long text variables as base64 encoded (probably due to weird letters used??) then assume the representation is the real value of the variable. Passing EGOISTE doesn't trigger the bug.


Additional Information
//javascript code used to bin2hex

function bin2hex (bin)

  var i = 0, l = bin.length, chr, hex = ''

  for (i; i < l; ++i)

    chr = bin.charCodeAt(i).toString(16)

    hex += chr.length < 2 ? '0' + chr : chr


  return hex

Operating SystemWindows 10 x64
PHP Version8.2.0-8.2.9



2024-03-30 21:45

reporter   ~0006887

The problem seems to be PHP related, can someone confirm?


2024-04-15 12:36

administrator   ~0006899

Can you attach the Xdebug debugging log, and the files that you used to this report? You can learn at on how to create a debugging log.


2024-05-06 10:23

administrator   ~0006932

Can you provide the requested feedback please?


2024-05-06 16:47

reporter   ~0006949


Hi, I'm sorry I no longer have the files as I had to adapt the code, no logs either but I have pasted the very same minimal code to reproduce the bug, if this can help I was using Xdebug with the equivalent plug-in for Sublime Text, back then I remember I confirmed multiple times it is showing the string as described while not actually being Base64 however at some point it was read as a real Base64 the problem was most probably caused by text containing ÉGOÏSTE I had to rewrite the client part to normalize strings and only accept "normal" letters and convert this to EGOISTE this solved the bug on Xdebug and/or PHP whoever is at this. I noticed the snippet above stripped the opening tag, not sure why it didn't let me paste the snippet correctly. Was you able to run the above code in the same setup and replicated the issue?


2024-05-10 15:19

administrator   ~0006952

I wouldn't have asked for the logs if I could reproduce it with your example — but that is mostly because it's not a complete case. It's not something I can download and run, with it working immediately.


2024-05-28 10:28

reporter   ~0006962


Ok, I'll create a project with minimum code to replicate the issue. Will update once ready.


2024-06-05 09:04

administrator   ~0006965

Hi @nym,

Did you find the time to do this?



2024-06-05 14:29

reporter   ~0006968


I was drained in a work I had to deliver, I'll do this test project on saturday at the latest and upload it here.


2024-06-07 10:03

reporter   ~0006970


Wow I wrote a lenghty text and token expired, I'll be more concise, download the zip and read the comments inside to fill-in-the-blanks before you test, load the client manifest as a temporary add-on for firefox, as soon and you add it, the plug-in will open a new window to a website with ?r parameter the website must be your XAMPP configured endpoint.

See the comments inside the .js (client) and php (server) files and if it is not clear let me know. (3,219 bytes)

Issue History

Date Modified Username Field Change
2024-03-30 21:27 nym New Issue
2024-03-30 21:27 nym Tag Attached: 3.0.2
2024-03-30 21:45 nym Note Added: 0006887
2024-04-15 12:35 derick Steps to Reproduce Updated
2024-04-15 12:35 derick Additional Information Updated
2024-04-15 12:36 derick Assigned To => derick
2024-04-15 12:36 derick Status new => feedback
2024-04-15 12:36 derick Note Added: 0006899
2024-05-06 10:23 derick Note Added: 0006932
2024-05-06 16:47 nym Note Added: 0006949
2024-05-06 16:47 nym Status feedback => assigned
2024-05-10 15:19 derick Status assigned => feedback
2024-05-10 15:19 derick Note Added: 0006952
2024-05-28 10:28 nym Note Added: 0006962
2024-05-28 10:28 nym Status feedback => assigned
2024-06-05 09:04 derick Status assigned => feedback
2024-06-05 09:04 derick Note Added: 0006965
2024-06-05 14:29 nym Note Added: 0006968
2024-06-05 14:29 nym Status feedback => assigned
2024-06-07 10:03 nym Note Added: 0006970
2024-06-07 10:03 nym File Added: