1
0
mirror of https://github.com/php/php-src.git synced 2026-03-28 02:02:32 +01:00

Merge branch 'PHP-7.1'

* PHP-7.1:
  Update NEWS
  Fixed bug #74408 (Endless loop bypassing execution time limit)
This commit is contained in:
Xinchen Hui
2017-04-11 18:47:06 +08:00
2 changed files with 47 additions and 0 deletions

38
Zend/tests/bug74408.phpt Normal file
View File

@@ -0,0 +1,38 @@
--TEST--
Bug #74408 (Endless loop bypassing execution time limit)
--INI--
error_reporting = E_ALL | E_DEPRECATED | E_STRICT
--FILE--
<?php
//php.ini: error_reporting = E_ALL | E_DEPRECATED | E_STRICT
class ErrorHandling {
public function error_handler($errno, $errstr, $errfile, $errline) {
$bla = new NonExistingClass2();
}
public function exception_handler(Error $e) {
echo "Caught, exception: " . $e->getMessage();
}
}
set_error_handler('ErrorHandling::error_handler');
set_exception_handler('ErrorHandling::exception_handler');
$blubb = new NonExistingClass();
?>
--EXPECTF--
Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in %sbug74408.php on line %d
Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in %sbug74408.php on line %d
Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in Unknown on line 0
Fatal error: Uncaught Error: Class 'NonExistingClass2' not found in %sbug74408.php:%d
Stack trace:
#0 [internal function]: ErrorHandling::error_handler(8192, 'Non-static meth...', '%s', %d, Array)
#1 %sbug74408.php(%d): set_exception_handler('ErrorHandling::...')
#2 {main}
thrown in %sbug74408.php on line %d

View File

@@ -750,6 +750,15 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
}
zend_error(E_DEPRECATED, "%s", error);
efree(error);
if (UNEXPECTED(EG(exception))) {
if (callable_name) {
zend_string_release(callable_name);
}
if (EG(current_execute_data) == &dummy_execute_data) {
EG(current_execute_data) = dummy_execute_data.prev_execute_data;
}
return FAILURE;
}
}
zend_string_release(callable_name);
}