diff --git a/src/Tracy/Dumper.php b/src/Tracy/Dumper.php index e0f973afd..1a1c9e810 100644 --- a/src/Tracy/Dumper.php +++ b/src/Tracy/Dumper.php @@ -175,7 +175,7 @@ private static function dumpDouble(&$var): string { $var = is_finite($var) ? ($tmp = json_encode($var)) . (strpos($tmp, '.') === false ? '.0' : '') - : str_replace('.0', '', var_export($var, true)); // workaround for PHP 7.0.2 + : var_export($var, true); return "$var\n"; } diff --git a/tests/Tracy/Debugger.E_ERROR.console.phpt b/tests/Tracy/Debugger.E_ERROR.console.phpt index 6c9ee492d..83b0cfa4a 100644 --- a/tests/Tracy/Debugger.E_ERROR.console.phpt +++ b/tests/Tracy/Debugger.E_ERROR.console.phpt @@ -26,7 +26,7 @@ $onFatalErrorCalled = false; register_shutdown_function(function () use (&$onFatalErrorCalled) { Assert::true($onFatalErrorCalled); - Assert::match(PHP_MAJOR_VERSION > 5 ? + Assert::match( "Error: Call to undefined function missing_function() in %a% Stack trace: #0 %a%: third(Array) @@ -34,23 +34,7 @@ Stack trace: #2 %a%: first(10, 'any string') #3 {main} Unable to log error: Logging directory is not specified. -" : (extension_loaded('xdebug') ? ' -Fatal error: Call to undefined function missing_function() in %a% -ErrorException: Call to undefined function missing_function() in %a% -Stack trace: -#0 %a%: third() -#1 %a%: second() -#2 %a%: first() -#3 {main} -Unable to log error: Logging directory is not specified. -' : ' -Fatal error: Call to undefined function missing_function() in %a% -ErrorException: Call to undefined function missing_function() in %a% -Stack trace: -#0 [internal function]: Tracy\\Debugger::shutdownHandler() -#1 {main} -Unable to log error: Logging directory is not specified. -'), ob_get_clean()); +", ob_get_clean()); echo 'OK!'; // prevents PHP bug #62725 }); diff --git a/tests/Tracy/Debugger.E_ERROR.html.phpt b/tests/Tracy/Debugger.E_ERROR.html.phpt index c830984c6..d5afd7e03 100644 --- a/tests/Tracy/Debugger.E_ERROR.html.phpt +++ b/tests/Tracy/Debugger.E_ERROR.html.phpt @@ -33,7 +33,7 @@ register_shutdown_function(function () use (&$onFatalErrorCalled) { Assert::true($onFatalErrorCalled); $output = ob_get_clean(); Assert::same(1, substr_count($output, ' - -
- - - - -Fatal Error
- -File: %a%
-%d%: -%d%: -%d%: function second($arg1, $arg2) -%d%: { -%d%: third([1, 2, 3]); -%d%: } -%d%: -%d%: -%d%: function third($arg1) -%d%: { -%d%: missing_function(); -%d%: } -%d%: -%d%: -%d%: first(10, 'any string'); -
empty
-empty
-empty
-%A%-
Fatal Error
- -File: %a%
-%d%: -%d%: -%d%: function second($arg1, $arg2) -%d%: { -%d%: third([1, 2, 3]); -%d%: } -%d%: -%d%: -%d%: function third($arg1) -%d%: { -%d%: missing_function(); -%d%: } -%d%: -%d%: -%d%: first(10, 'any string'); -
- - %a% - source - third() -
- -%d%: -%d%: -%d%: function first($arg1, $arg2) -%d%: { -%d%: second(true, false); -%d%: } -%d%: -%d%: -%d%: function second($arg1, $arg2) -%d%: { -%d%: third([1, 2, 3]); -%d%: } -%d%: -%d%: -%d%: function third($arg1) -
- - %a% - source - second() -
- -- - - -%d%:%A%
- - %a% - source - first() -
- -%d%: third([1, 2, 3]); -%d%: } -%d%: -%d%: -%d%: function third($arg1) -%d%: { -%d%: missing_function(); -%d%: } -%d%: -%d%: -%d%: first(10, 'any string'); -%d%: -
empty
-empty
-empty
-%A%-