I had this problem also. The issue was because I was running an old version of PHP (5.6) and once I upgraded to PHP 7.4 the errors went away.
This was on Amazon Linux 2 for me and the command to upgrade was:
amazon-linux-extras install php7.4
I've found that many versions of RedHat/CentOS come with PHP 5.6 by default and the easiest way I've been able to upgrade them to the latest PHP is by using remi's repo here (https://rpms.remirepo.net/)