PHP is faster than Ruby. [1]
PHP from a local script does math just fine. It's the round trip of the request to a PHP server and back that you're associating with poor language performance. In a local scripting environment PHP7 is considerably faster than Python3. [2]
PHP is an extremely popular language as the backend for SaaS, and arguably one of the oldest and most successful. [3]
[1] https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
[2] https://blog.famzah.net/2016/02/09/cpp-vs-python-vs-perl-vs-...
[3] https://insights.stackoverflow.com/survey/2020#most-popular-...