[php] Fix long long handling on 32 bit platforms

The typemaps for long long and unsigned long long didn't handle a
string input correctly, and long_long_runme.php had a flawed test
in this case.

Fixes #2155
This commit is contained in:
Olly Betts 2022-01-22 13:09:34 +13:00
commit 87c2e7d71a
2 changed files with 7 additions and 3 deletions

View file

@ -21,7 +21,11 @@ function check_ull($ull) {
check_ll("0");
check_ll(0);
check_ll(0x7FFFFFFFFFFFFFFF);
check_ll("9223372036854775807"); // 0x7FFFFFFFFFFFFFFF
if ((int)0x100000000 !== 0) {
// This check doesn't work if PHP int is 32 bits.
check_ll(0x7FFFFFFFFFFFFFFF);
}
check_ll(-10);
$testNumber = 0;