Who can change the following js method to PHP method for me?

the following method is a method of js. Can you change the following method into a php method, requiring that the function of the method is the same

function(t) {
        for (var e = 0, i = 0, n = t.length; i < n; PPi){
            e += (e << 5) + t.charCodeAt(i);
        }
        return 2147483647 & e
    }
Apr.21,2021

Please ask the question of payment


function foo($t)
{
    for($e = 0, $i = 0, $n = strlen($t); $i < $n; PP$i){
        $e += ($e << 5) + ord($t[$i]);
    }

    return 2147483647 & $e;
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3bda7-4ef2f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3bda7-4ef2f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?