Skip to content

PHP Fatal error: Cannot use ::class with dynamic class name in /home/magento/web/MYWEBSITE/public_html/vendor/laminas/laminas-mail/src/Message.php

When I ran the command php bin/magento s:s:d -f while upgrading Magento from 2.4.2 to 2.4.4, I get the following error.

PHP Fatal error: Cannot use ::class with dynamic class name in /home/magento/web/magento2.perfectmakeupmirrors.com/public_html/vendor/laminas/laminas-mail/src/Message.php on line 394

I picked up the command from a SO answer so I would prefer to have the commands from the Magento devdoc to do the same thing. Could you please help us?