View Issue Details

IDProjectCategoryView StatusLast Update
0002214XdebugTracingpublic2023-11-30 14:50
Reporterxwillq Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.2.2 
Target Version3.3devFixed in Version3.3.0 
Summary0002214: Array keys aren't escaped in traces
Description

Array keys aren't escaped in traces with machine readable format, which makes those traces hard to parse and breaks some existing scripts.

Steps To Reproduce
  1. Enable tracing with machine output
  2. Pass array with keys like '\n', '\r', etc. as function parameter
  3. See trace

Expected result:
Trace contains one function call per line with arguments escaped, so it would be easy to parse.

Actual result:
Line breaks are not expected, so they span multiple lines.

Additional Information

php -v output:
PHP 8.1.25 (cli) (built: Oct 28 2023 03:35:44) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.25, Copyright (c) Zend Technologies
with Zend OPcache v8.1.25, Copyright (c), by Zend Technologies
with Xdebug v3.2.2, Copyright (c) 2002-2023, by Derick Rethans

OS:
Docker image php:8.1-fpm-alpine3.17 on Docker Desktop for Macos.

This issue also appears in this version:
PHP 7.4.33 (cli) (built: Nov 12 2022 05:16:49) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
with Xdebug v3.1.6, Copyright (c) 2002-2022, by Derick Rethans

TagsNo tags attached.
Operating System
PHP Version8.1.10-8.1.19

Activities