1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 08:58:28 +02:00
Files
archived-php-src/ext/standard/tests/strings/pack64_32.phpt
T
2021-06-29 17:13:02 +02:00

63 lines
1.4 KiB
PHP

--TEST--
64bit pack()/unpack() tests
--SKIPIF--
<?php
if (PHP_INT_SIZE > 4) {
die("skip 32bit test only");
}
?>
--FILE--
<?php
try {
var_dump(pack("Q", 0));
} catch (ValueError $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump(pack("J", 0));
} catch (ValueError $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump(pack("P", 0));
} catch (ValueError $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump(pack("q", 0));
} catch (ValueError $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump(unpack("Q", ''));
} catch (ValueError $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump(unpack("J", ''));
} catch (ValueError $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump(unpack("P", ''));
} catch (ValueError $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump(unpack("q", ''));
} catch (ValueError $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
64-bit format codes are not available for 32-bit versions of PHP
64-bit format codes are not available for 32-bit versions of PHP
64-bit format codes are not available for 32-bit versions of PHP
64-bit format codes are not available for 32-bit versions of PHP
64-bit format codes are not available for 32-bit versions of PHP
64-bit format codes are not available for 32-bit versions of PHP
64-bit format codes are not available for 32-bit versions of PHP
64-bit format codes are not available for 32-bit versions of PHP