Community
Participate
Working Groups
Hi, as discussed with Michele Locati while working on bug 519045 ( https://bugs.eclipse.org/bugs/show_bug.cgi?id=519045#c10 ): Using xdebug to update an array value ($b["baz qux"]) does not work at all: <?php $b['baz qux'] = 'ipsum'; ?> https://xdebug.org/docs-dbgp.php#property-get-property-set-property-value is not clear about how to handle arrays, for example: property_set -t string -n $b["baz qux"] -d 0 -l 4 -- YQ== will not work, neither will: property_set -t string -n "$b[\"baz qux\"]" -d 0 -l 4 -- YQ== Thank you to Michele for the following: xdebug issue submitted: https://bugs.xdebug.org/view.php?id=1499 We need to wait until https://bugs.xdebug.org/view.php?id=1488 is fixed. Thierry.
Issue has been fixed on Xdebug side. Can we move this forward?
Hi Dawid, I'll have a look into this one next days. I'll do some tests and if everything works as expected, I close the bug report. Thierry.
New Gerrit change created: https://git.eclipse.org/r/155612
Gerrit change https://git.eclipse.org/r/155612 was merged to [master]. Commit: http://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=7ec242eecfba6608b53aa5ed5ede7811f3a6e769
Should be fixed now. I made my tests with Xdebug 2.6.0 (before Xdebug fixed the problem on their side, to check that I introduced no regressions) and Xdebug 2.9.0 under Windows, but not with older versions of Xdebug (or any other OS). Xdebug >= 2.7.2 + upcoming PDT 7.1 should now be able to handle correctly array item value modifications. If you see some regressions, please open a new bug report. Thierry.
Additional note: I made my tests using the strangest array keys possible, so for posterity, here are some of them ;) <?php $s = array( <<<'EOF' \0toto\' \$xxxxx'' tutu\'\' '\''\'''' EOF => 'u', <<<EOF \0toto2\' \$xxxxx'' tutu\'\' '\''\'''' EOF => 'v' ); $b['$\$\$baz\0 ""\"\"\\ qux'] = 'ipsum'; $b["$\$\$baz\0 ''\'\'\\ qux"] = 'ipsum'; echo $b['$\$\$baz\0 ""\"\"\\ qux'] . PHP_EOL; echo $b["$\$\$baz\0 ''\'\'\\ qux"] . PHP_EOL; echo array_shift($s) . PHP_EOL; echo array_shift($s) . PHP_EOL; ?>
Thank you. Can you update https://wiki.eclipse.org/PDT/NewIn71 Just create Debugger section ;)
(In reply to Dawid Pakula from comment #7) > Thank you. Can you update https://wiki.eclipse.org/PDT/NewIn71 > > Just create Debugger section ;) Ok I'll do that! :) I also correct my previous comments, I confused myself testing many Xdebug versions: - without this patch, PDT + Xdebug < 2.7.2 couldn't modify any value from any PHP variable. I don't know since how many Xdebug versions this feature didn't work anymore - without this patch, PDT + Xdebug >= 2.7.2 can modify any value from any PHP variable, so long it's not a value inside an array. - with this patch, PDT + Xdebug >= 2.7.2 can modify correctly any value from any PHP variable.
So if I good understand, we have value hot replace? ;)
(In reply to Dawid Pakula from comment #9) > So if I good understand, we have value hot replace? ;) Yes, at least basic hot replace using Xdebug >= 2.7.2 :) It should have probably worked before, since all necessary code was written. But I haven't tested it on object properties, because the debugger variable tab doesn't allow to unfold object properties. Thierry.