Closed kokamvd closed 2 years ago
The PHP have a strange behavior for such syntax. Tested some stuff in sandbox and that's what I discovered:
<?php
$class = new (get_class(new Exception)));
Gives error:
Parse error: syntax error, unexpected '(' in test.php on line 4
Process exited with code 255.
However, it works for PHP => 8.0.
<?php
$class = new get_class(new Exception);
Gives error:
Fatal error: Uncaught Error: Class "get_class" not found in test.php:4
Stack trace:
#0 {main}
thrown in /in/CPRRi on line 4
Process exited with code 255.
However, it works for PHP <= 8.0.
In version 2, the kernel object will be reworked, and the issue will be resolved by itself, but for now something like this will fix the issue:
$kernel = get_class($this->kernel);
$this->kernel = new $kernel;
Thanks for contribution!
Laravel v8.80.0 (PHP v8.1.1)
Looks like this commit is wrong 76f9607bc96a0cca0ee66126c28bf2b534b52edc