How to fix below error.

PHP Fatal error:  During inheritance of IteratorAggregate: Uncaught Exception: Deprecated Functionality: 
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 /

1 Answer 1


enter image description here

#[\ReturnTypeWillChange] add this above the function like screenshot.

It will work

  • 1
    Thanks. It works for Magento v2.4.6. Jun 2 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.