Problem:
Upgrading to PHP 8 has rendered a Laravel application dysfunctional, causing the following deprecation warnings:
Deprecated: Method ReflectionParameter::getClass() is deprecated in /Users/.../Sites/.../vendor/laravel/framework/src/Illuminate/Container/Container.php on line 871 ...
Solution:
As PHP 8 introduces revisions to type systems, certain Reflection API methods within ReflectionParameter are now obsolete. To resolve this issue, follow these steps:
"php": "^7.4|^8.0",
composer update
PHP: ^8.0 Faker: fakerphp/faker:^1.9.1 PHPUnit: phpunit/phpunit:^9.3
Explanation:
PHP 8's enhancements to type systems have caused incorrect results from certain Reflection API methods in ReflectionParameter. Hence, the following deprecated methods should be replaced with ReflectionParameter::getType():
ReflectionParameter::getClass() ReflectionParameter::isArray() ReflectionParameter::isCallable()
Das obige ist der detaillierte Inhalt vonWas tun, wenn die Laravel-App nach dem PHP 8-Upgrade kaputt geht?. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!