Skip to content

Commit

Permalink
throwing exceptions from __toString() is allowed since PHP 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Nov 18, 2019
1 parent eee535a commit 5f0c2ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Application/UI/Link.php
Expand Up @@ -96,7 +96,7 @@ public function __toString()
} catch (\Throwable $e) {
}
if (isset($e)) {
if (func_num_args()) {
if (func_num_args() || PHP_VERSION_ID >= 70400) {
throw $e;
}
trigger_error('Exception in ' . __METHOD__ . "(): {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", E_USER_ERROR);
Expand Down
2 changes: 1 addition & 1 deletion src/Bridges/ApplicationLatte/Template.php
Expand Up @@ -76,7 +76,7 @@ public function __toString()
} catch (\Throwable $e) {
}
if (isset($e)) {
if (func_num_args()) {
if (func_num_args() || PHP_VERSION_ID >= 70400) {
throw $e;
}
trigger_error('Exception in ' . __METHOD__ . "(): {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", E_USER_ERROR);
Expand Down

0 comments on commit 5f0c2ab

Please sign in to comment.