Skip to content

Commit 2bf880d

Browse files
committed
Fixed bug #78239
1 parent c0924cf commit 2bf880d

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 7.4.0alpha3
44

5+
- Core:
6+
. Fixed bug #78239 (Deprecation notice during string conversion converted to
7+
exception hangs). (Nikita)
8+
59
- Date:
610
. Updated timelib to 2018.02. (Derick)
711

Zend/tests/bug78239.phpt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--TEST--
2+
Bug #78239: Deprecation notice during string conversion converted to exception hangs
3+
--FILE--
4+
<?php
5+
function handleError($level, $message, $file = '', $line = 0, $context = [])
6+
{
7+
throw new ErrorException($message, 0, $level, $file, $line);
8+
}
9+
10+
set_error_handler('handleError');
11+
12+
class A
13+
{
14+
15+
public function abc(): bool
16+
{
17+
return false;
18+
}
19+
}
20+
21+
$r = new ReflectionMethod("A", "abc");
22+
(string)$r->getReturnType() ?: "";
23+
24+
?>
25+
--EXPECTF--
26+
Fatal error: Uncaught ErrorException: Function ReflectionType::__toString() is deprecated in %s:%d
27+
Stack trace:
28+
#0 %s(%d): handleError(%s)
29+
#1 {main}
30+
thrown in %s on line %d

Zend/zend_execute_API.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
754754
zend_vm_stack_free_call_frame(call);
755755
if (EG(current_execute_data) == &dummy_execute_data) {
756756
EG(current_execute_data) = dummy_execute_data.prev_execute_data;
757+
zend_rethrow_exception(EG(current_execute_data));
757758
}
758759
return FAILURE;
759760
}

0 commit comments

Comments
 (0)