View Issue Details

IDProjectCategoryView StatusLast Update
0001477XdebugUsage problems (Wrong Results)public2017-12-17 14:38
ReporterLanaZemAssigned Toderick 
Status resolvedResolutionnot fixable 
Product Version2.5.5 
Target VersionFixed in Version 
Summary0001477: Stream 'stdout' doesn't send all output to IDE
Description'stdout' options configured to copy all output skips output for 'xdebug_debug_zval_stdout(...)' and 'file_put_contents(...)' methods.
Steps To Reproduce1) Create php file
echo "Regular output";
xdebug_debug_zval_stdout("Xdebug stdout");
file_put_contents('php://stdout', "Log information");

2) Enable stdout with "stdout -i 1 -c 1"

<- stdout -i 5 -c 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="" command="stdout" transaction_id="5" success="1"></response>

3) Execute debugger

I expect to see all "Regular output", "Xdebug stdout" and "Log information" streams but only "Regular output" will be here.
Additional InformationReproducible for Xdebug 2.5.5 + PHP 7.1.1.

Logs are attached.
TagsNo tags attached.
Operating System
PHP Version7.1.0-7.1.4



2017-10-04 09:29


xdebug_7_2.5.log (4,571 bytes)


2017-10-04 09:37

reporter   ~0004433

I've added php script file with incorrect 'xdebug_debug_zval_stdout' usage.

Here's the right one, the ouput from 'xdebug_debug_zval_stdout' still won't be sent:

echo "Regular output";
$a = array(1, 2, 3);
file_put_contents('php://stdout', "Log information");


2017-10-06 14:38

reporter   ~0004436

Hi Derick,

A bit of context for this issue: LanaZem is working to fix my feature request in PhpStorm: Xdebug stdout redirection, and show it in the 'Console' tab on the debugger panel.


2017-12-17 14:38

administrator   ~0004518


I have had a look, and I don't think this is something I can fix. Most normal output in PHP goes through it's SAPI layer, which Xdebug can hook into to intercept output. However, *direct* output to stdout, which is what xdebug_debug_zval_stdout() and file_put_contents("php://stdout", ...) do, does not go through the SAPI layer, and hence Xdebug can't intercept it. Which means I can't send it over the debugging protocol.


Issue History

Date Modified Username Field Change
2017-10-04 09:29 LanaZem New Issue
2017-10-04 09:29 LanaZem File Added: xdebug_7_2.5.log
2017-10-04 09:37 LanaZem Note Added: 0004433
2017-10-06 14:38 langemeijer Note Added: 0004436
2017-12-17 14:38 derick Note Added: 0004518
2017-12-17 14:38 derick Status new => resolved
2017-12-17 14:38 derick Resolution open => not fixable
2017-12-17 14:38 derick Assigned To => derick