I'm getting following error while compiling magento 2.4.5 which is newly upgraded from Magento 2.4.3
Deprecated Functionality: Zend_Http_UserAgent implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/html/wff/vendor/magento/zendframework1/library/Zend/Http/
UserAgent.php on line 37
report.ERROR: Deprecated Functionality: Zend_Http_UserAgent implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/html/wff/vendor/magento/zendframework1/library/Zend/Http/UserAgent.php on line 37
#0 /var/www/html/wff/vendor/magento/zendframework1/library/Zend/Http/UserAgent.php(37): Magento\Framework\App\ErrorHandler->handler()
#1 /var/www/html/wff/vendor/composer/ClassLoader.php(480): include('...')
#2 /var/www/html/wff/vendor/composer/ClassLoader.php(346): Composer\Autoload\includeFile()
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#4 /var/www/html/wff/vendor/magento/framework/GetParameterClassTrait.php(34): ReflectionClass->__construct()
#5 /var/www/html/wff/vendor/magento/framework/Code/Reader/ClassReader.php(42): Magento\Framework\Code\Reader\ClassReader->getParameterClass()
#6 /var/www/html/wff/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassReaderDecorator.php(35): Magento\Framework\Code\Reader\ClassReader->getConstructor()
#7 /var/www/html/wff/setup/src/Magento/Setup/Module/Di/Code/Reader/Decorator/Area.php(53): Magento\Setup\Module\Di\Code\Reader\ClassReaderDecorator->getConstructor()
#8 /var/www/html/wff/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php(116): Magento\Setup\Module\Di\Code\Reader\Decorator\Area->getList()
#9 /var/www/html/wff/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php(87): Magento\Setup\Module\Di\App\Task\Operation\Area->getDefinitionsCollection()
#10 /var/www/html/wff/setup/src/Magento/Setup/Module/Di/App/Task/Manager.php(56): Magento\Setup\Module\Di\App\Task\Operation\Area->doOperation()
#11 /var/www/html/wff/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php(216): Magento\Setup\Module\Di\App\Task\Manager->process()
#12 /var/www/html/wff/vendor/symfony/console/Command/Command.php(255): Magento\Setup\Console\Command\DiCompileCommand->execute()
#13 /var/www/html/wff/vendor/symfony/console/Application.php(1021): Symfony\Component\Console\Command\Command->run()
#14 /var/www/html/wff/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand()
#15 /var/www/html/wff/vendor/magento/framework/Console/Cli.php(116): Symfony\Component\Console\Application->doRun()
#16 /var/www/html/wff/vendor/symfony/console/Application.php(149): Magento\Framework\Console\Cli->doRun()
#17 /var/www/html/wff/bin/magento(23): Symfony\Component\Console\Application->run()
#18 {main} [] []
Can any one help me how to fix this php version 8.1