86446
以下の環境でPHPを8.0.14->8.1.2に変更しました。  
その後composer dump-autoloadを実施したところ、以下の非推奨が表示されました。  
これらの表示はどのように対応すればよろしいのでしょうか。  
フレームワークで問題が発生しているようなので、フレームワークが解決するまで  
PHP8.1は使用しない方がよいのでしょうか。

【変更前の環境】  
・Windows11  
・PHP8.0.14  
・Laravel9.0.2

【変更後の環境】  
・Windows11  
・PHP8.1.2  
・Laravel9.0.2

【composer dump-autoloadの結果】

```

    C:\work\base_Apri>composer dump-autoload
    PHP Deprecated:  Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Helper/HelperSet.php on line 112
    Deprecated: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Helper/HelperSet.php on line 112
    Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48
    Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Repository/ArrayRepository.php:277
    Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Repository/ArrayRepository.php:277
    Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Repository/ArrayRepository.php:277
    Deprecation Notice: 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 phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/finder/Finder.php:675
    Deprecation Notice: 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 phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/finder/Finder.php:732
    Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\FilterIterator::rewind() should either be compatible with FilterIterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/finder/Iterator/FilterIterator.php:30Deprecation Notice: 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 phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php:42
    Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::getChildren() should either be compatible with RecursiveDirectoryIterator::getChildren(): RecursiveDirectoryIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php:85
    Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::rewind() should either be compatible with FilesystemIterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php:113
    Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::current() should either be compatible with FilesystemIterator::current(): SplFileInfo|FilesystemIterator|string, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php:65
    Deprecation Notice: 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 phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php:55
    Deprecation Notice: 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 phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php:71
    Deprecation Notice: 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 phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php:76
    Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\FilterIterator::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/finder/Iterator/FilterIterator.php:30
    Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\DateRangeFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php:41
    Deprecation Notice: 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 phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/finder/Iterator/PathFilterIterator.php:27
    Generating optimized autoload files
    Deprecation Notice: 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 phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/finder/Iterator/FilenameFilterIterator.php:28
    Deprecation Notice: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Autoload/ClassMapGenerator.php:251
    > Illuminate\Foundation\ComposerScripts::postAutoloadDump
    > @php artisan package:discover --ansi
    Discovered Package: barryvdh/laravel-ide-helper
    Discovered Package: fruitcake/laravel-cors
    Discovered Package: kreait/laravel-firebase
    Discovered Package: laravel/sail
    Discovered Package: laravel/tinker
    Discovered Package: laravel/ui
    Discovered Package: maatwebsite/excel
    Discovered Package: nesbot/carbon
    Discovered Package: nunomaduro/collision
    Discovered Package: spatie/laravel-ignition
    Discovered Package: yajra/laravel-oci8
    Package manifest generated successfully.
    Generated optimized autoload files containing 7033 classes
    
    
```

よろしくお願いいたします。
CC BY-SA 4.0
2022-02-13T13:33:02.623
86319
2022-02-19T00:57:35.690
37340
question
php laravel
PHP8.1を使用して発生するcomposer dump-autoloadのエラーについて
composerを再インストールしたところ、問題が解決しました。
CC BY-SA 4.0
2022-02-19T00:57:35.690
86446
2022-02-19T00:57:35.690
37340
86319
answer