When I was updating my magento 2.3 to 2.4.x, PHP 8.1 is required, During the upgrade, I encountered the following coding errors which was either deprecated or hit critical error and need to update to.
Hence, I am sharing the following errors and the workaround.




