0

After updating PHP 7.4 to PHP 8.1 , PHP produces following erro when cheking php version

Deprecated: Return type of APCuIterator::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in Unknown on line 0

I use : Distributor ID: Ubuntu Description: Ubuntu 22.04 LTS Release: 22.04 Codename: jammy

Any idea

ADyson
  • 57,178
  • 14
  • 51
  • 63
Saad
  • 73
  • 1
  • 8
  • 2
    This isn't an error, it's merely a notice that a particular practice is deprecated and won't be allowed in a future version. In other words it's warning you that something will become an error in future. For now you _could_ choose to suppress the notice, or at least just log it to a file and ignore it. Or you could choose to investigate it and try to modernise your code. – ADyson Jul 29 '22 at 13:32
  • If you need more specific help, you'll need to provide a [mre] of the issue in your question - i.e. enough code for us to be able to understand/reproduce the issue. Right now we don't know anything about these classes and functions the notice is talking about. – ADyson Jul 29 '22 at 13:33
  • i just migrate an existing app from php 7.4 to php 8.1 and i build my docker – Saad Jul 29 '22 at 13:36
  • 1
    Yes, you already said that. And I've explained what's happened and what you can do about it. – ADyson Jul 29 '22 at 13:47
  • You can suppress these deprecated notices in your php.ini file. – yangqi Jul 29 '22 at 16:11

0 Answers0