These are associated with an incompatible php version.
Mar 16, 2024
12
Level 2
Artisan Command Deprecation Warnings and Errors
I get errors below while running php artisan sail:install command or any php artisan command. Everything was normal. I don't know reason of this situation. I deleted vendor folder and re run "composer install" command but it's same.
PS D:\Work\webdev\matolye\backend> php artisan sail:install
PHP Deprecated: Return type of Illuminate\Container\Container::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 1355
Deprecated: Return type of Illuminate\Container\Container::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 1355
PHP Deprecated: Return type of Illuminate\Container\Container::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 1366
Deprecated: Return type of Illuminate\Container\Container::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 1366
PHP Deprecated: Return type of Illuminate\Container\Container::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 1378
Deprecated: Return type of Illuminate\Container\Container::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 1378
PHP Deprecated: Return type of Illuminate\Container\Container::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 1391
Deprecated: Return type of Illuminate\Container\Container::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 1391
PHP Deprecated: Return type of Illuminate\Config\Repository::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Config\Repository.php on line 141
Deprecated: Return type of Illuminate\Config\Repository::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Config\Repository.php on line 141
PHP Deprecated: Return type of Illuminate\Config\Repository::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Config\Repository.php on line 152
Deprecated: Return type of Illuminate\Config\Repository::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Config\Repository.php on line 152
PHP Deprecated: Return type of Illuminate\Config\Repository::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Config\Repository.php on line 164
Deprecated: Return type of Illuminate\Config\Repository::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Config\Repository.php on line 164
PHP Deprecated: Return type of Illuminate\Config\Repository::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Config\Repository.php on line 175
Deprecated: Return type of Illuminate\Config\Repository::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Config\Repository.php on line 175
PHP Fatal error: During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Collections\Collection.php:1443
Stack trace:
#0 D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Collections\Collection.php(13): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8192, 'Return type of ...', 'D:\Work\webdev\...', 1443)
#1 D:\Work\webdev\matolye\backend\vendor\composer\ClassLoader.php(571): include('D:\Work\webdev\...')
#2 D:\Work\webdev\matolye\backend\vendor\composer\ClassLoader.php(428): Composer\Autoload\includeFile('D:\Work\webdev\...')
#3 D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Collections\helpers.php(15): Composer\Autoload\ClassLoader->loadClass('Illuminate\Supp...')
#4 D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(130): collect(Array)
#5 D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(106): Illuminate\Foundation\PackageManifest->build()
#6 D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(89): Illuminate\Foundation\PackageManifest->getManifest()
#7 D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(78): Illuminate\Foundation\PackageManifest->config('aliases')
#8 D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\RegisterFacades.php(26): Illuminate\Foundation\PackageManifest->aliases()
#9 D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(237): Illuminate\Foundation\Bootstrap\RegisterFacades->bootstrap(Object(Illuminate\Foundation\Application))
#10 D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(310): Illuminate\Foundation\Application->bootstrapWith(Array)
#11 D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(127): Illuminate\Foundation\Console\Kernel->bootstrap()
#12 D:\Work\webdev\matolye\backend\artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 {main} in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Collections\Collection.php on line 13
PHP Fatal error: Uncaught Error: Class "Illuminate\Support\Collection" not found in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Collections\helpers.php:15
Stack trace:
#0 D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Support\Traits\ReflectsClosures.php(24): collect(Array)
#1 D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Support\Traits\ReflectsClosures.php(44): Illuminate\Foundation\Exceptions\ReportableHandler->closureParameterTypes(Object(Closure))
#2 D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\ReportableHandler.php(62): Illuminate\Foundation\Exceptions\ReportableHandler->firstClosureParameterType(Object(Closure))
#3 D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(234): Illuminate\Foundation\Exceptions\ReportableHandler->handles(Object(Symfony\Component\ErrorHandler\Error\FatalError))
#4 D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(88): Illuminate\Foundation\Exceptions\Handler->report(Object(Symfony\Component\ErrorHandler\Error\FatalError))
#5 D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(130): Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Symfony\Component\ErrorHandler\Error\FatalError))
#6 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()
#7 {main}
thrown in D:\Work\webdev\matolye\backend\vendor\laravel\framework\src\Illuminate\Collections\helpers.php on line 15
Level 29
@mecjos Its clearly giving you PHP Deprecated errors, which you would get when using a newer PHP version that doesn't support the specific code that used to work fine in older PHP versions.
Please or to participate in this conversation.