You can’t use time command in this sort of benchmark. You are including start up t times here.
time python3 nothing.py
0.011s
time php nothing.php
0.011sSimilar for the PHP version.
python3 loop.py
3.450s
time php loop.php
0.469s
So PHP is 7x faster for the longer loop.