View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002053 | Xdebug | Step Debugging | public | 2021-12-16 15:39 | 2022-10-14 14:52 |
| Reporter | LazyOne | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | resolved | Resolution | no change required | ||
| Product Version | 3.1.1 | ||||
| Summary | 0002053: PhpStorm incorrectly requests "GLOBALS" key in $GLOBALS array | ||||
| Description | Evaluate window reports "Cannot get property" for array elements for PHP 8.1. At the same time the same steps work just fine when PHP 8.0 is used. A bit more details can be seen in this PhpStorm ticket: https://youtrack.jetbrains.com/issue/WI-64532 | ||||
| Steps To Reproduce |
Try to debug the above code in PhpStorm 2021.3. Once stopped at the breakpoint, see the content of The same works with PHP 8.0 in the same environment (the same Xdebug version etc). | ||||
| Additional Information | Windows 10 Pro 21H1 (OS build 19043.1415) PHP 8.0.13 NTS x64
PHP 8.1.0 NTS x64 | ||||
| Tags | No tags attached. | ||||
| Operating System | Windows 10 | ||||
| PHP Version | 8.1.0-8.1.4 | ||||
|
|
I've had a look now, and this is not really a bug on the Xdebug side. PhpStorm uses the -c 1 to switch to the "Globals" context, and then accesses in this context, the GLOBALS key. The globals context in PHP 8.1 does no longer contain the GLOBALS key as per https://wiki.php.net/rfc/restrict_globals_usage#proposal:
What PhpStorm should have sent to Xdebug is:
Which works both in PHP 7.2 through PHP 8.1: https://github.com/xdebug/xdebug/pull/816 |
|
|
FWIW, this has been fixed in PhpStorm for a while now: https://blog.jetbrains.com/phpstorm/2022/05/phpstorm-2022-1-1-is-released/#Xdebug_Cannot_get_property_bugfix_WI-65974 |