8000 fix merge · symfony/symfony@158482f · GitHub
[go: up one dir, main page]

Skip to content

Commit 158482f

Browse files
fix merge
1 parent a0c2aa8 commit 158482f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Symfony/Component/ErrorHandler/ErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ public function handleError(int $type, string $message, string $file, int $line)
448448
}
449449

450450
if ($throw) {
451-
if (E_USER_ERROR & $type) {
451+
if (\PHP_VERSION_ID < 70400 && E_USER_ERROR & $type) {
452452
for ($i = 1; isset($backtrace[$i]); ++$i) {
453453
if (isset($backtrace[$i]['function'], $backtrace[$i]['type'], $backtrace[$i - 1]['function'])
454454
&& '__toString' === $backtrace[$i]['function']

src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ public function testHandleError()
283283

284284
public function testHandleUserError()
285285
{
286+
if (\PHP_VERSION_ID >= 70400) {
287+
$this->markTestSkipped('PHP 7.4 allows __toString to throw exceptions');
288+
}
289+
286290
try {
287291
$handler = ErrorHandler::register();
288292
$handler->throwAt(0, true);

0 commit comments

Comments
 (0)
0