Reason: phpinfo() displays all information in $_SERVER, including the value added by this module in registration.php, but the instance of class \Magento\Framework\Profiler\Driver\Standard\Stat can not be represented as a string because the class does not have __toString() method implemented.
This PR does save this object in $GLOBALS instead of $_SERVER because that's the PHP-recommended place to save global variables.
Steps to Replicate:
mirasvit/module-profiler
Expected: php information is returned
Actual: application crashes
Reason:
phpinfo()
displays all information in$_SERVER
, including the value added by this module inregistration.php
, but the instance of class\Magento\Framework\Profiler\Driver\Standard\Stat
can not be represented as a string because the class does not have__toString()
method implemented.This PR does save this object in
$GLOBALS
instead of$_SERVER
because that's the PHP-recommended place to save global variables.