Download src/php/php-src/ext/gmp/tests/construct.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 950 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/gmp/tests/construct.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/gmp/tests/construct.phpt
-
curl -L -o construct.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/gmp/tests/construct.phpt
950 Bytes
| --TEST-- | |
| Constructor for GMP | |
| --EXTENSIONS-- | |
| gmp | |
| --FILE-- | |
| var_dump(new GMP); | |
| var_dump(new GMP(0)); | |
| var_dump(new GMP(123)); | |
| var_dump(new GMP("0xAA")); | |
| var_dump(new GMP("12", 4)); | |
| try { | |
| var_dump(new GMP("12", 999)); | |
| } catch (ValueError $e) { | |
| echo $e->getMessage() . "\n"; | |
| } | |
| try { | |
| var_dump(new GMP("", 10)); | |
| } catch (ValueError $e) { | |
| echo $e->getMessage() . "\n"; | |
| } | |
| try { | |
| var_dump(new GMP("hello")); | |
| } catch (ValueError $e) { | |
| echo $e->getMessage() . "\n"; | |
| } | |
| --EXPECT-- | |
| object(GMP)#1 (1) { | |
| ["num"]=> | |
| string(1) "0" | |
| } | |
| object(GMP)#1 (1) { | |
| ["num"]=> | |
| string(1) "0" | |
| } | |
| object(GMP)#1 (1) { | |
| ["num"]=> | |
| string(3) "123" | |
| } | |
| object(GMP)#1 (1) { | |
| ["num"]=> | |
| string(3) "170" | |
| } | |
| object(GMP)#1 (1) { | |
| ["num"]=> | |
| string(1) "6" | |
| } | |
| GMP::__construct(): Argument #2 ($base) must be 0 or between 2 and 62 | |
| GMP::__construct(): Argument #1 ($num) is not an integer string | |
| GMP::__construct(): Argument #1 ($num) is not an integer string | |