-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Open
Labels
Description
Symfony version(s) affected
7.3.2
Description
I'm using Symfony Framework with DebugBundle and WebProfilerBundle enabled and notice something odd.
When I use dd('test');
inside a controller, using PHP FPM, I would see an empty page with the test
visible.
But when I switch to FrankenPHP, it no longer works. I get an empty page instead.
When I use dump('test');
I see the dump visible in the Symfony Toolbar.
When I comment out the follow code, dd
works as expected:
symfony/src/Symfony/Bundle/DebugBundle/DebugBundle.php
Lines 30 to 48 in 7b2d29f
// This code is here to lazy load the dump stack. This default | |
// configuration is overridden in CLI mode on 'console.command' event. | |
// The dump data collector is used by default, so dump output is sent to | |
// the WDT. In a CLI context, if dump is used too soon, the data collector | |
// will buffer it, and release it at the end of the script. | |
VarDumper::setHandler(function ($var, ?string $label = null) use ($container) { | |
$dumper = $container->get('data_collector.dump'); | |
$cloner = $container->get('var_dumper.cloner'); | |
$handler = function ($var, ?string $label = null) use ($dumper, $cloner) { | |
$var = $cloner->cloneVar($var); | |
if (null !== $label) { | |
$var = $var->withContext(['label' => $label]); | |
} | |
$dumper->dump($var); | |
}; | |
VarDumper::setHandler($handler); | |
$handler($var, $label); | |
}); |
When I disable worker mode, it just works as expected.
How to reproduce
Possible Solution
Could it be related to the fact that the above code works on boot
, and maybe together with worker
mode this is only called once?