سلام خسته نباشید من یک پروژه لاراولی با نسخه ۸ دارم وقتی نسخه php رو به ۸.۱.۳ آپدیت کردم موقعی که میخوام از artisan استفاده کنم به این ارور میخورم
Deprecated: Return type of PhpOption\Some::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\Mahdi\Desktop\laravel learn\project\vendor\phpoption\phpoption\src\PhpOption\Some.php on line 152
Deprecated: Return type of PhpOption\None::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\Mahdi\Desktop\laravel learn\project\vendor\phpoption\phpoption\src\PhpOption\None.php on line 118
Deprecated: Return type of Symfony\Component\Finder\Finder::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\Mahdi\Desktop\laravel learn\project\vendor\symfony\finder\Finder.php on line 608
Deprecated: Return type of Symfony\Component\Finder\Finder::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\Mahdi\Desktop\laravel learn\project\vendor\symfony\finder\Finder.php on line 690
Deprecated: Return type of Symfony\Component\Finder\Iterator\FileTypeFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\Mahdi\Desktop\laravel learn\project\vendor\symfony\finder\Iterator\FileTypeFilterIterator.php on line 42
Deprecated: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\Mahdi\Desktop\laravel learn\project\vendor\symfony\finder\Iterator\ExcludeDirectoryFilterIterator.php on line 55
Deprecated: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::hasChildren() should either be compatible with RecursiveIterator::hasChildren(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\Mahdi\Desktop\laravel learn\project\vendor\symfony\finder\Iterator\ExcludeDirectoryFilterIterator.php on line 74
Deprecated: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::getChildren() should either be compatible with RecursiveIterator::getChildren(): ?RecursiveIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\Mahdi\Desktop\laravel learn\project\vendor\symfony\finder\Iterator\ExcludeDirectoryFilterIterator.php on line 82
Deprecated: Return type of Symfony\Component\Finder\Iterator\FilenameFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\Mahdi\Desktop\laravel learn\project\vendor\symfony\finder\Iterator\FilenameFilterIterator.php on line 28
Deprecated: Return type of Symfony\Component\Finder\Iterator\PathFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\Mahdi\Desktop\laravel learn\project\vendor\symfony\finder\Iterator\PathFilterIterator.php on line 27
In ParameterBag.php line 21:
During inheritance of IteratorAggregate: Uncaught ErrorException: Return type of Symfony\Component\HttpFoundation\ParameterBag::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\R
eturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\Mahdi\Desktop\laravel learn\project\vendor\symfony\http-foundation\ParameterBag.php:210
Stack trace:
#0 C:\Users\Mahdi\Desktop\laravel learn\project\vendor\symfony\http-foundation\ParameterBag.php(21): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8192, 'Return type of ...', 'C:\\Users\\Mahdi\\...', 210)
#1 C:\Users\Mahdi\Desktop\laravel learn\project\vendor\composer\ClassLoader.php(571): include('C:\\Users\\Mahdi\\...')
#2 C:\Users\Mahdi\Desktop\laravel learn\project\vendor\composer\ClassLoader.php(428): Composer\Autoload\includeFile('C:\\Users\\Mahdi\\...')
#3 C:\Users\Mahdi\Desktop\laravel learn\project\vendor\symfony\http-foundation\FileBag.php(22): Composer\Autoload\ClassLoader->loadClass('Symfony\\Compone...')
#4 C:\Users\Mahdi\Desktop\laravel learn\project\vendor\composer\ClassLoader.php(571): include('C:\\Users\\Mahdi\\...')
#5 C:\Users\Mahdi\Desktop\laravel learn\project\vendor\composer\ClassLoader.php(428): Composer\Autoload\includeFile('C:\\Users\\Mahdi\\...')
#6 [internal function]: Composer\Autoload\ClassLoader->loadClass('Symfony\\Compone...')
#7 C:\Users\Mahdi\Desktop\laravel learn\project\vendor\symfony\http-foundation\Request.php(22): class_exists('Symfony\\Compone...')
#8 C:\Users\Mahdi\Desktop\laravel learn\project\vendor\composer\ClassLoader.php(571): include('C:\\Users\\Mahdi\\...')
#9 C:\Users\Mahdi\Desktop\laravel learn\project\vendor\composer\ClassLoader.php(428): Composer\Autoload\includeFile('C:\\Users\\Mahdi\\...')
#10 C:\Users\Mahdi\Desktop\laravel learn\project\vendor\laravel\framework\src\Illuminate\Http\Request.php(20): Composer\Autoload\ClassLoader->loadClass('Symfony\\Compone...')
#11 C:\Users\Mahdi\Desktop\laravel learn\project\vendor\composer\ClassLoader.php(571): include('C:\\Users\\Mahdi\\...')
#12 C:\Users\Mahdi\Desktop\laravel learn\project\vendor\composer\ClassLoader.php(428): Composer\Autoload\includeFile('C:\\Users\\Mahdi\\...')
#13 C:\Users\Mahdi\Desktop\laravel learn\project\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\SetRequestForConsole.php(31): Composer\Autoload\ClassLoader->loadClass('Illuminate\\Http...')
#14 C:\Users\Mahdi\Desktop\laravel learn\project\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(237): Illuminate\Foundation\Bootstrap\SetRequestForConsole->bootstrap(Object(Illuminate\Foundation\Application))
#15 C:\Users\Mahdi\Desktop\laravel learn\project\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(310): Illuminate\Foundation\Application->bootstrapWith(Array)
#16 C:\Users\Mahdi\Desktop\laravel learn\project\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(127): Illuminate\Foundation\Console\Kernel->bootstrap()
#17 C:\Users\Mahdi\Desktop\laravel learn\project\artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 {main}
در حال حاضر نمیتونم این پروژه رو به لاراول ۹ آپدیت کنم اگه راه حلی به غیر آپدیت دارید ممنون میشم بگید سپاس
سلام
بنده فکر میکنم مشکل باید از نسخه PHP 8 باشه ، چون تو PHP 8 یکسری چیز ها تغییر کرده و اون کتابخونه داره از چیزی استفاده میکنه که در نسخه جدید PHP تغییر کرده. خطای شما مشابه این خطا هستش.
به نظرم نسخه PHP تون رو به نسخه 7 ببرید درست میشه.
@mahdi.dev
خداروشکر که مشکلتون حل شد. لطفا پاسخ خودتون رو بهترین پاسخ انتخاب بکنید تا بقیه دوستان هم اگر به این مشکل خوردن بتونن رفع بکنن.
آیا مایل به ارسال نوتیفیکیشن و اخبار از طرف راکت هستید ؟