Skip to content

Commit

Permalink
address third round of PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ericnorris committed Jan 8, 2025
1 parent e843e06 commit 2cd6c3f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Zend/tests/fatal_error_backtraces_001.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
--TEST--
Fatal error backtrace
--INI--
fatal_error_backtraces=On
--FILE--
<?php

ini_set('fatal_error_backtraces', true);

eval("class Foo {}; class Foo {}");
?>
--EXPECTF--
Expand Down
5 changes: 2 additions & 3 deletions Zend/tests/fatal_error_backtraces_002.phpt
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
--TEST--
Fatal error backtrace w/ sensitive parameters
--INI--
fatal_error_backtraces=On
--FILE--
<?php

ini_set('fatal_error_backtraces', true);

function trigger_fatal(#[\SensitiveParameter] $unused) {
eval("class Foo {}; class Foo {}");
}

trigger_fatal("bar");

?>
--EXPECTF--
Fatal error: Cannot redeclare class Foo (%s) in %s : eval()'d code on line %d
Expand Down
7 changes: 3 additions & 4 deletions Zend/tests/fatal_error_backtraces_003.phpt
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
--TEST--
Fatal error backtrace w/ zend.exception_ignore_args
--INI--
fatal_error_backtraces=On
zend.exception_ignore_args=On
--FILE--
<?php

ini_set('fatal_error_backtraces', true);
ini_set('zend.exception_ignore_args', true);

function trigger_fatal($unused) {
eval("class Foo {}; class Foo {}");
}

trigger_fatal("bar");

?>
--EXPECTF--
Fatal error: Cannot redeclare class Foo (%s) in %s : eval()'d code on line %d
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/new_oom.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $php = PHP_BINARY;

foreach (get_declared_classes() as $class) {
$output = shell_exec("$php --no-php-ini $file $class 2>&1");
if ($output && preg_match('/^\nFatal error: Allowed memory size of [0-9]+ bytes exhausted[^\r\n]* \(tried to allocate [0-9]+ bytes\) in [^\r\n]+ on line [0-9]+\nStack trace:\n(#[0-9]+ [^\r\n]+\n)+$/', $output) !== 1) {
if ($output && preg_match('(^\nFatal error: Allowed memory size of [0-9]+ bytes exhausted[^\r\n]* \(tried to allocate [0-9]+ bytes\) in [^\r\n]+ on line [0-9]+\nStack trace:\n(#[0-9]+ [^\r\n]+\n)+$)', $output) !== 1) {
echo "Class $class failed\n";
echo $output, "\n";
}
Expand Down
1 change: 0 additions & 1 deletion Zend/zend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,6 @@ void zend_startup(zend_utility_functions *utility_functions) /* {{{ */
CG(map_ptr_size) = 0;
CG(map_ptr_last) = 0;
#endif /* ZTS */

EG(error_reporting) = E_ALL & ~E_NOTICE;

zend_interned_strings_init();
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ struct _zend_executor_globals {

int error_reporting;

int fatal_error_backtraces;
bool fatal_error_backtraces;
zval error_backtrace;

int exit_status;
Expand Down

0 comments on commit 2cd6c3f

Please sign in to comment.