Download src/php/php-src/ext/gmp/tests/bug32773.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 611 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/gmp/tests/bug32773.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/gmp/tests/bug32773.phpt
-
curl -L -o bug32773.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/gmp/tests/bug32773.phpt
611 Bytes
| --TEST-- | |
| Bug #32773 (binary GMP functions returns unexpected value, when second parameter is int(0)) | |
| --EXTENSIONS-- | |
| gmp | |
| --FILE-- | |
| echo '10 + 0 = ', gmp_strval(gmp_add(10, 0)), "\n"; | |
| echo '10 + "0" = ', gmp_strval(gmp_add(10, '0')), "\n"; | |
| try { | |
| var_dump(gmp_div(10, 0)); | |
| } catch (\DivisionByZeroError $e) { | |
| echo $e->getMessage() . \PHP_EOL; | |
| } | |
| try { | |
| var_dump(gmp_div_qr(10, 0)); | |
| } catch (\DivisionByZeroError $e) { | |
| echo $e->getMessage() . \PHP_EOL; | |
| } | |
| --EXPECT-- | |
| 10 + 0 = 10 | |
| 10 + "0" = 10 | |
| gmp_div(): Argument #2 ($num2) Division by zero | |
| gmp_div_qr(): Argument #2 ($num2) Division by zero | |