diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-03 10:59:26 +0200 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-03 11:00:12 +0200 |
| commit | 2bf880db2c624a32f130e0da309b22dcf782609d (patch) | |
| tree | 56efcd56a99e8b574e023724f8bcedbcacdaa7a1 | |
| parent | c0924cf67d81c9bdf4451c4e00fb956cf154a141 (diff) | |
| download | php-git-2bf880db2c624a32f130e0da309b22dcf782609d.tar.gz | |
Fixed bug #78239
| -rw-r--r-- | NEWS | 4 | ||||
| -rw-r--r-- | Zend/tests/bug78239.phpt | 30 | ||||
| -rw-r--r-- | Zend/zend_execute_API.c | 1 |
3 files changed, 35 insertions, 0 deletions
@@ -2,6 +2,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 7.4.0alpha3 +- Core: + . Fixed bug #78239 (Deprecation notice during string conversion converted to + exception hangs). (Nikita) + - Date: . Updated timelib to 2018.02. (Derick) diff --git a/Zend/tests/bug78239.phpt b/Zend/tests/bug78239.phpt new file mode 100644 index 0000000000..94908a785b --- /dev/null +++ b/Zend/tests/bug78239.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #78239: Deprecation notice during string conversion converted to exception hangs +--FILE-- +<?php +function handleError($level, $message, $file = '', $line = 0, $context = []) +{ + throw new ErrorException($message, 0, $level, $file, $line); +} + +set_error_handler('handleError'); + +class A +{ + + public function abc(): bool + { + return false; + } +} + +$r = new ReflectionMethod("A", "abc"); +(string)$r->getReturnType() ?: ""; + +?> +--EXPECTF-- +Fatal error: Uncaught ErrorException: Function ReflectionType::__toString() is deprecated in %s:%d +Stack trace: +#0 %s(%d): handleError(%s) +#1 {main} + thrown in %s on line %d diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index f6f1eed26f..a530162d50 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -754,6 +754,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) / zend_vm_stack_free_call_frame(call); if (EG(current_execute_data) == &dummy_execute_data) { EG(current_execute_data) = dummy_execute_data.prev_execute_data; + zend_rethrow_exception(EG(current_execute_data)); } return FAILURE; } |
