Closed
Description
Symfony version(s) affected: 4.3.x
Description
this piece of code looks wrong, can someone please take a look
https://github.com/symfony/symfony/blob/4.3/src/Symfony/Component/HttpKernel/Kernel.php#L508-L512
$previousHandler = \defined('PHPUNIT_COMPOSER_INSTALL');
$previousHandler = $previousHandler ?: set_error_handler(function ($type, $message, $file, $line) use (&$collectedLogs, &$previousHandler) {
if (E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) {
return $previousHandler ? $previousHandler($type, $message, $file, $line) : false;
}
defined
returns true
or false
-
if
true
?: ... => $previousHandler = true; -
if
false
this might happen
return $previousHandler ? $previousHandler($type, $message, $file, $line) : false;
as $previousHandler=false this returns false
;
luckily, otherwise we might try to execute true
as a function :)
Possible Solution
this is probably wrong assignment
$previousHandler = \defined('PHPUNIT_COMPOSER_INSTALL');