diff --git a/src/functions.php b/src/functions.php index 5cfefa4..0004b20 100644 --- a/src/functions.php +++ b/src/functions.php @@ -57,8 +57,13 @@ function throwable_decode($json) array_pop($properties); + if (PHP_MAJOR_VERSION === 7) { + $throwable = (new ReflectionClass($json['class']))->newInstanceWithoutConstructor(); + } $class = new ReflectionClass($json['class']); - $throwable = new $json['class'](); + if (!isset($throwable)) { + $throwable = new $json['class'](); + } foreach ($properties as $key) { if (!$class->hasProperty($key)) { continue;