cvs: php4 /ext/gmp/tests 003.phpt

From: Date: Sun, 10 Feb 2002 23:13:37 +0000
Subject: cvs: php4 /ext/gmp/tests 003.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-9343@lists.php.net to get a copy of this message
elixer Sun Feb 10 18:13:37 2002 EDT Added files: /php4/ext/gmp/tests 003.phpt Log: Add a new test for GMP base recognition. Index: php4/ext/gmp/tests/003.phpt +++ php4/ext/gmp/tests/003.phpt --TEST-- Check for number base recognition --SKIPIF-- <?php if (!extension_loaded("gmp")) print "skip"; ?> --POST-- --GET-- --FILE-- <?php /* Binary */ $test[] = gmp_init("0b10011010010"); $test[] = gmp_init("0b10011010010", 2); $test[] = gmp_init("10011010010"); $test[] = gmp_init("10011010010", 2); /* Octal */ $test[] = gmp_init("02322"); $test[] = gmp_init("02322", 8); $test[] = gmp_init("2322"); $test[] = gmp_init("2322", 8); /* Decimal */ $test[] = gmp_init("1234"); $test[] = gmp_init("1234", 10); /* Hexidecimal */ $test[] = gmp_init("0x4d2"); $test[] = gmp_init("0x4d2", 16); $test[] = gmp_init("4d2"); $test[] = gmp_init("4d2", 16); for ($i = 0; $i < count($test); $i++) { printf("%s\n", gmp_strval($test[$i])); } ?> --EXPECT-- 1234 1234 10011010010 1234 1234 1234 2322 1234 1234 1234 1234 1234 0 1234

« previous php.cvs (#9343) next »