File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
tests /
lang /
operators /
bitwiseShiftLeft_basiclong_64bit.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:48:06 2012 UTC (12 years, 6 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--TEST--
Test << operator : 64bit long tests
--SKIPIF--
<?php
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
?>
--FILE--
<?php
define("MAX_64Bit", 9223372036854775807);
define("MAX_32Bit", 2147483647);
define("MIN_64Bit", -9223372036854775807 - 1);
define("MIN_32Bit", -2147483647 - 1);
$longVals = array(
MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
);
$otherVals = array(0, 1, -1, 7, 9, 65, -44, MAX_32Bit, MAX_64Bit);
error_reporting(E_ERROR);
foreach ($longVals as $longVal) {
foreach($otherVals as $otherVal) {
echo "--- testing: $longVal << $otherVal ---\n";
var_dump($longVal<<$otherVal);
}
}
foreach ($otherVals as $otherVal) {
foreach($longVals as $longVal) {
echo "--- testing: $otherVal << $longVal ---\n";
var_dump($otherVal<<$longVal);
}
}
?>
===DONE===
--EXPECT--
--- testing: 9223372036854775807 << 0 ---
int(9223372036854775807)
--- testing: 9223372036854775807 << 1 ---
int(-2)
--- testing: 9223372036854775807 << -1 ---
int(-9223372036854775808)
--- testing: 9223372036854775807 << 7 ---
int(-128)
--- testing: 9223372036854775807 << 9 ---
int(-512)
--- testing: 9223372036854775807 << 65 ---
int(-2)
--- testing: 9223372036854775807 << -44 ---
int(-1048576)
--- testing: 9223372036854775807 << 2147483647 ---
int(-9223372036854775808)
--- testing: 9223372036854775807 << 9223372036854775807 ---
int(-9223372036854775808)
--- testing: -9223372036854775808 << 0 ---
int(-9223372036854775808)
--- testing: -9223372036854775808 << 1 ---
int(0)
--- testing: -9223372036854775808 << -1 ---
int(0)
--- testing: -9223372036854775808 << 7 ---
int(0)
--- testing: -9223372036854775808 << 9 ---
int(0)
--- testing: -9223372036854775808 << 65 ---
int(0)
--- testing: -9223372036854775808 << -44 ---
int(0)
--- testing: -9223372036854775808 << 2147483647 ---
int(0)
--- testing: -9223372036854775808 << 9223372036854775807 ---
int(0)
--- testing: 2147483647 << 0 ---
int(2147483647)
--- testing: 2147483647 << 1 ---
int(4294967294)
--- testing: 2147483647 << -1 ---
int(-9223372036854775808)
--- testing: 2147483647 << 7 ---
int(274877906816)
--- testing: 2147483647 << 9 ---
int(1099511627264)
--- testing: 2147483647 << 65 ---
int(4294967294)
--- testing: 2147483647 << -44 ---
int(2251799812636672)
--- testing: 2147483647 << 2147483647 ---
int(-9223372036854775808)
--- testing: 2147483647 << 9223372036854775807 ---
int(-9223372036854775808)
--- testing: -2147483648 << 0 ---
int(-2147483648)
--- testing: -2147483648 << 1 ---
int(-4294967296)
--- testing: -2147483648 << -1 ---
int(0)
--- testing: -2147483648 << 7 ---
int(-274877906944)
--- testing: -2147483648 << 9 ---
int(-1099511627776)
--- testing: -2147483648 << 65 ---
int(-4294967296)
--- testing: -2147483648 << -44 ---
int(-2251799813685248)
--- testing: -2147483648 << 2147483647 ---
int(0)
--- testing: -2147483648 << 9223372036854775807 ---
int(0)
--- testing: 9223372034707292160 << 0 ---
int(9223372034707292160)
--- testing: 9223372034707292160 << 1 ---
int(-4294967296)
--- testing: 9223372034707292160 << -1 ---
int(0)
--- testing: 9223372034707292160 << 7 ---
int(-274877906944)
--- testing: 9223372034707292160 << 9 ---
int(-1099511627776)
--- testing: 9223372034707292160 << 65 ---
int(-4294967296)
--- testing: 9223372034707292160 << -44 ---
int(-2251799813685248)
--- testing: 9223372034707292160 << 2147483647 ---
int(0)
--- testing: 9223372034707292160 << 9223372036854775807 ---
int(0)
--- testing: -9223372034707292160 << 0 ---
int(-9223372034707292160)
--- testing: -9223372034707292160 << 1 ---
int(4294967296)
--- testing: -9223372034707292160 << -1 ---
int(0)
--- testing: -9223372034707292160 << 7 ---
int(274877906944)
--- testing: -9223372034707292160 << 9 ---
int(1099511627776)
--- testing: -9223372034707292160 << 65 ---
int(4294967296)
--- testing: -9223372034707292160 << -44 ---
int(2251799813685248)
--- testing: -9223372034707292160 << 2147483647 ---
int(0)
--- testing: -9223372034707292160 << 9223372036854775807 ---
int(0)
--- testing: 2147483648 << 0 ---
int(2147483648)
--- testing: 2147483648 << 1 ---
int(4294967296)
--- testing: 2147483648 << -1 ---
int(0)
--- testing: 2147483648 << 7 ---
int(274877906944)
--- testing: 2147483648 << 9 ---
int(1099511627776)
--- testing: 2147483648 << 65 ---
int(4294967296)
--- testing: 2147483648 << -44 ---
int(2251799813685248)
--- testing: 2147483648 << 2147483647 ---
int(0)
--- testing: 2147483648 << 9223372036854775807 ---
int(0)
--- testing: -2147483649 << 0 ---
int(-2147483649)
--- testing: -2147483649 << 1 ---
int(-4294967298)
--- testing: -2147483649 << -1 ---
int(-9223372036854775808)
--- testing: -2147483649 << 7 ---
int(-274877907072)
--- testing: -2147483649 << 9 ---
int(-1099511628288)
--- testing: -2147483649 << 65 ---
int(-4294967298)
--- testing: -2147483649 << -44 ---
int(-2251799814733824)
--- testing: -2147483649 << 2147483647 ---
int(-9223372036854775808)
--- testing: -2147483649 << 9223372036854775807 ---
int(-9223372036854775808)
--- testing: 4294967294 << 0 ---
int(4294967294)
--- testing: 4294967294 << 1 ---
int(8589934588)
--- testing: 4294967294 << -1 ---
int(0)
--- testing: 4294967294 << 7 ---
int(549755813632)
--- testing: 4294967294 << 9 ---
int(2199023254528)
--- testing: 4294967294 << 65 ---
int(8589934588)
--- testing: 4294967294 << -44 ---
int(4503599625273344)
--- testing: 4294967294 << 2147483647 ---
int(0)
--- testing: 4294967294 << 9223372036854775807 ---
int(0)
--- testing: 4294967295 << 0 ---
int(4294967295)
--- testing: 4294967295 << 1 ---
int(8589934590)
--- testing: 4294967295 << -1 ---
int(-9223372036854775808)
--- testing: 4294967295 << 7 ---
int(549755813760)
--- testing: 4294967295 << 9 ---
int(2199023255040)
--- testing: 4294967295 << 65 ---
int(8589934590)
--- testing: 4294967295 << -44 ---
int(4503599626321920)
--- testing: 4294967295 << 2147483647 ---
int(-9223372036854775808)
--- testing: 4294967295 << 9223372036854775807 ---
int(-9223372036854775808)
--- testing: 4294967293 << 0 ---
int(4294967293)
--- testing: 4294967293 << 1 ---
int(8589934586)
--- testing: 4294967293 << -1 ---
int(-9223372036854775808)
--- testing: 4294967293 << 7 ---
int(549755813504)
--- testing: 4294967293 << 9 ---
int(2199023254016)
--- testing: 4294967293 << 65 ---
int(8589934586)
--- testing: 4294967293 << -44 ---
int(4503599624224768)
--- testing: 4294967293 << 2147483647 ---
int(-9223372036854775808)
--- testing: 4294967293 << 9223372036854775807 ---
int(-9223372036854775808)
--- testing: 9223372036854775806 << 0 ---
int(9223372036854775806)
--- testing: 9223372036854775806 << 1 ---
int(-4)
--- testing: 9223372036854775806 << -1 ---
int(0)
--- testing: 9223372036854775806 << 7 ---
int(-256)
--- testing: 9223372036854775806 << 9 ---
int(-1024)
--- testing: 9223372036854775806 << 65 ---
int(-4)
--- testing: 9223372036854775806 << -44 ---
int(-2097152)
--- testing: 9223372036854775806 << 2147483647 ---
int(0)
--- testing: 9223372036854775806 << 9223372036854775807 ---
int(0)
--- testing: 9.2233720368548E+18 << 0 ---
int(-9223372036854775808)
--- testing: 9.2233720368548E+18 << 1 ---
int(0)
--- testing: 9.2233720368548E+18 << -1 ---
int(0)
--- testing: 9.2233720368548E+18 << 7 ---
int(0)
--- testing: 9.2233720368548E+18 << 9 ---
int(0)
--- testing: 9.2233720368548E+18 << 65 ---
int(0)
--- testing: 9.2233720368548E+18 << -44 ---
int(0)
--- testing: 9.2233720368548E+18 << 2147483647 ---
int(0)
--- testing: 9.2233720368548E+18 << 9223372036854775807 ---
int(0)
--- testing: -9223372036854775807 << 0 ---
int(-9223372036854775807)
--- testing: -9223372036854775807 << 1 ---
int(2)
--- testing: -9223372036854775807 << -1 ---
int(-9223372036854775808)
--- testing: -9223372036854775807 << 7 ---
int(128)
--- testing: -9223372036854775807 << 9 ---
int(512)
--- testing: -9223372036854775807 << 65 ---
int(2)
--- testing: -9223372036854775807 << -44 ---
int(1048576)
--- testing: -9223372036854775807 << 2147483647 ---
int(-9223372036854775808)
--- testing: -9223372036854775807 << 9223372036854775807 ---
int(-9223372036854775808)
--- testing: -9.2233720368548E+18 << 0 ---
int(-9223372036854775808)
--- testing: -9.2233720368548E+18 << 1 ---
int(0)
--- testing: -9.2233720368548E+18 << -1 ---
int(0)
--- testing: -9.2233720368548E+18 << 7 ---
int(0)
--- testing: -9.2233720368548E+18 << 9 ---
int(0)
--- testing: -9.2233720368548E+18 << 65 ---
int(0)
--- testing: -9.2233720368548E+18 << -44 ---
int(0)
--- testing: -9.2233720368548E+18 << 2147483647 ---
int(0)
--- testing: -9.2233720368548E+18 << 9223372036854775807 ---
int(0)
--- testing: 0 << 9223372036854775807 ---
int(0)
--- testing: 0 << -9223372036854775808 ---
int(0)
--- testing: 0 << 2147483647 ---
int(0)
--- testing: 0 << -2147483648 ---
int(0)
--- testing: 0 << 9223372034707292160 ---
int(0)
--- testing: 0 << -9223372034707292160 ---
int(0)
--- testing: 0 << 2147483648 ---
int(0)
--- testing: 0 << -2147483649 ---
int(0)
--- testing: 0 << 4294967294 ---
int(0)
--- testing: 0 << 4294967295 ---
int(0)
--- testing: 0 << 4294967293 ---
int(0)
--- testing: 0 << 9223372036854775806 ---
int(0)
--- testing: 0 << 9.2233720368548E+18 ---
int(0)
--- testing: 0 << -9223372036854775807 ---
int(0)
--- testing: 0 << -9.2233720368548E+18 ---
int(0)
--- testing: 1 << 9223372036854775807 ---
int(-9223372036854775808)
--- testing: 1 << -9223372036854775808 ---
int(1)
--- testing: 1 << 2147483647 ---
int(-9223372036854775808)
--- testing: 1 << -2147483648 ---
int(1)
--- testing: 1 << 9223372034707292160 ---
int(1)
--- testing: 1 << -9223372034707292160 ---
int(1)
--- testing: 1 << 2147483648 ---
int(1)
--- testing: 1 << -2147483649 ---
int(-9223372036854775808)
--- testing: 1 << 4294967294 ---
int(4611686018427387904)
--- testing: 1 << 4294967295 ---
int(-9223372036854775808)
--- testing: 1 << 4294967293 ---
int(2305843009213693952)
--- testing: 1 << 9223372036854775806 ---
int(4611686018427387904)
--- testing: 1 << 9.2233720368548E+18 ---
int(1)
--- testing: 1 << -9223372036854775807 ---
int(2)
--- testing: 1 << -9.2233720368548E+18 ---
int(1)
--- testing: -1 << 9223372036854775807 ---
int(-9223372036854775808)
--- testing: -1 << -9223372036854775808 ---
int(-1)
--- testing: -1 << 2147483647 ---
int(-9223372036854775808)
--- testing: -1 << -2147483648 ---
int(-1)
--- testing: -1 << 9223372034707292160 ---
int(-1)
--- testing: -1 << -9223372034707292160 ---
int(-1)
--- testing: -1 << 2147483648 ---
int(-1)
--- testing: -1 << -2147483649 ---
int(-9223372036854775808)
--- testing: -1 << 4294967294 ---
int(-4611686018427387904)
--- testing: -1 << 4294967295 ---
int(-9223372036854775808)
--- testing: -1 << 4294967293 ---
int(-2305843009213693952)
--- testing: -1 << 9223372036854775806 ---
int(-4611686018427387904)
--- testing: -1 << 9.2233720368548E+18 ---
int(-1)
--- testing: -1 << -9223372036854775807 ---
int(-2)
--- testing: -1 << -9.2233720368548E+18 ---
int(-1)
--- testing: 7 << 9223372036854775807 ---
int(-9223372036854775808)
--- testing: 7 << -9223372036854775808 ---
int(7)
--- testing: 7 << 2147483647 ---
int(-9223372036854775808)
--- testing: 7 << -2147483648 ---
int(7)
--- testing: 7 << 9223372034707292160 ---
int(7)
--- testing: 7 << -9223372034707292160 ---
int(7)
--- testing: 7 << 2147483648 ---
int(7)
--- testing: 7 << -2147483649 ---
int(-9223372036854775808)
--- testing: 7 << 4294967294 ---
int(-4611686018427387904)
--- testing: 7 << 4294967295 ---
int(-9223372036854775808)
--- testing: 7 << 4294967293 ---
int(-2305843009213693952)
--- testing: 7 << 9223372036854775806 ---
int(-4611686018427387904)
--- testing: 7 << 9.2233720368548E+18 ---
int(7)
--- testing: 7 << -9223372036854775807 ---
int(14)
--- testing: 7 << -9.2233720368548E+18 ---
int(7)
--- testing: 9 << 9223372036854775807 ---
int(-9223372036854775808)
--- testing: 9 << -9223372036854775808 ---
int(9)
--- testing: 9 << 2147483647 ---
int(-9223372036854775808)
--- testing: 9 << -2147483648 ---
int(9)
--- testing: 9 << 9223372034707292160 ---
int(9)
--- testing: 9 << -9223372034707292160 ---
int(9)
--- testing: 9 << 2147483648 ---
int(9)
--- testing: 9 << -2147483649 ---
int(-9223372036854775808)
--- testing: 9 << 4294967294 ---
int(4611686018427387904)
--- testing: 9 << 4294967295 ---
int(-9223372036854775808)
--- testing: 9 << 4294967293 ---
int(2305843009213693952)
--- testing: 9 << 9223372036854775806 ---
int(4611686018427387904)
--- testing: 9 << 9.2233720368548E+18 ---
int(9)
--- testing: 9 << -9223372036854775807 ---
int(18)
--- testing: 9 << -9.2233720368548E+18 ---
int(9)
--- testing: 65 << 9223372036854775807 ---
int(-9223372036854775808)
--- testing: 65 << -9223372036854775808 ---
int(65)
--- testing: 65 << 2147483647 ---
int(-9223372036854775808)
--- testing: 65 << -2147483648 ---
int(65)
--- testing: 65 << 9223372034707292160 ---
int(65)
--- testing: 65 << -9223372034707292160 ---
int(65)
--- testing: 65 << 2147483648 ---
int(65)
--- testing: 65 << -2147483649 ---
int(-9223372036854775808)
--- testing: 65 << 4294967294 ---
int(4611686018427387904)
--- testing: 65 << 4294967295 ---
int(-9223372036854775808)
--- testing: 65 << 4294967293 ---
int(2305843009213693952)
--- testing: 65 << 9223372036854775806 ---
int(4611686018427387904)
--- testing: 65 << 9.2233720368548E+18 ---
int(65)
--- testing: 65 << -9223372036854775807 ---
int(130)
--- testing: 65 << -9.2233720368548E+18 ---
int(65)
--- testing: -44 << 9223372036854775807 ---
int(0)
--- testing: -44 << -9223372036854775808 ---
int(-44)
--- testing: -44 << 2147483647 ---
int(0)
--- testing: -44 << -2147483648 ---
int(-44)
--- testing: -44 << 9223372034707292160 ---
int(-44)
--- testing: -44 << -9223372034707292160 ---
int(-44)
--- testing: -44 << 2147483648 ---
int(-44)
--- testing: -44 << -2147483649 ---
int(0)
--- testing: -44 << 4294967294 ---
int(0)
--- testing: -44 << 4294967295 ---
int(0)
--- testing: -44 << 4294967293 ---
int(-9223372036854775808)
--- testing: -44 << 9223372036854775806 ---
int(0)
--- testing: -44 << 9.2233720368548E+18 ---
int(-44)
--- testing: -44 << -9223372036854775807 ---
int(-88)
--- testing: -44 << -9.2233720368548E+18 ---
int(-44)
--- testing: 2147483647 << 9223372036854775807 ---
int(-9223372036854775808)
--- testing: 2147483647 << -9223372036854775808 ---
int(2147483647)
--- testing: 2147483647 << 2147483647 ---
int(-9223372036854775808)
--- testing: 2147483647 << -2147483648 ---
int(2147483647)
--- testing: 2147483647 << 9223372034707292160 ---
int(2147483647)
--- testing: 2147483647 << -9223372034707292160 ---
int(2147483647)
--- testing: 2147483647 << 2147483648 ---
int(2147483647)
--- testing: 2147483647 << -2147483649 ---
int(-9223372036854775808)
--- testing: 2147483647 << 4294967294 ---
int(-4611686018427387904)
--- testing: 2147483647 << 4294967295 ---
int(-9223372036854775808)
--- testing: 2147483647 << 4294967293 ---
int(-2305843009213693952)
--- testing: 2147483647 << 9223372036854775806 ---
int(-4611686018427387904)
--- testing: 2147483647 << 9.2233720368548E+18 ---
int(2147483647)
--- testing: 2147483647 << -9223372036854775807 ---
int(4294967294)
--- testing: 2147483647 << -9.2233720368548E+18 ---
int(2147483647)
--- testing: 9223372036854775807 << 9223372036854775807 ---
int(-9223372036854775808)
--- testing: 9223372036854775807 << -9223372036854775808 ---
int(9223372036854775807)
--- testing: 9223372036854775807 << 2147483647 ---
int(-9223372036854775808)
--- testing: 9223372036854775807 << -2147483648 ---
int(9223372036854775807)
--- testing: 9223372036854775807 << 9223372034707292160 ---
int(9223372036854775807)
--- testing: 9223372036854775807 << -9223372034707292160 ---
int(9223372036854775807)
--- testing: 9223372036854775807 << 2147483648 ---
int(9223372036854775807)
--- testing: 9223372036854775807 << -2147483649 ---
int(-9223372036854775808)
--- testing: 9223372036854775807 << 4294967294 ---
int(-4611686018427387904)
--- testing: 9223372036854775807 << 4294967295 ---
int(-9223372036854775808)
--- testing: 9223372036854775807 << 4294967293 ---
int(-2305843009213693952)
--- testing: 9223372036854775807 << 9223372036854775806 ---
int(-4611686018427387904)
--- testing: 9223372036854775807 << 9.2233720368548E+18 ---
int(9223372036854775807)
--- testing: 9223372036854775807 << -9223372036854775807 ---
int(-2)
--- testing: 9223372036854775807 << -9.2233720368548E+18 ---
int(9223372036854775807)
===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>