parent
2b9417d78f
commit
765eb75869
68 changed files with 12934 additions and 8 deletions
@ -0,0 +1,12 @@ |
|||||||
|
#!/usr/bin/env php |
||||||
|
<?php |
||||||
|
if ($argc < 2) { |
||||||
|
echo "Usage: php opcode.php <file>\n"; |
||||||
|
exit(1); |
||||||
|
} |
||||||
|
$file = $argv[1]; |
||||||
|
if (!file_exists($file)) { |
||||||
|
echo "File not found: " . $file . "\n"; |
||||||
|
exit(1); |
||||||
|
} |
||||||
|
shell_exec("php -d opcache.enable_cli=On -d opcache.opt_debug_level=0x10000 " . $file); |
||||||
@ -0,0 +1,580 @@ |
|||||||
|
--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.0, MIN_64Bit + 1, MIN_64Bit - 1.0, |
||||||
|
); |
||||||
|
|
||||||
|
$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); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: 9223372036854775807 + 0 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 + 1 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9223372036854775807 + -1 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 9223372036854775807 + 7 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9223372036854775807 + 9 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9223372036854775807 + 65 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9223372036854775807 + -44 --- |
||||||
|
int(9223372036854775763) |
||||||
|
--- testing: 9223372036854775807 + 2147483647 --- |
||||||
|
float(9.22337203900226E+18) |
||||||
|
--- testing: 9223372036854775807 + 9223372036854775807 --- |
||||||
|
float(1.8446744073709552E+19) |
||||||
|
--- testing: -9223372036854775808 + 0 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9223372036854775808 + 1 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -9223372036854775808 + -1 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775808 + 7 --- |
||||||
|
int(-9223372036854775801) |
||||||
|
--- testing: -9223372036854775808 + 9 --- |
||||||
|
int(-9223372036854775799) |
||||||
|
--- testing: -9223372036854775808 + 65 --- |
||||||
|
int(-9223372036854775743) |
||||||
|
--- testing: -9223372036854775808 + -44 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775808 + 2147483647 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: -9223372036854775808 + 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 2147483647 + 0 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 + 1 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 2147483647 + -1 --- |
||||||
|
int(2147483646) |
||||||
|
--- testing: 2147483647 + 7 --- |
||||||
|
int(2147483654) |
||||||
|
--- testing: 2147483647 + 9 --- |
||||||
|
int(2147483656) |
||||||
|
--- testing: 2147483647 + 65 --- |
||||||
|
int(2147483712) |
||||||
|
--- testing: 2147483647 + -44 --- |
||||||
|
int(2147483603) |
||||||
|
--- testing: 2147483647 + 2147483647 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 2147483647 + 9223372036854775807 --- |
||||||
|
float(9.22337203900226E+18) |
||||||
|
--- testing: -2147483648 + 0 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -2147483648 + 1 --- |
||||||
|
int(-2147483647) |
||||||
|
--- testing: -2147483648 + -1 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -2147483648 + 7 --- |
||||||
|
int(-2147483641) |
||||||
|
--- testing: -2147483648 + 9 --- |
||||||
|
int(-2147483639) |
||||||
|
--- testing: -2147483648 + 65 --- |
||||||
|
int(-2147483583) |
||||||
|
--- testing: -2147483648 + -44 --- |
||||||
|
int(-2147483692) |
||||||
|
--- testing: -2147483648 + 2147483647 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -2147483648 + 9223372036854775807 --- |
||||||
|
int(9223372034707292159) |
||||||
|
--- testing: 9223372034707292160 + 0 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 9223372034707292160 + 1 --- |
||||||
|
int(9223372034707292161) |
||||||
|
--- testing: 9223372034707292160 + -1 --- |
||||||
|
int(9223372034707292159) |
||||||
|
--- testing: 9223372034707292160 + 7 --- |
||||||
|
int(9223372034707292167) |
||||||
|
--- testing: 9223372034707292160 + 9 --- |
||||||
|
int(9223372034707292169) |
||||||
|
--- testing: 9223372034707292160 + 65 --- |
||||||
|
int(9223372034707292225) |
||||||
|
--- testing: 9223372034707292160 + -44 --- |
||||||
|
int(9223372034707292116) |
||||||
|
--- testing: 9223372034707292160 + 2147483647 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372034707292160 + 9223372036854775807 --- |
||||||
|
float(1.8446744071562068E+19) |
||||||
|
--- testing: -9223372034707292160 + 0 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: -9223372034707292160 + 1 --- |
||||||
|
int(-9223372034707292159) |
||||||
|
--- testing: -9223372034707292160 + -1 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: -9223372034707292160 + 7 --- |
||||||
|
int(-9223372034707292153) |
||||||
|
--- testing: -9223372034707292160 + 9 --- |
||||||
|
int(-9223372034707292151) |
||||||
|
--- testing: -9223372034707292160 + 65 --- |
||||||
|
int(-9223372034707292095) |
||||||
|
--- testing: -9223372034707292160 + -44 --- |
||||||
|
int(-9223372034707292204) |
||||||
|
--- testing: -9223372034707292160 + 2147483647 --- |
||||||
|
int(-9223372032559808513) |
||||||
|
--- testing: -9223372034707292160 + 9223372036854775807 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483648 + 0 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 2147483648 + 1 --- |
||||||
|
int(2147483649) |
||||||
|
--- testing: 2147483648 + -1 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483648 + 7 --- |
||||||
|
int(2147483655) |
||||||
|
--- testing: 2147483648 + 9 --- |
||||||
|
int(2147483657) |
||||||
|
--- testing: 2147483648 + 65 --- |
||||||
|
int(2147483713) |
||||||
|
--- testing: 2147483648 + -44 --- |
||||||
|
int(2147483604) |
||||||
|
--- testing: 2147483648 + 2147483647 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 2147483648 + 9223372036854775807 --- |
||||||
|
float(9.22337203900226E+18) |
||||||
|
--- testing: -2147483649 + 0 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -2147483649 + 1 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -2147483649 + -1 --- |
||||||
|
int(-2147483650) |
||||||
|
--- testing: -2147483649 + 7 --- |
||||||
|
int(-2147483642) |
||||||
|
--- testing: -2147483649 + 9 --- |
||||||
|
int(-2147483640) |
||||||
|
--- testing: -2147483649 + 65 --- |
||||||
|
int(-2147483584) |
||||||
|
--- testing: -2147483649 + -44 --- |
||||||
|
int(-2147483693) |
||||||
|
--- testing: -2147483649 + 2147483647 --- |
||||||
|
int(-2) |
||||||
|
--- testing: -2147483649 + 9223372036854775807 --- |
||||||
|
int(9223372034707292158) |
||||||
|
--- testing: 4294967294 + 0 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 4294967294 + 1 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967294 + -1 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 4294967294 + 7 --- |
||||||
|
int(4294967301) |
||||||
|
--- testing: 4294967294 + 9 --- |
||||||
|
int(4294967303) |
||||||
|
--- testing: 4294967294 + 65 --- |
||||||
|
int(4294967359) |
||||||
|
--- testing: 4294967294 + -44 --- |
||||||
|
int(4294967250) |
||||||
|
--- testing: 4294967294 + 2147483647 --- |
||||||
|
int(6442450941) |
||||||
|
--- testing: 4294967294 + 9223372036854775807 --- |
||||||
|
float(9.223372041149743E+18) |
||||||
|
--- testing: 4294967295 + 0 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967295 + 1 --- |
||||||
|
int(4294967296) |
||||||
|
--- testing: 4294967295 + -1 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 4294967295 + 7 --- |
||||||
|
int(4294967302) |
||||||
|
--- testing: 4294967295 + 9 --- |
||||||
|
int(4294967304) |
||||||
|
--- testing: 4294967295 + 65 --- |
||||||
|
int(4294967360) |
||||||
|
--- testing: 4294967295 + -44 --- |
||||||
|
int(4294967251) |
||||||
|
--- testing: 4294967295 + 2147483647 --- |
||||||
|
int(6442450942) |
||||||
|
--- testing: 4294967295 + 9223372036854775807 --- |
||||||
|
float(9.223372041149743E+18) |
||||||
|
--- testing: 4294967293 + 0 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 4294967293 + 1 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 4294967293 + -1 --- |
||||||
|
int(4294967292) |
||||||
|
--- testing: 4294967293 + 7 --- |
||||||
|
int(4294967300) |
||||||
|
--- testing: 4294967293 + 9 --- |
||||||
|
int(4294967302) |
||||||
|
--- testing: 4294967293 + 65 --- |
||||||
|
int(4294967358) |
||||||
|
--- testing: 4294967293 + -44 --- |
||||||
|
int(4294967249) |
||||||
|
--- testing: 4294967293 + 2147483647 --- |
||||||
|
int(6442450940) |
||||||
|
--- testing: 4294967293 + 9223372036854775807 --- |
||||||
|
float(9.223372041149743E+18) |
||||||
|
--- testing: 9223372036854775806 + 0 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 9223372036854775806 + 1 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775806 + -1 --- |
||||||
|
int(9223372036854775805) |
||||||
|
--- testing: 9223372036854775806 + 7 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9223372036854775806 + 9 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9223372036854775806 + 65 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9223372036854775806 + -44 --- |
||||||
|
int(9223372036854775762) |
||||||
|
--- testing: 9223372036854775806 + 2147483647 --- |
||||||
|
float(9.22337203900226E+18) |
||||||
|
--- testing: 9223372036854775806 + 9223372036854775807 --- |
||||||
|
float(1.8446744073709552E+19) |
||||||
|
--- testing: 9.2233720368548E+18 + 0 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9.2233720368548E+18 + 1 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9.2233720368548E+18 + -1 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9.2233720368548E+18 + 7 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9.2233720368548E+18 + 9 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9.2233720368548E+18 + 65 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9.2233720368548E+18 + -44 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9.2233720368548E+18 + 2147483647 --- |
||||||
|
float(9.22337203900226E+18) |
||||||
|
--- testing: 9.2233720368548E+18 + 9223372036854775807 --- |
||||||
|
float(1.8446744073709552E+19) |
||||||
|
--- testing: -9223372036854775807 + 0 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -9223372036854775807 + 1 --- |
||||||
|
int(-9223372036854775806) |
||||||
|
--- testing: -9223372036854775807 + -1 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9223372036854775807 + 7 --- |
||||||
|
int(-9223372036854775800) |
||||||
|
--- testing: -9223372036854775807 + 9 --- |
||||||
|
int(-9223372036854775798) |
||||||
|
--- testing: -9223372036854775807 + 65 --- |
||||||
|
int(-9223372036854775742) |
||||||
|
--- testing: -9223372036854775807 + -44 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775807 + 2147483647 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: -9223372036854775807 + 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9.2233720368548E+18 + 0 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9.2233720368548E+18 + 1 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9.2233720368548E+18 + -1 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9.2233720368548E+18 + 7 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9.2233720368548E+18 + 9 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9.2233720368548E+18 + 65 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9.2233720368548E+18 + -44 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9.2233720368548E+18 + 2147483647 --- |
||||||
|
float(-9.223372034707292E+18) |
||||||
|
--- testing: -9.2233720368548E+18 + 9223372036854775807 --- |
||||||
|
float(0) |
||||||
|
--- testing: 0 + 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 0 + -9223372036854775808 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: 0 + 2147483647 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 0 + -2147483648 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: 0 + 9223372034707292160 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 0 + -9223372034707292160 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: 0 + 2147483648 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 0 + -2147483649 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: 0 + 4294967294 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 0 + 4294967295 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 0 + 4294967293 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 0 + 9223372036854775806 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 0 + 9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 0 + -9223372036854775807 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 0 + -9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: 1 + 9223372036854775807 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 1 + -9223372036854775808 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 1 + 2147483647 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 1 + -2147483648 --- |
||||||
|
int(-2147483647) |
||||||
|
--- testing: 1 + 9223372034707292160 --- |
||||||
|
int(9223372034707292161) |
||||||
|
--- testing: 1 + -9223372034707292160 --- |
||||||
|
int(-9223372034707292159) |
||||||
|
--- testing: 1 + 2147483648 --- |
||||||
|
int(2147483649) |
||||||
|
--- testing: 1 + -2147483649 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: 1 + 4294967294 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 1 + 4294967295 --- |
||||||
|
int(4294967296) |
||||||
|
--- testing: 1 + 4294967293 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 1 + 9223372036854775806 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 1 + 9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 1 + -9223372036854775807 --- |
||||||
|
int(-9223372036854775806) |
||||||
|
--- testing: 1 + -9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -1 + 9223372036854775807 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: -1 + -9223372036854775808 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -1 + 2147483647 --- |
||||||
|
int(2147483646) |
||||||
|
--- testing: -1 + -2147483648 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -1 + 9223372034707292160 --- |
||||||
|
int(9223372034707292159) |
||||||
|
--- testing: -1 + -9223372034707292160 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: -1 + 2147483648 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: -1 + -2147483649 --- |
||||||
|
int(-2147483650) |
||||||
|
--- testing: -1 + 4294967294 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: -1 + 4294967295 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: -1 + 4294967293 --- |
||||||
|
int(4294967292) |
||||||
|
--- testing: -1 + 9223372036854775806 --- |
||||||
|
int(9223372036854775805) |
||||||
|
--- testing: -1 + 9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: -1 + -9223372036854775807 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -1 + -9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: 7 + 9223372036854775807 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 7 + -9223372036854775808 --- |
||||||
|
int(-9223372036854775801) |
||||||
|
--- testing: 7 + 2147483647 --- |
||||||
|
int(2147483654) |
||||||
|
--- testing: 7 + -2147483648 --- |
||||||
|
int(-2147483641) |
||||||
|
--- testing: 7 + 9223372034707292160 --- |
||||||
|
int(9223372034707292167) |
||||||
|
--- testing: 7 + -9223372034707292160 --- |
||||||
|
int(-9223372034707292153) |
||||||
|
--- testing: 7 + 2147483648 --- |
||||||
|
int(2147483655) |
||||||
|
--- testing: 7 + -2147483649 --- |
||||||
|
int(-2147483642) |
||||||
|
--- testing: 7 + 4294967294 --- |
||||||
|
int(4294967301) |
||||||
|
--- testing: 7 + 4294967295 --- |
||||||
|
int(4294967302) |
||||||
|
--- testing: 7 + 4294967293 --- |
||||||
|
int(4294967300) |
||||||
|
--- testing: 7 + 9223372036854775806 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 7 + 9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 7 + -9223372036854775807 --- |
||||||
|
int(-9223372036854775800) |
||||||
|
--- testing: 7 + -9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: 9 + 9223372036854775807 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9 + -9223372036854775808 --- |
||||||
|
int(-9223372036854775799) |
||||||
|
--- testing: 9 + 2147483647 --- |
||||||
|
int(2147483656) |
||||||
|
--- testing: 9 + -2147483648 --- |
||||||
|
int(-2147483639) |
||||||
|
--- testing: 9 + 9223372034707292160 --- |
||||||
|
int(9223372034707292169) |
||||||
|
--- testing: 9 + -9223372034707292160 --- |
||||||
|
int(-9223372034707292151) |
||||||
|
--- testing: 9 + 2147483648 --- |
||||||
|
int(2147483657) |
||||||
|
--- testing: 9 + -2147483649 --- |
||||||
|
int(-2147483640) |
||||||
|
--- testing: 9 + 4294967294 --- |
||||||
|
int(4294967303) |
||||||
|
--- testing: 9 + 4294967295 --- |
||||||
|
int(4294967304) |
||||||
|
--- testing: 9 + 4294967293 --- |
||||||
|
int(4294967302) |
||||||
|
--- testing: 9 + 9223372036854775806 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9 + 9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9 + -9223372036854775807 --- |
||||||
|
int(-9223372036854775798) |
||||||
|
--- testing: 9 + -9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: 65 + 9223372036854775807 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 65 + -9223372036854775808 --- |
||||||
|
int(-9223372036854775743) |
||||||
|
--- testing: 65 + 2147483647 --- |
||||||
|
int(2147483712) |
||||||
|
--- testing: 65 + -2147483648 --- |
||||||
|
int(-2147483583) |
||||||
|
--- testing: 65 + 9223372034707292160 --- |
||||||
|
int(9223372034707292225) |
||||||
|
--- testing: 65 + -9223372034707292160 --- |
||||||
|
int(-9223372034707292095) |
||||||
|
--- testing: 65 + 2147483648 --- |
||||||
|
int(2147483713) |
||||||
|
--- testing: 65 + -2147483649 --- |
||||||
|
int(-2147483584) |
||||||
|
--- testing: 65 + 4294967294 --- |
||||||
|
int(4294967359) |
||||||
|
--- testing: 65 + 4294967295 --- |
||||||
|
int(4294967360) |
||||||
|
--- testing: 65 + 4294967293 --- |
||||||
|
int(4294967358) |
||||||
|
--- testing: 65 + 9223372036854775806 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 65 + 9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 65 + -9223372036854775807 --- |
||||||
|
int(-9223372036854775742) |
||||||
|
--- testing: 65 + -9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -44 + 9223372036854775807 --- |
||||||
|
int(9223372036854775763) |
||||||
|
--- testing: -44 + -9223372036854775808 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -44 + 2147483647 --- |
||||||
|
int(2147483603) |
||||||
|
--- testing: -44 + -2147483648 --- |
||||||
|
int(-2147483692) |
||||||
|
--- testing: -44 + 9223372034707292160 --- |
||||||
|
int(9223372034707292116) |
||||||
|
--- testing: -44 + -9223372034707292160 --- |
||||||
|
int(-9223372034707292204) |
||||||
|
--- testing: -44 + 2147483648 --- |
||||||
|
int(2147483604) |
||||||
|
--- testing: -44 + -2147483649 --- |
||||||
|
int(-2147483693) |
||||||
|
--- testing: -44 + 4294967294 --- |
||||||
|
int(4294967250) |
||||||
|
--- testing: -44 + 4294967295 --- |
||||||
|
int(4294967251) |
||||||
|
--- testing: -44 + 4294967293 --- |
||||||
|
int(4294967249) |
||||||
|
--- testing: -44 + 9223372036854775806 --- |
||||||
|
int(9223372036854775762) |
||||||
|
--- testing: -44 + 9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: -44 + -9223372036854775807 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -44 + -9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: 2147483647 + 9223372036854775807 --- |
||||||
|
float(9.22337203900226E+18) |
||||||
|
--- testing: 2147483647 + -9223372036854775808 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: 2147483647 + 2147483647 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 2147483647 + -2147483648 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 2147483647 + 9223372034707292160 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 2147483647 + -9223372034707292160 --- |
||||||
|
int(-9223372032559808513) |
||||||
|
--- testing: 2147483647 + 2147483648 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 2147483647 + -2147483649 --- |
||||||
|
int(-2) |
||||||
|
--- testing: 2147483647 + 4294967294 --- |
||||||
|
int(6442450941) |
||||||
|
--- testing: 2147483647 + 4294967295 --- |
||||||
|
int(6442450942) |
||||||
|
--- testing: 2147483647 + 4294967293 --- |
||||||
|
int(6442450940) |
||||||
|
--- testing: 2147483647 + 9223372036854775806 --- |
||||||
|
float(9.22337203900226E+18) |
||||||
|
--- testing: 2147483647 + 9.2233720368548E+18 --- |
||||||
|
float(9.22337203900226E+18) |
||||||
|
--- testing: 2147483647 + -9223372036854775807 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: 2147483647 + -9.2233720368548E+18 --- |
||||||
|
float(-9.223372034707292E+18) |
||||||
|
--- testing: 9223372036854775807 + 9223372036854775807 --- |
||||||
|
float(1.8446744073709552E+19) |
||||||
|
--- testing: 9223372036854775807 + -9223372036854775808 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9223372036854775807 + 2147483647 --- |
||||||
|
float(9.22337203900226E+18) |
||||||
|
--- testing: 9223372036854775807 + -2147483648 --- |
||||||
|
int(9223372034707292159) |
||||||
|
--- testing: 9223372036854775807 + 9223372034707292160 --- |
||||||
|
float(1.8446744071562068E+19) |
||||||
|
--- testing: 9223372036854775807 + -9223372034707292160 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 9223372036854775807 + 2147483648 --- |
||||||
|
float(9.22337203900226E+18) |
||||||
|
--- testing: 9223372036854775807 + -2147483649 --- |
||||||
|
int(9223372034707292158) |
||||||
|
--- testing: 9223372036854775807 + 4294967294 --- |
||||||
|
float(9.223372041149743E+18) |
||||||
|
--- testing: 9223372036854775807 + 4294967295 --- |
||||||
|
float(9.223372041149743E+18) |
||||||
|
--- testing: 9223372036854775807 + 4294967293 --- |
||||||
|
float(9.223372041149743E+18) |
||||||
|
--- testing: 9223372036854775807 + 9223372036854775806 --- |
||||||
|
float(1.8446744073709552E+19) |
||||||
|
--- testing: 9223372036854775807 + 9.2233720368548E+18 --- |
||||||
|
float(1.8446744073709552E+19) |
||||||
|
--- testing: 9223372036854775807 + -9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 + -9.2233720368548E+18 --- |
||||||
|
float(0) |
||||||
@ -0,0 +1,419 @@ |
|||||||
|
--TEST-- |
||||||
|
Test + operator : various numbers as strings |
||||||
|
--SKIPIF-- |
||||||
|
<?php die("skip");?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$strVals = array( |
||||||
|
"0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", |
||||||
|
"a5.9" |
||||||
|
); |
||||||
|
|
||||||
|
error_reporting(E_ERROR); |
||||||
|
|
||||||
|
foreach ($strVals as $strVal) { |
||||||
|
foreach($strVals as $otherVal) { |
||||||
|
echo "--- testing: '$strVal' + '$otherVal' ---\n"; |
||||||
|
try { |
||||||
|
var_dump($strVal+$otherVal); |
||||||
|
} catch (\TypeError $e) { |
||||||
|
echo $e->getMessage() . \PHP_EOL; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: '0' + '0' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' + '65' --- |
||||||
|
int(65) |
||||||
|
--- testing: '0' + '-44' --- |
||||||
|
int(-44) |
||||||
|
--- testing: '0' + '1.2' --- |
||||||
|
float(1.2) |
||||||
|
--- testing: '0' + '-7.7' --- |
||||||
|
float(-7.7) |
||||||
|
--- testing: '0' + 'abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '0' + '123abc' --- |
||||||
|
int(123) |
||||||
|
--- testing: '0' + '123e5' --- |
||||||
|
float(12300000) |
||||||
|
--- testing: '0' + '123e5xyz' --- |
||||||
|
float(12300000) |
||||||
|
--- testing: '0' + ' 123abc' --- |
||||||
|
int(123) |
||||||
|
--- testing: '0' + '123 abc' --- |
||||||
|
int(123) |
||||||
|
--- testing: '0' + '123abc ' --- |
||||||
|
int(123) |
||||||
|
--- testing: '0' + '3.4a' --- |
||||||
|
float(3.4) |
||||||
|
--- testing: '0' + 'a5.9' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '65' + '0' --- |
||||||
|
int(65) |
||||||
|
--- testing: '65' + '65' --- |
||||||
|
int(130) |
||||||
|
--- testing: '65' + '-44' --- |
||||||
|
int(21) |
||||||
|
--- testing: '65' + '1.2' --- |
||||||
|
float(66.2) |
||||||
|
--- testing: '65' + '-7.7' --- |
||||||
|
float(57.3) |
||||||
|
--- testing: '65' + 'abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '65' + '123abc' --- |
||||||
|
int(188) |
||||||
|
--- testing: '65' + '123e5' --- |
||||||
|
float(12300065) |
||||||
|
--- testing: '65' + '123e5xyz' --- |
||||||
|
float(12300065) |
||||||
|
--- testing: '65' + ' 123abc' --- |
||||||
|
int(188) |
||||||
|
--- testing: '65' + '123 abc' --- |
||||||
|
int(188) |
||||||
|
--- testing: '65' + '123abc ' --- |
||||||
|
int(188) |
||||||
|
--- testing: '65' + '3.4a' --- |
||||||
|
float(68.4) |
||||||
|
--- testing: '65' + 'a5.9' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '-44' + '0' --- |
||||||
|
int(-44) |
||||||
|
--- testing: '-44' + '65' --- |
||||||
|
int(21) |
||||||
|
--- testing: '-44' + '-44' --- |
||||||
|
int(-88) |
||||||
|
--- testing: '-44' + '1.2' --- |
||||||
|
float(-42.8) |
||||||
|
--- testing: '-44' + '-7.7' --- |
||||||
|
float(-51.7) |
||||||
|
--- testing: '-44' + 'abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '-44' + '123abc' --- |
||||||
|
int(79) |
||||||
|
--- testing: '-44' + '123e5' --- |
||||||
|
float(12299956) |
||||||
|
--- testing: '-44' + '123e5xyz' --- |
||||||
|
float(12299956) |
||||||
|
--- testing: '-44' + ' 123abc' --- |
||||||
|
int(79) |
||||||
|
--- testing: '-44' + '123 abc' --- |
||||||
|
int(79) |
||||||
|
--- testing: '-44' + '123abc ' --- |
||||||
|
int(79) |
||||||
|
--- testing: '-44' + '3.4a' --- |
||||||
|
float(-40.6) |
||||||
|
--- testing: '-44' + 'a5.9' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '1.2' + '0' --- |
||||||
|
float(1.2) |
||||||
|
--- testing: '1.2' + '65' --- |
||||||
|
float(66.2) |
||||||
|
--- testing: '1.2' + '-44' --- |
||||||
|
float(-42.8) |
||||||
|
--- testing: '1.2' + '1.2' --- |
||||||
|
float(2.4) |
||||||
|
--- testing: '1.2' + '-7.7' --- |
||||||
|
float(-6.5) |
||||||
|
--- testing: '1.2' + 'abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '1.2' + '123abc' --- |
||||||
|
float(124.2) |
||||||
|
--- testing: '1.2' + '123e5' --- |
||||||
|
float(12300001.2) |
||||||
|
--- testing: '1.2' + '123e5xyz' --- |
||||||
|
float(12300001.2) |
||||||
|
--- testing: '1.2' + ' 123abc' --- |
||||||
|
float(124.2) |
||||||
|
--- testing: '1.2' + '123 abc' --- |
||||||
|
float(124.2) |
||||||
|
--- testing: '1.2' + '123abc ' --- |
||||||
|
float(124.2) |
||||||
|
--- testing: '1.2' + '3.4a' --- |
||||||
|
float(4.6) |
||||||
|
--- testing: '1.2' + 'a5.9' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '-7.7' + '0' --- |
||||||
|
float(-7.7) |
||||||
|
--- testing: '-7.7' + '65' --- |
||||||
|
float(57.3) |
||||||
|
--- testing: '-7.7' + '-44' --- |
||||||
|
float(-51.7) |
||||||
|
--- testing: '-7.7' + '1.2' --- |
||||||
|
float(-6.5) |
||||||
|
--- testing: '-7.7' + '-7.7' --- |
||||||
|
float(-15.4) |
||||||
|
--- testing: '-7.7' + 'abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '-7.7' + '123abc' --- |
||||||
|
float(115.3) |
||||||
|
--- testing: '-7.7' + '123e5' --- |
||||||
|
float(12299992.3) |
||||||
|
--- testing: '-7.7' + '123e5xyz' --- |
||||||
|
float(12299992.3) |
||||||
|
--- testing: '-7.7' + ' 123abc' --- |
||||||
|
float(115.3) |
||||||
|
--- testing: '-7.7' + '123 abc' --- |
||||||
|
float(115.3) |
||||||
|
--- testing: '-7.7' + '123abc ' --- |
||||||
|
float(115.3) |
||||||
|
--- testing: '-7.7' + '3.4a' --- |
||||||
|
float(-4.300000000000001) |
||||||
|
--- testing: '-7.7' + 'a5.9' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'abc' + '0' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'abc' + '65' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'abc' + '-44' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'abc' + '1.2' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'abc' + '-7.7' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'abc' + 'abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'abc' + '123abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'abc' + '123e5' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'abc' + '123e5xyz' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'abc' + ' 123abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'abc' + '123 abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'abc' + '123abc ' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'abc' + '3.4a' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'abc' + 'a5.9' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '123abc' + '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123abc' + '65' --- |
||||||
|
int(188) |
||||||
|
--- testing: '123abc' + '-44' --- |
||||||
|
int(79) |
||||||
|
--- testing: '123abc' + '1.2' --- |
||||||
|
float(124.2) |
||||||
|
--- testing: '123abc' + '-7.7' --- |
||||||
|
float(115.3) |
||||||
|
--- testing: '123abc' + 'abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '123abc' + '123abc' --- |
||||||
|
int(246) |
||||||
|
--- testing: '123abc' + '123e5' --- |
||||||
|
float(12300123) |
||||||
|
--- testing: '123abc' + '123e5xyz' --- |
||||||
|
float(12300123) |
||||||
|
--- testing: '123abc' + ' 123abc' --- |
||||||
|
int(246) |
||||||
|
--- testing: '123abc' + '123 abc' --- |
||||||
|
int(246) |
||||||
|
--- testing: '123abc' + '123abc ' --- |
||||||
|
int(246) |
||||||
|
--- testing: '123abc' + '3.4a' --- |
||||||
|
float(126.4) |
||||||
|
--- testing: '123abc' + 'a5.9' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '123e5' + '0' --- |
||||||
|
float(12300000) |
||||||
|
--- testing: '123e5' + '65' --- |
||||||
|
float(12300065) |
||||||
|
--- testing: '123e5' + '-44' --- |
||||||
|
float(12299956) |
||||||
|
--- testing: '123e5' + '1.2' --- |
||||||
|
float(12300001.2) |
||||||
|
--- testing: '123e5' + '-7.7' --- |
||||||
|
float(12299992.3) |
||||||
|
--- testing: '123e5' + 'abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '123e5' + '123abc' --- |
||||||
|
float(12300123) |
||||||
|
--- testing: '123e5' + '123e5' --- |
||||||
|
float(24600000) |
||||||
|
--- testing: '123e5' + '123e5xyz' --- |
||||||
|
float(24600000) |
||||||
|
--- testing: '123e5' + ' 123abc' --- |
||||||
|
float(12300123) |
||||||
|
--- testing: '123e5' + '123 abc' --- |
||||||
|
float(12300123) |
||||||
|
--- testing: '123e5' + '123abc ' --- |
||||||
|
float(12300123) |
||||||
|
--- testing: '123e5' + '3.4a' --- |
||||||
|
float(12300003.4) |
||||||
|
--- testing: '123e5' + 'a5.9' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '123e5xyz' + '0' --- |
||||||
|
float(12300000) |
||||||
|
--- testing: '123e5xyz' + '65' --- |
||||||
|
float(12300065) |
||||||
|
--- testing: '123e5xyz' + '-44' --- |
||||||
|
float(12299956) |
||||||
|
--- testing: '123e5xyz' + '1.2' --- |
||||||
|
float(12300001.2) |
||||||
|
--- testing: '123e5xyz' + '-7.7' --- |
||||||
|
float(12299992.3) |
||||||
|
--- testing: '123e5xyz' + 'abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '123e5xyz' + '123abc' --- |
||||||
|
float(12300123) |
||||||
|
--- testing: '123e5xyz' + '123e5' --- |
||||||
|
float(24600000) |
||||||
|
--- testing: '123e5xyz' + '123e5xyz' --- |
||||||
|
float(24600000) |
||||||
|
--- testing: '123e5xyz' + ' 123abc' --- |
||||||
|
float(12300123) |
||||||
|
--- testing: '123e5xyz' + '123 abc' --- |
||||||
|
float(12300123) |
||||||
|
--- testing: '123e5xyz' + '123abc ' --- |
||||||
|
float(12300123) |
||||||
|
--- testing: '123e5xyz' + '3.4a' --- |
||||||
|
float(12300003.4) |
||||||
|
--- testing: '123e5xyz' + 'a5.9' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: ' 123abc' + '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: ' 123abc' + '65' --- |
||||||
|
int(188) |
||||||
|
--- testing: ' 123abc' + '-44' --- |
||||||
|
int(79) |
||||||
|
--- testing: ' 123abc' + '1.2' --- |
||||||
|
float(124.2) |
||||||
|
--- testing: ' 123abc' + '-7.7' --- |
||||||
|
float(115.3) |
||||||
|
--- testing: ' 123abc' + 'abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: ' 123abc' + '123abc' --- |
||||||
|
int(246) |
||||||
|
--- testing: ' 123abc' + '123e5' --- |
||||||
|
float(12300123) |
||||||
|
--- testing: ' 123abc' + '123e5xyz' --- |
||||||
|
float(12300123) |
||||||
|
--- testing: ' 123abc' + ' 123abc' --- |
||||||
|
int(246) |
||||||
|
--- testing: ' 123abc' + '123 abc' --- |
||||||
|
int(246) |
||||||
|
--- testing: ' 123abc' + '123abc ' --- |
||||||
|
int(246) |
||||||
|
--- testing: ' 123abc' + '3.4a' --- |
||||||
|
float(126.4) |
||||||
|
--- testing: ' 123abc' + 'a5.9' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '123 abc' + '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123 abc' + '65' --- |
||||||
|
int(188) |
||||||
|
--- testing: '123 abc' + '-44' --- |
||||||
|
int(79) |
||||||
|
--- testing: '123 abc' + '1.2' --- |
||||||
|
float(124.2) |
||||||
|
--- testing: '123 abc' + '-7.7' --- |
||||||
|
float(115.3) |
||||||
|
--- testing: '123 abc' + 'abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '123 abc' + '123abc' --- |
||||||
|
int(246) |
||||||
|
--- testing: '123 abc' + '123e5' --- |
||||||
|
float(12300123) |
||||||
|
--- testing: '123 abc' + '123e5xyz' --- |
||||||
|
float(12300123) |
||||||
|
--- testing: '123 abc' + ' 123abc' --- |
||||||
|
int(246) |
||||||
|
--- testing: '123 abc' + '123 abc' --- |
||||||
|
int(246) |
||||||
|
--- testing: '123 abc' + '123abc ' --- |
||||||
|
int(246) |
||||||
|
--- testing: '123 abc' + '3.4a' --- |
||||||
|
float(126.4) |
||||||
|
--- testing: '123 abc' + 'a5.9' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '123abc ' + '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123abc ' + '65' --- |
||||||
|
int(188) |
||||||
|
--- testing: '123abc ' + '-44' --- |
||||||
|
int(79) |
||||||
|
--- testing: '123abc ' + '1.2' --- |
||||||
|
float(124.2) |
||||||
|
--- testing: '123abc ' + '-7.7' --- |
||||||
|
float(115.3) |
||||||
|
--- testing: '123abc ' + 'abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '123abc ' + '123abc' --- |
||||||
|
int(246) |
||||||
|
--- testing: '123abc ' + '123e5' --- |
||||||
|
float(12300123) |
||||||
|
--- testing: '123abc ' + '123e5xyz' --- |
||||||
|
float(12300123) |
||||||
|
--- testing: '123abc ' + ' 123abc' --- |
||||||
|
int(246) |
||||||
|
--- testing: '123abc ' + '123 abc' --- |
||||||
|
int(246) |
||||||
|
--- testing: '123abc ' + '123abc ' --- |
||||||
|
int(246) |
||||||
|
--- testing: '123abc ' + '3.4a' --- |
||||||
|
float(126.4) |
||||||
|
--- testing: '123abc ' + 'a5.9' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '3.4a' + '0' --- |
||||||
|
float(3.4) |
||||||
|
--- testing: '3.4a' + '65' --- |
||||||
|
float(68.4) |
||||||
|
--- testing: '3.4a' + '-44' --- |
||||||
|
float(-40.6) |
||||||
|
--- testing: '3.4a' + '1.2' --- |
||||||
|
float(4.6) |
||||||
|
--- testing: '3.4a' + '-7.7' --- |
||||||
|
float(-4.300000000000001) |
||||||
|
--- testing: '3.4a' + 'abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: '3.4a' + '123abc' --- |
||||||
|
float(126.4) |
||||||
|
--- testing: '3.4a' + '123e5' --- |
||||||
|
float(12300003.4) |
||||||
|
--- testing: '3.4a' + '123e5xyz' --- |
||||||
|
float(12300003.4) |
||||||
|
--- testing: '3.4a' + ' 123abc' --- |
||||||
|
float(126.4) |
||||||
|
--- testing: '3.4a' + '123 abc' --- |
||||||
|
float(126.4) |
||||||
|
--- testing: '3.4a' + '123abc ' --- |
||||||
|
float(126.4) |
||||||
|
--- testing: '3.4a' + '3.4a' --- |
||||||
|
float(6.8) |
||||||
|
--- testing: '3.4a' + 'a5.9' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'a5.9' + '0' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'a5.9' + '65' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'a5.9' + '-44' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'a5.9' + '1.2' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'a5.9' + '-7.7' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'a5.9' + 'abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'a5.9' + '123abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'a5.9' + '123e5' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'a5.9' + '123e5xyz' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'a5.9' + ' 123abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'a5.9' + '123 abc' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'a5.9' + '123abc ' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'a5.9' + '3.4a' --- |
||||||
|
Unsupported operand types: string + string |
||||||
|
--- testing: 'a5.9' + 'a5.9' --- |
||||||
|
Unsupported operand types: string + string |
||||||
@ -0,0 +1,580 @@ |
|||||||
|
--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.0, MIN_64Bit + 1, MIN_64Bit - 1.0, |
||||||
|
); |
||||||
|
|
||||||
|
$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); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: 9223372036854775807 & 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 & 1 --- |
||||||
|
int(1) |
||||||
|
--- testing: 9223372036854775807 & -1 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 & 7 --- |
||||||
|
int(7) |
||||||
|
--- testing: 9223372036854775807 & 9 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9223372036854775807 & 65 --- |
||||||
|
int(65) |
||||||
|
--- testing: 9223372036854775807 & -44 --- |
||||||
|
int(9223372036854775764) |
||||||
|
--- testing: 9223372036854775807 & 2147483647 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 9223372036854775807 & 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: -9223372036854775808 & 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 & 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 & -1 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9223372036854775808 & 7 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 & 9 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 & 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 & -44 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9223372036854775808 & 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 & 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 & 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 & 1 --- |
||||||
|
int(1) |
||||||
|
--- testing: 2147483647 & -1 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 & 7 --- |
||||||
|
int(7) |
||||||
|
--- testing: 2147483647 & 9 --- |
||||||
|
int(9) |
||||||
|
--- testing: 2147483647 & 65 --- |
||||||
|
int(65) |
||||||
|
--- testing: 2147483647 & -44 --- |
||||||
|
int(2147483604) |
||||||
|
--- testing: 2147483647 & 2147483647 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 & 9223372036854775807 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: -2147483648 & 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483648 & 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483648 & -1 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -2147483648 & 7 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483648 & 9 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483648 & 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483648 & -44 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -2147483648 & 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483648 & 9223372036854775807 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 9223372034707292160 & 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372034707292160 & 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372034707292160 & -1 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 9223372034707292160 & 7 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372034707292160 & 9 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372034707292160 & 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372034707292160 & -44 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 9223372034707292160 & 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372034707292160 & 9223372036854775807 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: -9223372034707292160 & 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372034707292160 & 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372034707292160 & -1 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: -9223372034707292160 & 7 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372034707292160 & 9 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372034707292160 & 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372034707292160 & -44 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: -9223372034707292160 & 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372034707292160 & 9223372036854775807 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 2147483648 & 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483648 & 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483648 & -1 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 2147483648 & 7 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483648 & 9 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483648 & 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483648 & -44 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 2147483648 & 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483648 & 9223372036854775807 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: -2147483649 & 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483649 & 1 --- |
||||||
|
int(1) |
||||||
|
--- testing: -2147483649 & -1 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -2147483649 & 7 --- |
||||||
|
int(7) |
||||||
|
--- testing: -2147483649 & 9 --- |
||||||
|
int(9) |
||||||
|
--- testing: -2147483649 & 65 --- |
||||||
|
int(65) |
||||||
|
--- testing: -2147483649 & -44 --- |
||||||
|
int(-2147483692) |
||||||
|
--- testing: -2147483649 & 2147483647 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: -2147483649 & 9223372036854775807 --- |
||||||
|
int(9223372034707292159) |
||||||
|
--- testing: 4294967294 & 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967294 & 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967294 & -1 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 4294967294 & 7 --- |
||||||
|
int(6) |
||||||
|
--- testing: 4294967294 & 9 --- |
||||||
|
int(8) |
||||||
|
--- testing: 4294967294 & 65 --- |
||||||
|
int(64) |
||||||
|
--- testing: 4294967294 & -44 --- |
||||||
|
int(4294967252) |
||||||
|
--- testing: 4294967294 & 2147483647 --- |
||||||
|
int(2147483646) |
||||||
|
--- testing: 4294967294 & 9223372036854775807 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 4294967295 & 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967295 & 1 --- |
||||||
|
int(1) |
||||||
|
--- testing: 4294967295 & -1 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967295 & 7 --- |
||||||
|
int(7) |
||||||
|
--- testing: 4294967295 & 9 --- |
||||||
|
int(9) |
||||||
|
--- testing: 4294967295 & 65 --- |
||||||
|
int(65) |
||||||
|
--- testing: 4294967295 & -44 --- |
||||||
|
int(4294967252) |
||||||
|
--- testing: 4294967295 & 2147483647 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 4294967295 & 9223372036854775807 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967293 & 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967293 & 1 --- |
||||||
|
int(1) |
||||||
|
--- testing: 4294967293 & -1 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 4294967293 & 7 --- |
||||||
|
int(5) |
||||||
|
--- testing: 4294967293 & 9 --- |
||||||
|
int(9) |
||||||
|
--- testing: 4294967293 & 65 --- |
||||||
|
int(65) |
||||||
|
--- testing: 4294967293 & -44 --- |
||||||
|
int(4294967252) |
||||||
|
--- testing: 4294967293 & 2147483647 --- |
||||||
|
int(2147483645) |
||||||
|
--- testing: 4294967293 & 9223372036854775807 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 9223372036854775806 & 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775806 & 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775806 & -1 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 9223372036854775806 & 7 --- |
||||||
|
int(6) |
||||||
|
--- testing: 9223372036854775806 & 9 --- |
||||||
|
int(8) |
||||||
|
--- testing: 9223372036854775806 & 65 --- |
||||||
|
int(64) |
||||||
|
--- testing: 9223372036854775806 & -44 --- |
||||||
|
int(9223372036854775764) |
||||||
|
--- testing: 9223372036854775806 & 2147483647 --- |
||||||
|
int(2147483646) |
||||||
|
--- testing: 9223372036854775806 & 9223372036854775807 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 9.2233720368548E+18 & 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9.2233720368548E+18 & 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9.2233720368548E+18 & -1 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- 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(-9223372036854775808) |
||||||
|
--- testing: 9.2233720368548E+18 & 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9.2233720368548E+18 & 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775807 & 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775807 & 1 --- |
||||||
|
int(1) |
||||||
|
--- testing: -9223372036854775807 & -1 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -9223372036854775807 & 7 --- |
||||||
|
int(1) |
||||||
|
--- testing: -9223372036854775807 & 9 --- |
||||||
|
int(1) |
||||||
|
--- testing: -9223372036854775807 & 65 --- |
||||||
|
int(1) |
||||||
|
--- testing: -9223372036854775807 & -44 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9223372036854775807 & 2147483647 --- |
||||||
|
int(1) |
||||||
|
--- testing: -9223372036854775807 & 9223372036854775807 --- |
||||||
|
int(1) |
||||||
|
--- testing: -9.2233720368548E+18 & 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9.2233720368548E+18 & 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9.2233720368548E+18 & -1 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- 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(-9223372036854775808) |
||||||
|
--- 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(1) |
||||||
|
--- testing: 1 & -9223372036854775808 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 & 2147483647 --- |
||||||
|
int(1) |
||||||
|
--- testing: 1 & -2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 & 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 & -9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 & 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 & -2147483649 --- |
||||||
|
int(1) |
||||||
|
--- testing: 1 & 4294967294 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 & 4294967295 --- |
||||||
|
int(1) |
||||||
|
--- testing: 1 & 4294967293 --- |
||||||
|
int(1) |
||||||
|
--- testing: 1 & 9223372036854775806 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 & 9.2233720368548E+18 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 & -9223372036854775807 --- |
||||||
|
int(1) |
||||||
|
--- testing: 1 & -9.2233720368548E+18 --- |
||||||
|
int(0) |
||||||
|
--- testing: -1 & 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: -1 & -9223372036854775808 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -1 & 2147483647 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: -1 & -2147483648 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -1 & 9223372034707292160 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: -1 & -9223372034707292160 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: -1 & 2147483648 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: -1 & -2147483649 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -1 & 4294967294 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: -1 & 4294967295 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: -1 & 4294967293 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: -1 & 9223372036854775806 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: -1 & 9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -1 & -9223372036854775807 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -1 & -9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: 7 & 9223372036854775807 --- |
||||||
|
int(7) |
||||||
|
--- testing: 7 & -9223372036854775808 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 & 2147483647 --- |
||||||
|
int(7) |
||||||
|
--- testing: 7 & -2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 & 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 & -9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 & 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 & -2147483649 --- |
||||||
|
int(7) |
||||||
|
--- testing: 7 & 4294967294 --- |
||||||
|
int(6) |
||||||
|
--- testing: 7 & 4294967295 --- |
||||||
|
int(7) |
||||||
|
--- testing: 7 & 4294967293 --- |
||||||
|
int(5) |
||||||
|
--- testing: 7 & 9223372036854775806 --- |
||||||
|
int(6) |
||||||
|
--- testing: 7 & 9.2233720368548E+18 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 & -9223372036854775807 --- |
||||||
|
int(1) |
||||||
|
--- testing: 7 & -9.2233720368548E+18 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 & 9223372036854775807 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 & -9223372036854775808 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 & 2147483647 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 & -2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 & 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 & -9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 & 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 & -2147483649 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 & 4294967294 --- |
||||||
|
int(8) |
||||||
|
--- testing: 9 & 4294967295 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 & 4294967293 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 & 9223372036854775806 --- |
||||||
|
int(8) |
||||||
|
--- testing: 9 & 9.2233720368548E+18 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 & -9223372036854775807 --- |
||||||
|
int(1) |
||||||
|
--- testing: 9 & -9.2233720368548E+18 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 & 9223372036854775807 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 & -9223372036854775808 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 & 2147483647 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 & -2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 & 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 & -9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 & 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 & -2147483649 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 & 4294967294 --- |
||||||
|
int(64) |
||||||
|
--- testing: 65 & 4294967295 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 & 4294967293 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 & 9223372036854775806 --- |
||||||
|
int(64) |
||||||
|
--- testing: 65 & 9.2233720368548E+18 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 & -9223372036854775807 --- |
||||||
|
int(1) |
||||||
|
--- testing: 65 & -9.2233720368548E+18 --- |
||||||
|
int(0) |
||||||
|
--- testing: -44 & 9223372036854775807 --- |
||||||
|
int(9223372036854775764) |
||||||
|
--- testing: -44 & -9223372036854775808 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -44 & 2147483647 --- |
||||||
|
int(2147483604) |
||||||
|
--- testing: -44 & -2147483648 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -44 & 9223372034707292160 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: -44 & -9223372034707292160 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: -44 & 2147483648 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: -44 & -2147483649 --- |
||||||
|
int(-2147483692) |
||||||
|
--- testing: -44 & 4294967294 --- |
||||||
|
int(4294967252) |
||||||
|
--- testing: -44 & 4294967295 --- |
||||||
|
int(4294967252) |
||||||
|
--- testing: -44 & 4294967293 --- |
||||||
|
int(4294967252) |
||||||
|
--- testing: -44 & 9223372036854775806 --- |
||||||
|
int(9223372036854775764) |
||||||
|
--- testing: -44 & 9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -44 & -9223372036854775807 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -44 & -9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: 2147483647 & 9223372036854775807 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 & -9223372036854775808 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 & 2147483647 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 & -2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 & 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 & -9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 & 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 & -2147483649 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 & 4294967294 --- |
||||||
|
int(2147483646) |
||||||
|
--- testing: 2147483647 & 4294967295 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 & 4294967293 --- |
||||||
|
int(2147483645) |
||||||
|
--- testing: 2147483647 & 9223372036854775806 --- |
||||||
|
int(2147483646) |
||||||
|
--- testing: 2147483647 & 9.2233720368548E+18 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 & -9223372036854775807 --- |
||||||
|
int(1) |
||||||
|
--- testing: 2147483647 & -9.2233720368548E+18 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 & 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 & -9223372036854775808 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 & 2147483647 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 9223372036854775807 & -2147483648 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 9223372036854775807 & 9223372034707292160 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 9223372036854775807 & -9223372034707292160 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 9223372036854775807 & 2147483648 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 9223372036854775807 & -2147483649 --- |
||||||
|
int(9223372034707292159) |
||||||
|
--- testing: 9223372036854775807 & 4294967294 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 9223372036854775807 & 4294967295 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 9223372036854775807 & 4294967293 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 9223372036854775807 & 9223372036854775806 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 9223372036854775807 & 9.2233720368548E+18 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 & -9223372036854775807 --- |
||||||
|
int(1) |
||||||
|
--- testing: 9223372036854775807 & -9.2233720368548E+18 --- |
||||||
|
int(0) |
||||||
@ -0,0 +1,414 @@ |
|||||||
|
--TEST-- |
||||||
|
Test & operator : various numbers as strings |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$strVals = array( |
||||||
|
"0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", |
||||||
|
"a5.9" |
||||||
|
); |
||||||
|
|
||||||
|
error_reporting(E_ERROR); |
||||||
|
|
||||||
|
foreach ($strVals as $strVal) { |
||||||
|
foreach($strVals as $otherVal) { |
||||||
|
echo "--- testing: '$strVal' & '$otherVal' ---\n"; |
||||||
|
var_dump(bin2hex($strVal&$otherVal)); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: '0' & '0' --- |
||||||
|
string(2) "30" |
||||||
|
--- testing: '0' & '65' --- |
||||||
|
string(2) "30" |
||||||
|
--- testing: '0' & '-44' --- |
||||||
|
string(2) "20" |
||||||
|
--- testing: '0' & '1.2' --- |
||||||
|
string(2) "30" |
||||||
|
--- testing: '0' & '-7.7' --- |
||||||
|
string(2) "20" |
||||||
|
--- testing: '0' & 'abc' --- |
||||||
|
string(2) "20" |
||||||
|
--- testing: '0' & '123abc' --- |
||||||
|
string(2) "30" |
||||||
|
--- testing: '0' & '123e5' --- |
||||||
|
string(2) "30" |
||||||
|
--- testing: '0' & '123e5xyz' --- |
||||||
|
string(2) "30" |
||||||
|
--- testing: '0' & ' 123abc' --- |
||||||
|
string(2) "20" |
||||||
|
--- testing: '0' & '123 abc' --- |
||||||
|
string(2) "30" |
||||||
|
--- testing: '0' & '123abc ' --- |
||||||
|
string(2) "30" |
||||||
|
--- testing: '0' & '3.4a' --- |
||||||
|
string(2) "30" |
||||||
|
--- testing: '0' & 'a5.9' --- |
||||||
|
string(2) "20" |
||||||
|
--- testing: '65' & '0' --- |
||||||
|
string(2) "30" |
||||||
|
--- testing: '65' & '65' --- |
||||||
|
string(4) "3635" |
||||||
|
--- testing: '65' & '-44' --- |
||||||
|
string(4) "2434" |
||||||
|
--- testing: '65' & '1.2' --- |
||||||
|
string(4) "3024" |
||||||
|
--- testing: '65' & '-7.7' --- |
||||||
|
string(4) "2435" |
||||||
|
--- testing: '65' & 'abc' --- |
||||||
|
string(4) "2020" |
||||||
|
--- testing: '65' & '123abc' --- |
||||||
|
string(4) "3030" |
||||||
|
--- testing: '65' & '123e5' --- |
||||||
|
string(4) "3030" |
||||||
|
--- testing: '65' & '123e5xyz' --- |
||||||
|
string(4) "3030" |
||||||
|
--- testing: '65' & ' 123abc' --- |
||||||
|
string(4) "2031" |
||||||
|
--- testing: '65' & '123 abc' --- |
||||||
|
string(4) "3030" |
||||||
|
--- testing: '65' & '123abc ' --- |
||||||
|
string(4) "3030" |
||||||
|
--- testing: '65' & '3.4a' --- |
||||||
|
string(4) "3224" |
||||||
|
--- testing: '65' & 'a5.9' --- |
||||||
|
string(4) "2035" |
||||||
|
--- testing: '-44' & '0' --- |
||||||
|
string(2) "20" |
||||||
|
--- testing: '-44' & '65' --- |
||||||
|
string(4) "2434" |
||||||
|
--- testing: '-44' & '-44' --- |
||||||
|
string(6) "2d3434" |
||||||
|
--- testing: '-44' & '1.2' --- |
||||||
|
string(6) "212430" |
||||||
|
--- testing: '-44' & '-7.7' --- |
||||||
|
string(6) "2d3424" |
||||||
|
--- testing: '-44' & 'abc' --- |
||||||
|
string(6) "212020" |
||||||
|
--- testing: '-44' & '123abc' --- |
||||||
|
string(6) "213030" |
||||||
|
--- testing: '-44' & '123e5' --- |
||||||
|
string(6) "213030" |
||||||
|
--- testing: '-44' & '123e5xyz' --- |
||||||
|
string(6) "213030" |
||||||
|
--- testing: '-44' & ' 123abc' --- |
||||||
|
string(6) "203030" |
||||||
|
--- testing: '-44' & '123 abc' --- |
||||||
|
string(6) "213030" |
||||||
|
--- testing: '-44' & '123abc ' --- |
||||||
|
string(6) "213030" |
||||||
|
--- testing: '-44' & '3.4a' --- |
||||||
|
string(6) "212434" |
||||||
|
--- testing: '-44' & 'a5.9' --- |
||||||
|
string(6) "213424" |
||||||
|
--- testing: '1.2' & '0' --- |
||||||
|
string(2) "30" |
||||||
|
--- testing: '1.2' & '65' --- |
||||||
|
string(4) "3024" |
||||||
|
--- testing: '1.2' & '-44' --- |
||||||
|
string(6) "212430" |
||||||
|
--- testing: '1.2' & '1.2' --- |
||||||
|
string(6) "312e32" |
||||||
|
--- testing: '1.2' & '-7.7' --- |
||||||
|
string(6) "212622" |
||||||
|
--- testing: '1.2' & 'abc' --- |
||||||
|
string(6) "212222" |
||||||
|
--- testing: '1.2' & '123abc' --- |
||||||
|
string(6) "312232" |
||||||
|
--- testing: '1.2' & '123e5' --- |
||||||
|
string(6) "312232" |
||||||
|
--- testing: '1.2' & '123e5xyz' --- |
||||||
|
string(6) "312232" |
||||||
|
--- testing: '1.2' & ' 123abc' --- |
||||||
|
string(6) "202032" |
||||||
|
--- testing: '1.2' & '123 abc' --- |
||||||
|
string(6) "312232" |
||||||
|
--- testing: '1.2' & '123abc ' --- |
||||||
|
string(6) "312232" |
||||||
|
--- testing: '1.2' & '3.4a' --- |
||||||
|
string(6) "312e30" |
||||||
|
--- testing: '1.2' & 'a5.9' --- |
||||||
|
string(6) "212422" |
||||||
|
--- testing: '-7.7' & '0' --- |
||||||
|
string(2) "20" |
||||||
|
--- testing: '-7.7' & '65' --- |
||||||
|
string(4) "2435" |
||||||
|
--- testing: '-7.7' & '-44' --- |
||||||
|
string(6) "2d3424" |
||||||
|
--- testing: '-7.7' & '1.2' --- |
||||||
|
string(6) "212622" |
||||||
|
--- testing: '-7.7' & '-7.7' --- |
||||||
|
string(8) "2d372e37" |
||||||
|
--- testing: '-7.7' & 'abc' --- |
||||||
|
string(6) "212222" |
||||||
|
--- testing: '-7.7' & '123abc' --- |
||||||
|
string(8) "21322221" |
||||||
|
--- testing: '-7.7' & '123e5' --- |
||||||
|
string(8) "21322225" |
||||||
|
--- testing: '-7.7' & '123e5xyz' --- |
||||||
|
string(8) "21322225" |
||||||
|
--- testing: '-7.7' & ' 123abc' --- |
||||||
|
string(8) "20312233" |
||||||
|
--- testing: '-7.7' & '123 abc' --- |
||||||
|
string(8) "21322220" |
||||||
|
--- testing: '-7.7' & '123abc ' --- |
||||||
|
string(8) "21322221" |
||||||
|
--- testing: '-7.7' & '3.4a' --- |
||||||
|
string(8) "21262421" |
||||||
|
--- testing: '-7.7' & 'a5.9' --- |
||||||
|
string(8) "21352e31" |
||||||
|
--- testing: 'abc' & '0' --- |
||||||
|
string(2) "20" |
||||||
|
--- testing: 'abc' & '65' --- |
||||||
|
string(4) "2020" |
||||||
|
--- testing: 'abc' & '-44' --- |
||||||
|
string(6) "212020" |
||||||
|
--- testing: 'abc' & '1.2' --- |
||||||
|
string(6) "212222" |
||||||
|
--- testing: 'abc' & '-7.7' --- |
||||||
|
string(6) "212222" |
||||||
|
--- testing: 'abc' & 'abc' --- |
||||||
|
string(6) "616263" |
||||||
|
--- testing: 'abc' & '123abc' --- |
||||||
|
string(6) "212223" |
||||||
|
--- testing: 'abc' & '123e5' --- |
||||||
|
string(6) "212223" |
||||||
|
--- testing: 'abc' & '123e5xyz' --- |
||||||
|
string(6) "212223" |
||||||
|
--- testing: 'abc' & ' 123abc' --- |
||||||
|
string(6) "202022" |
||||||
|
--- testing: 'abc' & '123 abc' --- |
||||||
|
string(6) "212223" |
||||||
|
--- testing: 'abc' & '123abc ' --- |
||||||
|
string(6) "212223" |
||||||
|
--- testing: 'abc' & '3.4a' --- |
||||||
|
string(6) "212220" |
||||||
|
--- testing: 'abc' & 'a5.9' --- |
||||||
|
string(6) "612022" |
||||||
|
--- testing: '123abc' & '0' --- |
||||||
|
string(2) "30" |
||||||
|
--- testing: '123abc' & '65' --- |
||||||
|
string(4) "3030" |
||||||
|
--- testing: '123abc' & '-44' --- |
||||||
|
string(6) "213030" |
||||||
|
--- testing: '123abc' & '1.2' --- |
||||||
|
string(6) "312232" |
||||||
|
--- testing: '123abc' & '-7.7' --- |
||||||
|
string(8) "21322221" |
||||||
|
--- testing: '123abc' & 'abc' --- |
||||||
|
string(6) "212223" |
||||||
|
--- testing: '123abc' & '123abc' --- |
||||||
|
string(12) "313233616263" |
||||||
|
--- testing: '123abc' & '123e5' --- |
||||||
|
string(10) "3132336120" |
||||||
|
--- testing: '123abc' & '123e5xyz' --- |
||||||
|
string(12) "313233612060" |
||||||
|
--- testing: '123abc' & ' 123abc' --- |
||||||
|
string(12) "203032216062" |
||||||
|
--- testing: '123abc' & '123 abc' --- |
||||||
|
string(12) "313233206062" |
||||||
|
--- testing: '123abc' & '123abc ' --- |
||||||
|
string(12) "313233616263" |
||||||
|
--- testing: '123abc' & '3.4a' --- |
||||||
|
string(8) "31223061" |
||||||
|
--- testing: '123abc' & 'a5.9' --- |
||||||
|
string(8) "21302221" |
||||||
|
--- testing: '123e5' & '0' --- |
||||||
|
string(2) "30" |
||||||
|
--- testing: '123e5' & '65' --- |
||||||
|
string(4) "3030" |
||||||
|
--- testing: '123e5' & '-44' --- |
||||||
|
string(6) "213030" |
||||||
|
--- testing: '123e5' & '1.2' --- |
||||||
|
string(6) "312232" |
||||||
|
--- testing: '123e5' & '-7.7' --- |
||||||
|
string(8) "21322225" |
||||||
|
--- testing: '123e5' & 'abc' --- |
||||||
|
string(6) "212223" |
||||||
|
--- testing: '123e5' & '123abc' --- |
||||||
|
string(10) "3132336120" |
||||||
|
--- testing: '123e5' & '123e5' --- |
||||||
|
string(10) "3132336535" |
||||||
|
--- testing: '123e5' & '123e5xyz' --- |
||||||
|
string(10) "3132336535" |
||||||
|
--- testing: '123e5' & ' 123abc' --- |
||||||
|
string(10) "2030322121" |
||||||
|
--- testing: '123e5' & '123 abc' --- |
||||||
|
string(10) "3132332021" |
||||||
|
--- testing: '123e5' & '123abc ' --- |
||||||
|
string(10) "3132336120" |
||||||
|
--- testing: '123e5' & '3.4a' --- |
||||||
|
string(8) "31223061" |
||||||
|
--- testing: '123e5' & 'a5.9' --- |
||||||
|
string(8) "21302221" |
||||||
|
--- testing: '123e5xyz' & '0' --- |
||||||
|
string(2) "30" |
||||||
|
--- testing: '123e5xyz' & '65' --- |
||||||
|
string(4) "3030" |
||||||
|
--- testing: '123e5xyz' & '-44' --- |
||||||
|
string(6) "213030" |
||||||
|
--- testing: '123e5xyz' & '1.2' --- |
||||||
|
string(6) "312232" |
||||||
|
--- testing: '123e5xyz' & '-7.7' --- |
||||||
|
string(8) "21322225" |
||||||
|
--- testing: '123e5xyz' & 'abc' --- |
||||||
|
string(6) "212223" |
||||||
|
--- testing: '123e5xyz' & '123abc' --- |
||||||
|
string(12) "313233612060" |
||||||
|
--- testing: '123e5xyz' & '123e5' --- |
||||||
|
string(10) "3132336535" |
||||||
|
--- testing: '123e5xyz' & '123e5xyz' --- |
||||||
|
string(16) "313233653578797a" |
||||||
|
--- testing: '123e5xyz' & ' 123abc' --- |
||||||
|
string(14) "20303221216061" |
||||||
|
--- testing: '123e5xyz' & '123 abc' --- |
||||||
|
string(14) "31323320216061" |
||||||
|
--- testing: '123e5xyz' & '123abc ' --- |
||||||
|
string(14) "31323361206020" |
||||||
|
--- testing: '123e5xyz' & '3.4a' --- |
||||||
|
string(8) "31223061" |
||||||
|
--- testing: '123e5xyz' & 'a5.9' --- |
||||||
|
string(8) "21302221" |
||||||
|
--- testing: ' 123abc' & '0' --- |
||||||
|
string(2) "20" |
||||||
|
--- testing: ' 123abc' & '65' --- |
||||||
|
string(4) "2031" |
||||||
|
--- testing: ' 123abc' & '-44' --- |
||||||
|
string(6) "203030" |
||||||
|
--- testing: ' 123abc' & '1.2' --- |
||||||
|
string(6) "202032" |
||||||
|
--- testing: ' 123abc' & '-7.7' --- |
||||||
|
string(8) "20312233" |
||||||
|
--- testing: ' 123abc' & 'abc' --- |
||||||
|
string(6) "202022" |
||||||
|
--- testing: ' 123abc' & '123abc' --- |
||||||
|
string(12) "203032216062" |
||||||
|
--- testing: ' 123abc' & '123e5' --- |
||||||
|
string(10) "2030322121" |
||||||
|
--- testing: ' 123abc' & '123e5xyz' --- |
||||||
|
string(14) "20303221216061" |
||||||
|
--- testing: ' 123abc' & ' 123abc' --- |
||||||
|
string(14) "20313233616263" |
||||||
|
--- testing: ' 123abc' & '123 abc' --- |
||||||
|
string(14) "20303220616263" |
||||||
|
--- testing: ' 123abc' & '123abc ' --- |
||||||
|
string(14) "20303221606220" |
||||||
|
--- testing: ' 123abc' & '3.4a' --- |
||||||
|
string(8) "20203021" |
||||||
|
--- testing: ' 123abc' & 'a5.9' --- |
||||||
|
string(8) "20312231" |
||||||
|
--- testing: '123 abc' & '0' --- |
||||||
|
string(2) "30" |
||||||
|
--- testing: '123 abc' & '65' --- |
||||||
|
string(4) "3030" |
||||||
|
--- testing: '123 abc' & '-44' --- |
||||||
|
string(6) "213030" |
||||||
|
--- testing: '123 abc' & '1.2' --- |
||||||
|
string(6) "312232" |
||||||
|
--- testing: '123 abc' & '-7.7' --- |
||||||
|
string(8) "21322220" |
||||||
|
--- testing: '123 abc' & 'abc' --- |
||||||
|
string(6) "212223" |
||||||
|
--- testing: '123 abc' & '123abc' --- |
||||||
|
string(12) "313233206062" |
||||||
|
--- testing: '123 abc' & '123e5' --- |
||||||
|
string(10) "3132332021" |
||||||
|
--- testing: '123 abc' & '123e5xyz' --- |
||||||
|
string(14) "31323320216061" |
||||||
|
--- testing: '123 abc' & ' 123abc' --- |
||||||
|
string(14) "20303220616263" |
||||||
|
--- testing: '123 abc' & '123 abc' --- |
||||||
|
string(14) "31323320616263" |
||||||
|
--- testing: '123 abc' & '123abc ' --- |
||||||
|
string(14) "31323320606220" |
||||||
|
--- testing: '123 abc' & '3.4a' --- |
||||||
|
string(8) "31223020" |
||||||
|
--- testing: '123 abc' & 'a5.9' --- |
||||||
|
string(8) "21302220" |
||||||
|
--- testing: '123abc ' & '0' --- |
||||||
|
string(2) "30" |
||||||
|
--- testing: '123abc ' & '65' --- |
||||||
|
string(4) "3030" |
||||||
|
--- testing: '123abc ' & '-44' --- |
||||||
|
string(6) "213030" |
||||||
|
--- testing: '123abc ' & '1.2' --- |
||||||
|
string(6) "312232" |
||||||
|
--- testing: '123abc ' & '-7.7' --- |
||||||
|
string(8) "21322221" |
||||||
|
--- testing: '123abc ' & 'abc' --- |
||||||
|
string(6) "212223" |
||||||
|
--- testing: '123abc ' & '123abc' --- |
||||||
|
string(12) "313233616263" |
||||||
|
--- testing: '123abc ' & '123e5' --- |
||||||
|
string(10) "3132336120" |
||||||
|
--- testing: '123abc ' & '123e5xyz' --- |
||||||
|
string(14) "31323361206020" |
||||||
|
--- testing: '123abc ' & ' 123abc' --- |
||||||
|
string(14) "20303221606220" |
||||||
|
--- testing: '123abc ' & '123 abc' --- |
||||||
|
string(14) "31323320606220" |
||||||
|
--- testing: '123abc ' & '123abc ' --- |
||||||
|
string(14) "31323361626320" |
||||||
|
--- testing: '123abc ' & '3.4a' --- |
||||||
|
string(8) "31223061" |
||||||
|
--- testing: '123abc ' & 'a5.9' --- |
||||||
|
string(8) "21302221" |
||||||
|
--- testing: '3.4a' & '0' --- |
||||||
|
string(2) "30" |
||||||
|
--- testing: '3.4a' & '65' --- |
||||||
|
string(4) "3224" |
||||||
|
--- testing: '3.4a' & '-44' --- |
||||||
|
string(6) "212434" |
||||||
|
--- testing: '3.4a' & '1.2' --- |
||||||
|
string(6) "312e30" |
||||||
|
--- testing: '3.4a' & '-7.7' --- |
||||||
|
string(8) "21262421" |
||||||
|
--- testing: '3.4a' & 'abc' --- |
||||||
|
string(6) "212220" |
||||||
|
--- testing: '3.4a' & '123abc' --- |
||||||
|
string(8) "31223061" |
||||||
|
--- testing: '3.4a' & '123e5' --- |
||||||
|
string(8) "31223061" |
||||||
|
--- testing: '3.4a' & '123e5xyz' --- |
||||||
|
string(8) "31223061" |
||||||
|
--- testing: '3.4a' & ' 123abc' --- |
||||||
|
string(8) "20203021" |
||||||
|
--- testing: '3.4a' & '123 abc' --- |
||||||
|
string(8) "31223020" |
||||||
|
--- testing: '3.4a' & '123abc ' --- |
||||||
|
string(8) "31223061" |
||||||
|
--- testing: '3.4a' & '3.4a' --- |
||||||
|
string(8) "332e3461" |
||||||
|
--- testing: '3.4a' & 'a5.9' --- |
||||||
|
string(8) "21242421" |
||||||
|
--- testing: 'a5.9' & '0' --- |
||||||
|
string(2) "20" |
||||||
|
--- testing: 'a5.9' & '65' --- |
||||||
|
string(4) "2035" |
||||||
|
--- testing: 'a5.9' & '-44' --- |
||||||
|
string(6) "213424" |
||||||
|
--- testing: 'a5.9' & '1.2' --- |
||||||
|
string(6) "212422" |
||||||
|
--- testing: 'a5.9' & '-7.7' --- |
||||||
|
string(8) "21352e31" |
||||||
|
--- testing: 'a5.9' & 'abc' --- |
||||||
|
string(6) "612022" |
||||||
|
--- testing: 'a5.9' & '123abc' --- |
||||||
|
string(8) "21302221" |
||||||
|
--- testing: 'a5.9' & '123e5' --- |
||||||
|
string(8) "21302221" |
||||||
|
--- testing: 'a5.9' & '123e5xyz' --- |
||||||
|
string(8) "21302221" |
||||||
|
--- testing: 'a5.9' & ' 123abc' --- |
||||||
|
string(8) "20312231" |
||||||
|
--- testing: 'a5.9' & '123 abc' --- |
||||||
|
string(8) "21302220" |
||||||
|
--- testing: 'a5.9' & '123abc ' --- |
||||||
|
string(8) "21302221" |
||||||
|
--- testing: 'a5.9' & '3.4a' --- |
||||||
|
string(8) "21242421" |
||||||
|
--- testing: 'a5.9' & 'a5.9' --- |
||||||
|
string(8) "61352e39" |
||||||
@ -0,0 +1,58 @@ |
|||||||
|
--TEST-- |
||||||
|
Test ~N 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.0, MIN_64Bit + 1, MIN_64Bit - 1.0 |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
foreach ($longVals as $longVal) { |
||||||
|
echo "--- testing: $longVal ---\n"; |
||||||
|
var_dump(~$longVal); |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECTF-- |
||||||
|
--- testing: 9223372036854775807 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9223372036854775808 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 2147483647 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -2147483648 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 9223372034707292160 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: -9223372034707292160 --- |
||||||
|
int(9223372034707292159) |
||||||
|
--- testing: 2147483648 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -2147483649 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 4294967294 --- |
||||||
|
int(-4294967295) |
||||||
|
--- testing: 4294967295 --- |
||||||
|
int(-4294967296) |
||||||
|
--- testing: 4294967293 --- |
||||||
|
int(-4294967294) |
||||||
|
--- testing: 9223372036854775806 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 9.2233720368548E+18 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: -9223372036854775807 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: -9.2233720368548E+18 --- |
||||||
|
int(9223372036854775807) |
||||||
@ -0,0 +1,46 @@ |
|||||||
|
--TEST-- |
||||||
|
Test ~N operator : various numbers as strings |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$strVals = array( |
||||||
|
"0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", |
||||||
|
"a5.9" |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
foreach ($strVals as $strVal) { |
||||||
|
echo "--- testing: '$strVal' ---\n"; |
||||||
|
var_dump(bin2hex(~$strVal)); |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: '0' --- |
||||||
|
string(2) "cf" |
||||||
|
--- testing: '65' --- |
||||||
|
string(4) "c9ca" |
||||||
|
--- testing: '-44' --- |
||||||
|
string(6) "d2cbcb" |
||||||
|
--- testing: '1.2' --- |
||||||
|
string(6) "ced1cd" |
||||||
|
--- testing: '-7.7' --- |
||||||
|
string(8) "d2c8d1c8" |
||||||
|
--- testing: 'abc' --- |
||||||
|
string(6) "9e9d9c" |
||||||
|
--- testing: '123abc' --- |
||||||
|
string(12) "cecdcc9e9d9c" |
||||||
|
--- testing: '123e5' --- |
||||||
|
string(10) "cecdcc9aca" |
||||||
|
--- testing: '123e5xyz' --- |
||||||
|
string(16) "cecdcc9aca878685" |
||||||
|
--- testing: ' 123abc' --- |
||||||
|
string(14) "dfcecdcc9e9d9c" |
||||||
|
--- testing: '123 abc' --- |
||||||
|
string(14) "cecdccdf9e9d9c" |
||||||
|
--- testing: '123abc ' --- |
||||||
|
string(14) "cecdcc9e9d9cdf" |
||||||
|
--- testing: '3.4a' --- |
||||||
|
string(8) "ccd1cb9e" |
||||||
|
--- testing: 'a5.9' --- |
||||||
|
string(8) "9ecad1c6" |
||||||
@ -0,0 +1,580 @@ |
|||||||
|
--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.0, MIN_64Bit + 1, MIN_64Bit - 1.0 |
||||||
|
); |
||||||
|
|
||||||
|
$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); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: 9223372036854775807 | 0 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 | 1 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 | -1 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9223372036854775807 | 7 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 | 9 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 | 65 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 | -44 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9223372036854775807 | 2147483647 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 | 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: -9223372036854775808 | 0 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9223372036854775808 | 1 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -9223372036854775808 | -1 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9223372036854775808 | 7 --- |
||||||
|
int(-9223372036854775801) |
||||||
|
--- testing: -9223372036854775808 | 9 --- |
||||||
|
int(-9223372036854775799) |
||||||
|
--- testing: -9223372036854775808 | 65 --- |
||||||
|
int(-9223372036854775743) |
||||||
|
--- testing: -9223372036854775808 | -44 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -9223372036854775808 | 2147483647 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: -9223372036854775808 | 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 2147483647 | 0 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 | 1 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 | -1 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 2147483647 | 7 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 | 9 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 | 65 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 | -44 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 2147483647 | 2147483647 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 | 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: -2147483648 | 0 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -2147483648 | 1 --- |
||||||
|
int(-2147483647) |
||||||
|
--- testing: -2147483648 | -1 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -2147483648 | 7 --- |
||||||
|
int(-2147483641) |
||||||
|
--- testing: -2147483648 | 9 --- |
||||||
|
int(-2147483639) |
||||||
|
--- testing: -2147483648 | 65 --- |
||||||
|
int(-2147483583) |
||||||
|
--- testing: -2147483648 | -44 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -2147483648 | 2147483647 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -2147483648 | 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9223372034707292160 | 0 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 9223372034707292160 | 1 --- |
||||||
|
int(9223372034707292161) |
||||||
|
--- testing: 9223372034707292160 | -1 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9223372034707292160 | 7 --- |
||||||
|
int(9223372034707292167) |
||||||
|
--- testing: 9223372034707292160 | 9 --- |
||||||
|
int(9223372034707292169) |
||||||
|
--- testing: 9223372034707292160 | 65 --- |
||||||
|
int(9223372034707292225) |
||||||
|
--- testing: 9223372034707292160 | -44 --- |
||||||
|
int(-44) |
||||||
|
--- testing: 9223372034707292160 | 2147483647 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372034707292160 | 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: -9223372034707292160 | 0 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: -9223372034707292160 | 1 --- |
||||||
|
int(-9223372034707292159) |
||||||
|
--- testing: -9223372034707292160 | -1 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9223372034707292160 | 7 --- |
||||||
|
int(-9223372034707292153) |
||||||
|
--- testing: -9223372034707292160 | 9 --- |
||||||
|
int(-9223372034707292151) |
||||||
|
--- testing: -9223372034707292160 | 65 --- |
||||||
|
int(-9223372034707292095) |
||||||
|
--- testing: -9223372034707292160 | -44 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -9223372034707292160 | 2147483647 --- |
||||||
|
int(-9223372032559808513) |
||||||
|
--- testing: -9223372034707292160 | 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 2147483648 | 0 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 2147483648 | 1 --- |
||||||
|
int(2147483649) |
||||||
|
--- testing: 2147483648 | -1 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 2147483648 | 7 --- |
||||||
|
int(2147483655) |
||||||
|
--- testing: 2147483648 | 9 --- |
||||||
|
int(2147483657) |
||||||
|
--- testing: 2147483648 | 65 --- |
||||||
|
int(2147483713) |
||||||
|
--- testing: 2147483648 | -44 --- |
||||||
|
int(-44) |
||||||
|
--- testing: 2147483648 | 2147483647 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 2147483648 | 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: -2147483649 | 0 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -2147483649 | 1 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -2147483649 | -1 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -2147483649 | 7 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -2147483649 | 9 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -2147483649 | 65 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -2147483649 | -44 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -2147483649 | 2147483647 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -2147483649 | 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 4294967294 | 0 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 4294967294 | 1 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967294 | -1 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 4294967294 | 7 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967294 | 9 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967294 | 65 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967294 | -44 --- |
||||||
|
int(-2) |
||||||
|
--- testing: 4294967294 | 2147483647 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967294 | 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 4294967295 | 0 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967295 | 1 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967295 | -1 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 4294967295 | 7 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967295 | 9 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967295 | 65 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967295 | -44 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 4294967295 | 2147483647 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967295 | 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 4294967293 | 0 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 4294967293 | 1 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 4294967293 | -1 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 4294967293 | 7 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967293 | 9 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 4294967293 | 65 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 4294967293 | -44 --- |
||||||
|
int(-3) |
||||||
|
--- testing: 4294967293 | 2147483647 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967293 | 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775806 | 0 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 9223372036854775806 | 1 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775806 | -1 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9223372036854775806 | 7 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775806 | 9 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775806 | 65 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775806 | -44 --- |
||||||
|
int(-2) |
||||||
|
--- testing: 9223372036854775806 | 2147483647 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775806 | 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9.2233720368548E+18 | 0 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: 9.2233720368548E+18 | 1 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 9.2233720368548E+18 | -1 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9.2233720368548E+18 | 7 --- |
||||||
|
int(-9223372036854775801) |
||||||
|
--- testing: 9.2233720368548E+18 | 9 --- |
||||||
|
int(-9223372036854775799) |
||||||
|
--- testing: 9.2233720368548E+18 | 65 --- |
||||||
|
int(-9223372036854775743) |
||||||
|
--- testing: 9.2233720368548E+18 | -44 --- |
||||||
|
int(-44) |
||||||
|
--- testing: 9.2233720368548E+18 | 2147483647 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: 9.2233720368548E+18 | 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9223372036854775807 | 0 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -9223372036854775807 | 1 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -9223372036854775807 | -1 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9223372036854775807 | 7 --- |
||||||
|
int(-9223372036854775801) |
||||||
|
--- testing: -9223372036854775807 | 9 --- |
||||||
|
int(-9223372036854775799) |
||||||
|
--- testing: -9223372036854775807 | 65 --- |
||||||
|
int(-9223372036854775743) |
||||||
|
--- testing: -9223372036854775807 | -44 --- |
||||||
|
int(-43) |
||||||
|
--- testing: -9223372036854775807 | 2147483647 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: -9223372036854775807 | 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9.2233720368548E+18 | 0 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9.2233720368548E+18 | 1 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -9.2233720368548E+18 | -1 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9.2233720368548E+18 | 7 --- |
||||||
|
int(-9223372036854775801) |
||||||
|
--- testing: -9.2233720368548E+18 | 9 --- |
||||||
|
int(-9223372036854775799) |
||||||
|
--- testing: -9.2233720368548E+18 | 65 --- |
||||||
|
int(-9223372036854775743) |
||||||
|
--- testing: -9.2233720368548E+18 | -44 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -9.2233720368548E+18 | 2147483647 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: -9.2233720368548E+18 | 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 0 | 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 0 | -9223372036854775808 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: 0 | 2147483647 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 0 | -2147483648 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: 0 | 9223372034707292160 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 0 | -9223372034707292160 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: 0 | 2147483648 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 0 | -2147483649 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: 0 | 4294967294 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 0 | 4294967295 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 0 | 4294967293 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 0 | 9223372036854775806 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 0 | 9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: 0 | -9223372036854775807 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 0 | -9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: 1 | 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 1 | -9223372036854775808 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 1 | 2147483647 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 1 | -2147483648 --- |
||||||
|
int(-2147483647) |
||||||
|
--- testing: 1 | 9223372034707292160 --- |
||||||
|
int(9223372034707292161) |
||||||
|
--- testing: 1 | -9223372034707292160 --- |
||||||
|
int(-9223372034707292159) |
||||||
|
--- testing: 1 | 2147483648 --- |
||||||
|
int(2147483649) |
||||||
|
--- testing: 1 | -2147483649 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: 1 | 4294967294 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 1 | 4294967295 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 1 | 4294967293 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 1 | 9223372036854775806 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 1 | 9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 1 | -9223372036854775807 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 1 | -9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -1 | 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 | -9223372036854775808 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 | 2147483647 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 | -2147483648 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 | 9223372034707292160 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 | -9223372034707292160 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 | 2147483648 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 | -2147483649 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 | 4294967294 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 | 4294967295 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 | 4294967293 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 | 9223372036854775806 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 | 9.2233720368548E+18 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 | -9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 | -9.2233720368548E+18 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 7 | 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 7 | -9223372036854775808 --- |
||||||
|
int(-9223372036854775801) |
||||||
|
--- testing: 7 | 2147483647 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 7 | -2147483648 --- |
||||||
|
int(-2147483641) |
||||||
|
--- testing: 7 | 9223372034707292160 --- |
||||||
|
int(9223372034707292167) |
||||||
|
--- testing: 7 | -9223372034707292160 --- |
||||||
|
int(-9223372034707292153) |
||||||
|
--- testing: 7 | 2147483648 --- |
||||||
|
int(2147483655) |
||||||
|
--- testing: 7 | -2147483649 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: 7 | 4294967294 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 7 | 4294967295 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 7 | 4294967293 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 7 | 9223372036854775806 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 7 | 9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775801) |
||||||
|
--- testing: 7 | -9223372036854775807 --- |
||||||
|
int(-9223372036854775801) |
||||||
|
--- testing: 7 | -9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775801) |
||||||
|
--- testing: 9 | 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9 | -9223372036854775808 --- |
||||||
|
int(-9223372036854775799) |
||||||
|
--- testing: 9 | 2147483647 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 9 | -2147483648 --- |
||||||
|
int(-2147483639) |
||||||
|
--- testing: 9 | 9223372034707292160 --- |
||||||
|
int(9223372034707292169) |
||||||
|
--- testing: 9 | -9223372034707292160 --- |
||||||
|
int(-9223372034707292151) |
||||||
|
--- testing: 9 | 2147483648 --- |
||||||
|
int(2147483657) |
||||||
|
--- testing: 9 | -2147483649 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: 9 | 4294967294 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 9 | 4294967295 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 9 | 4294967293 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 9 | 9223372036854775806 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9 | 9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775799) |
||||||
|
--- testing: 9 | -9223372036854775807 --- |
||||||
|
int(-9223372036854775799) |
||||||
|
--- testing: 9 | -9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775799) |
||||||
|
--- testing: 65 | 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 65 | -9223372036854775808 --- |
||||||
|
int(-9223372036854775743) |
||||||
|
--- testing: 65 | 2147483647 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 65 | -2147483648 --- |
||||||
|
int(-2147483583) |
||||||
|
--- testing: 65 | 9223372034707292160 --- |
||||||
|
int(9223372034707292225) |
||||||
|
--- testing: 65 | -9223372034707292160 --- |
||||||
|
int(-9223372034707292095) |
||||||
|
--- testing: 65 | 2147483648 --- |
||||||
|
int(2147483713) |
||||||
|
--- testing: 65 | -2147483649 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: 65 | 4294967294 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 65 | 4294967295 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 65 | 4294967293 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 65 | 9223372036854775806 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 65 | 9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775743) |
||||||
|
--- testing: 65 | -9223372036854775807 --- |
||||||
|
int(-9223372036854775743) |
||||||
|
--- testing: 65 | -9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775743) |
||||||
|
--- testing: -44 | 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -44 | -9223372036854775808 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 | 2147483647 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -44 | -2147483648 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 | 9223372034707292160 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 | -9223372034707292160 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 | 2147483648 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 | -2147483649 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -44 | 4294967294 --- |
||||||
|
int(-2) |
||||||
|
--- testing: -44 | 4294967295 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -44 | 4294967293 --- |
||||||
|
int(-3) |
||||||
|
--- testing: -44 | 9223372036854775806 --- |
||||||
|
int(-2) |
||||||
|
--- testing: -44 | 9.2233720368548E+18 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 | -9223372036854775807 --- |
||||||
|
int(-43) |
||||||
|
--- testing: -44 | -9.2233720368548E+18 --- |
||||||
|
int(-44) |
||||||
|
--- testing: 2147483647 | 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 2147483647 | -9223372036854775808 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: 2147483647 | 2147483647 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 | -2147483648 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 2147483647 | 9223372034707292160 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 2147483647 | -9223372034707292160 --- |
||||||
|
int(-9223372032559808513) |
||||||
|
--- testing: 2147483647 | 2147483648 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 2147483647 | -2147483649 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: 2147483647 | 4294967294 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 2147483647 | 4294967295 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 2147483647 | 4294967293 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 2147483647 | 9223372036854775806 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 2147483647 | 9.2233720368548E+18 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: 2147483647 | -9223372036854775807 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: 2147483647 | -9.2233720368548E+18 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: 9223372036854775807 | 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 | -9223372036854775808 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9223372036854775807 | 2147483647 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 | -2147483648 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9223372036854775807 | 9223372034707292160 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 | -9223372034707292160 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9223372036854775807 | 2147483648 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 | -2147483649 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9223372036854775807 | 4294967294 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 | 4294967295 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 | 4294967293 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 | 9223372036854775806 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 | 9.2233720368548E+18 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9223372036854775807 | -9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9223372036854775807 | -9.2233720368548E+18 --- |
||||||
|
int(-1) |
||||||
@ -0,0 +1,414 @@ |
|||||||
|
--TEST-- |
||||||
|
Test | operator : various numbers as strings |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$strVals = array( |
||||||
|
"0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", |
||||||
|
"a5.9" |
||||||
|
); |
||||||
|
|
||||||
|
error_reporting(E_ERROR); |
||||||
|
|
||||||
|
foreach ($strVals as $strVal) { |
||||||
|
foreach($strVals as $otherVal) { |
||||||
|
echo "--- testing: '$strVal' | '$otherVal' ---\n"; |
||||||
|
var_dump(bin2hex($strVal|$otherVal)); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: '0' | '0' --- |
||||||
|
string(2) "30" |
||||||
|
--- testing: '0' | '65' --- |
||||||
|
string(4) "3635" |
||||||
|
--- testing: '0' | '-44' --- |
||||||
|
string(6) "3d3434" |
||||||
|
--- testing: '0' | '1.2' --- |
||||||
|
string(6) "312e32" |
||||||
|
--- testing: '0' | '-7.7' --- |
||||||
|
string(8) "3d372e37" |
||||||
|
--- testing: '0' | 'abc' --- |
||||||
|
string(6) "716263" |
||||||
|
--- testing: '0' | '123abc' --- |
||||||
|
string(12) "313233616263" |
||||||
|
--- testing: '0' | '123e5' --- |
||||||
|
string(10) "3132336535" |
||||||
|
--- testing: '0' | '123e5xyz' --- |
||||||
|
string(16) "313233653578797a" |
||||||
|
--- testing: '0' | ' 123abc' --- |
||||||
|
string(14) "30313233616263" |
||||||
|
--- testing: '0' | '123 abc' --- |
||||||
|
string(14) "31323320616263" |
||||||
|
--- testing: '0' | '123abc ' --- |
||||||
|
string(14) "31323361626320" |
||||||
|
--- testing: '0' | '3.4a' --- |
||||||
|
string(8) "332e3461" |
||||||
|
--- testing: '0' | 'a5.9' --- |
||||||
|
string(8) "71352e39" |
||||||
|
--- testing: '65' | '0' --- |
||||||
|
string(4) "3635" |
||||||
|
--- testing: '65' | '65' --- |
||||||
|
string(4) "3635" |
||||||
|
--- testing: '65' | '-44' --- |
||||||
|
string(6) "3f3534" |
||||||
|
--- testing: '65' | '1.2' --- |
||||||
|
string(6) "373f32" |
||||||
|
--- testing: '65' | '-7.7' --- |
||||||
|
string(8) "3f372e37" |
||||||
|
--- testing: '65' | 'abc' --- |
||||||
|
string(6) "777763" |
||||||
|
--- testing: '65' | '123abc' --- |
||||||
|
string(12) "373733616263" |
||||||
|
--- testing: '65' | '123e5' --- |
||||||
|
string(10) "3737336535" |
||||||
|
--- testing: '65' | '123e5xyz' --- |
||||||
|
string(16) "373733653578797a" |
||||||
|
--- testing: '65' | ' 123abc' --- |
||||||
|
string(14) "36353233616263" |
||||||
|
--- testing: '65' | '123 abc' --- |
||||||
|
string(14) "37373320616263" |
||||||
|
--- testing: '65' | '123abc ' --- |
||||||
|
string(14) "37373361626320" |
||||||
|
--- testing: '65' | '3.4a' --- |
||||||
|
string(8) "373f3461" |
||||||
|
--- testing: '65' | 'a5.9' --- |
||||||
|
string(8) "77352e39" |
||||||
|
--- testing: '-44' | '0' --- |
||||||
|
string(6) "3d3434" |
||||||
|
--- testing: '-44' | '65' --- |
||||||
|
string(6) "3f3534" |
||||||
|
--- testing: '-44' | '-44' --- |
||||||
|
string(6) "2d3434" |
||||||
|
--- testing: '-44' | '1.2' --- |
||||||
|
string(6) "3d3e36" |
||||||
|
--- testing: '-44' | '-7.7' --- |
||||||
|
string(8) "2d373e37" |
||||||
|
--- testing: '-44' | 'abc' --- |
||||||
|
string(6) "6d7677" |
||||||
|
--- testing: '-44' | '123abc' --- |
||||||
|
string(12) "3d3637616263" |
||||||
|
--- testing: '-44' | '123e5' --- |
||||||
|
string(10) "3d36376535" |
||||||
|
--- testing: '-44' | '123e5xyz' --- |
||||||
|
string(16) "3d3637653578797a" |
||||||
|
--- testing: '-44' | ' 123abc' --- |
||||||
|
string(14) "2d353633616263" |
||||||
|
--- testing: '-44' | '123 abc' --- |
||||||
|
string(14) "3d363720616263" |
||||||
|
--- testing: '-44' | '123abc ' --- |
||||||
|
string(14) "3d363761626320" |
||||||
|
--- testing: '-44' | '3.4a' --- |
||||||
|
string(8) "3f3e3461" |
||||||
|
--- testing: '-44' | 'a5.9' --- |
||||||
|
string(8) "6d353e39" |
||||||
|
--- testing: '1.2' | '0' --- |
||||||
|
string(6) "312e32" |
||||||
|
--- testing: '1.2' | '65' --- |
||||||
|
string(6) "373f32" |
||||||
|
--- testing: '1.2' | '-44' --- |
||||||
|
string(6) "3d3e36" |
||||||
|
--- testing: '1.2' | '1.2' --- |
||||||
|
string(6) "312e32" |
||||||
|
--- testing: '1.2' | '-7.7' --- |
||||||
|
string(8) "3d3f3e37" |
||||||
|
--- testing: '1.2' | 'abc' --- |
||||||
|
string(6) "716e73" |
||||||
|
--- testing: '1.2' | '123abc' --- |
||||||
|
string(12) "313e33616263" |
||||||
|
--- testing: '1.2' | '123e5' --- |
||||||
|
string(10) "313e336535" |
||||||
|
--- testing: '1.2' | '123e5xyz' --- |
||||||
|
string(16) "313e33653578797a" |
||||||
|
--- testing: '1.2' | ' 123abc' --- |
||||||
|
string(14) "313f3233616263" |
||||||
|
--- testing: '1.2' | '123 abc' --- |
||||||
|
string(14) "313e3320616263" |
||||||
|
--- testing: '1.2' | '123abc ' --- |
||||||
|
string(14) "313e3361626320" |
||||||
|
--- testing: '1.2' | '3.4a' --- |
||||||
|
string(8) "332e3661" |
||||||
|
--- testing: '1.2' | 'a5.9' --- |
||||||
|
string(8) "713f3e39" |
||||||
|
--- testing: '-7.7' | '0' --- |
||||||
|
string(8) "3d372e37" |
||||||
|
--- testing: '-7.7' | '65' --- |
||||||
|
string(8) "3f372e37" |
||||||
|
--- testing: '-7.7' | '-44' --- |
||||||
|
string(8) "2d373e37" |
||||||
|
--- testing: '-7.7' | '1.2' --- |
||||||
|
string(8) "3d3f3e37" |
||||||
|
--- testing: '-7.7' | '-7.7' --- |
||||||
|
string(8) "2d372e37" |
||||||
|
--- testing: '-7.7' | 'abc' --- |
||||||
|
string(8) "6d776f37" |
||||||
|
--- testing: '-7.7' | '123abc' --- |
||||||
|
string(12) "3d373f776263" |
||||||
|
--- testing: '-7.7' | '123e5' --- |
||||||
|
string(10) "3d373f7735" |
||||||
|
--- testing: '-7.7' | '123e5xyz' --- |
||||||
|
string(16) "3d373f773578797a" |
||||||
|
--- testing: '-7.7' | ' 123abc' --- |
||||||
|
string(14) "2d373e37616263" |
||||||
|
--- testing: '-7.7' | '123 abc' --- |
||||||
|
string(14) "3d373f37616263" |
||||||
|
--- testing: '-7.7' | '123abc ' --- |
||||||
|
string(14) "3d373f77626320" |
||||||
|
--- testing: '-7.7' | '3.4a' --- |
||||||
|
string(8) "3f3f3e77" |
||||||
|
--- testing: '-7.7' | 'a5.9' --- |
||||||
|
string(8) "6d372e3f" |
||||||
|
--- testing: 'abc' | '0' --- |
||||||
|
string(6) "716263" |
||||||
|
--- testing: 'abc' | '65' --- |
||||||
|
string(6) "777763" |
||||||
|
--- testing: 'abc' | '-44' --- |
||||||
|
string(6) "6d7677" |
||||||
|
--- testing: 'abc' | '1.2' --- |
||||||
|
string(6) "716e73" |
||||||
|
--- testing: 'abc' | '-7.7' --- |
||||||
|
string(8) "6d776f37" |
||||||
|
--- testing: 'abc' | 'abc' --- |
||||||
|
string(6) "616263" |
||||||
|
--- testing: 'abc' | '123abc' --- |
||||||
|
string(12) "717273616263" |
||||||
|
--- testing: 'abc' | '123e5' --- |
||||||
|
string(10) "7172736535" |
||||||
|
--- testing: 'abc' | '123e5xyz' --- |
||||||
|
string(16) "717273653578797a" |
||||||
|
--- testing: 'abc' | ' 123abc' --- |
||||||
|
string(14) "61737333616263" |
||||||
|
--- testing: 'abc' | '123 abc' --- |
||||||
|
string(14) "71727320616263" |
||||||
|
--- testing: 'abc' | '123abc ' --- |
||||||
|
string(14) "71727361626320" |
||||||
|
--- testing: 'abc' | '3.4a' --- |
||||||
|
string(8) "736e7761" |
||||||
|
--- testing: 'abc' | 'a5.9' --- |
||||||
|
string(8) "61776f39" |
||||||
|
--- testing: '123abc' | '0' --- |
||||||
|
string(12) "313233616263" |
||||||
|
--- testing: '123abc' | '65' --- |
||||||
|
string(12) "373733616263" |
||||||
|
--- testing: '123abc' | '-44' --- |
||||||
|
string(12) "3d3637616263" |
||||||
|
--- testing: '123abc' | '1.2' --- |
||||||
|
string(12) "313e33616263" |
||||||
|
--- testing: '123abc' | '-7.7' --- |
||||||
|
string(12) "3d373f776263" |
||||||
|
--- testing: '123abc' | 'abc' --- |
||||||
|
string(12) "717273616263" |
||||||
|
--- testing: '123abc' | '123abc' --- |
||||||
|
string(12) "313233616263" |
||||||
|
--- testing: '123abc' | '123e5' --- |
||||||
|
string(12) "313233657763" |
||||||
|
--- testing: '123abc' | '123e5xyz' --- |
||||||
|
string(16) "31323365777b797a" |
||||||
|
--- testing: '123abc' | ' 123abc' --- |
||||||
|
string(14) "31333373636363" |
||||||
|
--- testing: '123abc' | '123 abc' --- |
||||||
|
string(14) "31323361636363" |
||||||
|
--- testing: '123abc' | '123abc ' --- |
||||||
|
string(14) "31323361626320" |
||||||
|
--- testing: '123abc' | '3.4a' --- |
||||||
|
string(12) "333e37616263" |
||||||
|
--- testing: '123abc' | 'a5.9' --- |
||||||
|
string(12) "71373f796263" |
||||||
|
--- testing: '123e5' | '0' --- |
||||||
|
string(10) "3132336535" |
||||||
|
--- testing: '123e5' | '65' --- |
||||||
|
string(10) "3737336535" |
||||||
|
--- testing: '123e5' | '-44' --- |
||||||
|
string(10) "3d36376535" |
||||||
|
--- testing: '123e5' | '1.2' --- |
||||||
|
string(10) "313e336535" |
||||||
|
--- testing: '123e5' | '-7.7' --- |
||||||
|
string(10) "3d373f7735" |
||||||
|
--- testing: '123e5' | 'abc' --- |
||||||
|
string(10) "7172736535" |
||||||
|
--- testing: '123e5' | '123abc' --- |
||||||
|
string(12) "313233657763" |
||||||
|
--- testing: '123e5' | '123e5' --- |
||||||
|
string(10) "3132336535" |
||||||
|
--- testing: '123e5' | '123e5xyz' --- |
||||||
|
string(16) "313233653578797a" |
||||||
|
--- testing: '123e5' | ' 123abc' --- |
||||||
|
string(14) "31333377756263" |
||||||
|
--- testing: '123e5' | '123 abc' --- |
||||||
|
string(14) "31323365756263" |
||||||
|
--- testing: '123e5' | '123abc ' --- |
||||||
|
string(14) "31323365776320" |
||||||
|
--- testing: '123e5' | '3.4a' --- |
||||||
|
string(10) "333e376535" |
||||||
|
--- testing: '123e5' | 'a5.9' --- |
||||||
|
string(10) "71373f7d35" |
||||||
|
--- testing: '123e5xyz' | '0' --- |
||||||
|
string(16) "313233653578797a" |
||||||
|
--- testing: '123e5xyz' | '65' --- |
||||||
|
string(16) "373733653578797a" |
||||||
|
--- testing: '123e5xyz' | '-44' --- |
||||||
|
string(16) "3d3637653578797a" |
||||||
|
--- testing: '123e5xyz' | '1.2' --- |
||||||
|
string(16) "313e33653578797a" |
||||||
|
--- testing: '123e5xyz' | '-7.7' --- |
||||||
|
string(16) "3d373f773578797a" |
||||||
|
--- testing: '123e5xyz' | 'abc' --- |
||||||
|
string(16) "717273653578797a" |
||||||
|
--- testing: '123e5xyz' | '123abc' --- |
||||||
|
string(16) "31323365777b797a" |
||||||
|
--- testing: '123e5xyz' | '123e5' --- |
||||||
|
string(16) "313233653578797a" |
||||||
|
--- testing: '123e5xyz' | '123e5xyz' --- |
||||||
|
string(16) "313233653578797a" |
||||||
|
--- testing: '123e5xyz' | ' 123abc' --- |
||||||
|
string(16) "31333377757a7b7a" |
||||||
|
--- testing: '123e5xyz' | '123 abc' --- |
||||||
|
string(16) "31323365757a7b7a" |
||||||
|
--- testing: '123e5xyz' | '123abc ' --- |
||||||
|
string(16) "31323365777b797a" |
||||||
|
--- testing: '123e5xyz' | '3.4a' --- |
||||||
|
string(16) "333e37653578797a" |
||||||
|
--- testing: '123e5xyz' | 'a5.9' --- |
||||||
|
string(16) "71373f7d3578797a" |
||||||
|
--- testing: ' 123abc' | '0' --- |
||||||
|
string(14) "30313233616263" |
||||||
|
--- testing: ' 123abc' | '65' --- |
||||||
|
string(14) "36353233616263" |
||||||
|
--- testing: ' 123abc' | '-44' --- |
||||||
|
string(14) "2d353633616263" |
||||||
|
--- testing: ' 123abc' | '1.2' --- |
||||||
|
string(14) "313f3233616263" |
||||||
|
--- testing: ' 123abc' | '-7.7' --- |
||||||
|
string(14) "2d373e37616263" |
||||||
|
--- testing: ' 123abc' | 'abc' --- |
||||||
|
string(14) "61737333616263" |
||||||
|
--- testing: ' 123abc' | '123abc' --- |
||||||
|
string(14) "31333373636363" |
||||||
|
--- testing: ' 123abc' | '123e5' --- |
||||||
|
string(14) "31333377756263" |
||||||
|
--- testing: ' 123abc' | '123e5xyz' --- |
||||||
|
string(16) "31333377757a7b7a" |
||||||
|
--- testing: ' 123abc' | ' 123abc' --- |
||||||
|
string(14) "20313233616263" |
||||||
|
--- testing: ' 123abc' | '123 abc' --- |
||||||
|
string(14) "31333333616263" |
||||||
|
--- testing: ' 123abc' | '123abc ' --- |
||||||
|
string(14) "31333373636363" |
||||||
|
--- testing: ' 123abc' | '3.4a' --- |
||||||
|
string(14) "333f3673616263" |
||||||
|
--- testing: ' 123abc' | 'a5.9' --- |
||||||
|
string(14) "61353e3b616263" |
||||||
|
--- testing: '123 abc' | '0' --- |
||||||
|
string(14) "31323320616263" |
||||||
|
--- testing: '123 abc' | '65' --- |
||||||
|
string(14) "37373320616263" |
||||||
|
--- testing: '123 abc' | '-44' --- |
||||||
|
string(14) "3d363720616263" |
||||||
|
--- testing: '123 abc' | '1.2' --- |
||||||
|
string(14) "313e3320616263" |
||||||
|
--- testing: '123 abc' | '-7.7' --- |
||||||
|
string(14) "3d373f37616263" |
||||||
|
--- testing: '123 abc' | 'abc' --- |
||||||
|
string(14) "71727320616263" |
||||||
|
--- testing: '123 abc' | '123abc' --- |
||||||
|
string(14) "31323361636363" |
||||||
|
--- testing: '123 abc' | '123e5' --- |
||||||
|
string(14) "31323365756263" |
||||||
|
--- testing: '123 abc' | '123e5xyz' --- |
||||||
|
string(16) "31323365757a7b7a" |
||||||
|
--- testing: '123 abc' | ' 123abc' --- |
||||||
|
string(14) "31333333616263" |
||||||
|
--- testing: '123 abc' | '123 abc' --- |
||||||
|
string(14) "31323320616263" |
||||||
|
--- testing: '123 abc' | '123abc ' --- |
||||||
|
string(14) "31323361636363" |
||||||
|
--- testing: '123 abc' | '3.4a' --- |
||||||
|
string(14) "333e3761616263" |
||||||
|
--- testing: '123 abc' | 'a5.9' --- |
||||||
|
string(14) "71373f39616263" |
||||||
|
--- testing: '123abc ' | '0' --- |
||||||
|
string(14) "31323361626320" |
||||||
|
--- testing: '123abc ' | '65' --- |
||||||
|
string(14) "37373361626320" |
||||||
|
--- testing: '123abc ' | '-44' --- |
||||||
|
string(14) "3d363761626320" |
||||||
|
--- testing: '123abc ' | '1.2' --- |
||||||
|
string(14) "313e3361626320" |
||||||
|
--- testing: '123abc ' | '-7.7' --- |
||||||
|
string(14) "3d373f77626320" |
||||||
|
--- testing: '123abc ' | 'abc' --- |
||||||
|
string(14) "71727361626320" |
||||||
|
--- testing: '123abc ' | '123abc' --- |
||||||
|
string(14) "31323361626320" |
||||||
|
--- testing: '123abc ' | '123e5' --- |
||||||
|
string(14) "31323365776320" |
||||||
|
--- testing: '123abc ' | '123e5xyz' --- |
||||||
|
string(16) "31323365777b797a" |
||||||
|
--- testing: '123abc ' | ' 123abc' --- |
||||||
|
string(14) "31333373636363" |
||||||
|
--- testing: '123abc ' | '123 abc' --- |
||||||
|
string(14) "31323361636363" |
||||||
|
--- testing: '123abc ' | '123abc ' --- |
||||||
|
string(14) "31323361626320" |
||||||
|
--- testing: '123abc ' | '3.4a' --- |
||||||
|
string(14) "333e3761626320" |
||||||
|
--- testing: '123abc ' | 'a5.9' --- |
||||||
|
string(14) "71373f79626320" |
||||||
|
--- testing: '3.4a' | '0' --- |
||||||
|
string(8) "332e3461" |
||||||
|
--- testing: '3.4a' | '65' --- |
||||||
|
string(8) "373f3461" |
||||||
|
--- testing: '3.4a' | '-44' --- |
||||||
|
string(8) "3f3e3461" |
||||||
|
--- testing: '3.4a' | '1.2' --- |
||||||
|
string(8) "332e3661" |
||||||
|
--- testing: '3.4a' | '-7.7' --- |
||||||
|
string(8) "3f3f3e77" |
||||||
|
--- testing: '3.4a' | 'abc' --- |
||||||
|
string(8) "736e7761" |
||||||
|
--- testing: '3.4a' | '123abc' --- |
||||||
|
string(12) "333e37616263" |
||||||
|
--- testing: '3.4a' | '123e5' --- |
||||||
|
string(10) "333e376535" |
||||||
|
--- testing: '3.4a' | '123e5xyz' --- |
||||||
|
string(16) "333e37653578797a" |
||||||
|
--- testing: '3.4a' | ' 123abc' --- |
||||||
|
string(14) "333f3673616263" |
||||||
|
--- testing: '3.4a' | '123 abc' --- |
||||||
|
string(14) "333e3761616263" |
||||||
|
--- testing: '3.4a' | '123abc ' --- |
||||||
|
string(14) "333e3761626320" |
||||||
|
--- testing: '3.4a' | '3.4a' --- |
||||||
|
string(8) "332e3461" |
||||||
|
--- testing: '3.4a' | 'a5.9' --- |
||||||
|
string(8) "733f3e79" |
||||||
|
--- testing: 'a5.9' | '0' --- |
||||||
|
string(8) "71352e39" |
||||||
|
--- testing: 'a5.9' | '65' --- |
||||||
|
string(8) "77352e39" |
||||||
|
--- testing: 'a5.9' | '-44' --- |
||||||
|
string(8) "6d353e39" |
||||||
|
--- testing: 'a5.9' | '1.2' --- |
||||||
|
string(8) "713f3e39" |
||||||
|
--- testing: 'a5.9' | '-7.7' --- |
||||||
|
string(8) "6d372e3f" |
||||||
|
--- testing: 'a5.9' | 'abc' --- |
||||||
|
string(8) "61776f39" |
||||||
|
--- testing: 'a5.9' | '123abc' --- |
||||||
|
string(12) "71373f796263" |
||||||
|
--- testing: 'a5.9' | '123e5' --- |
||||||
|
string(10) "71373f7d35" |
||||||
|
--- testing: 'a5.9' | '123e5xyz' --- |
||||||
|
string(16) "71373f7d3578797a" |
||||||
|
--- testing: 'a5.9' | ' 123abc' --- |
||||||
|
string(14) "61353e3b616263" |
||||||
|
--- testing: 'a5.9' | '123 abc' --- |
||||||
|
string(14) "71373f39616263" |
||||||
|
--- testing: 'a5.9' | '123abc ' --- |
||||||
|
string(14) "71373f79626320" |
||||||
|
--- testing: 'a5.9' | '3.4a' --- |
||||||
|
string(8) "733f3e79" |
||||||
|
--- testing: 'a5.9' | 'a5.9' --- |
||||||
|
string(8) "61352e39" |
||||||
@ -0,0 +1,589 @@ |
|||||||
|
--TEST-- |
||||||
|
Test << operator : 64bit long tests |
||||||
|
--SKIPIF-- |
||||||
|
<?php die("skip");?> |
||||||
|
<?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"; |
||||||
|
try { |
||||||
|
var_dump($longVal<<$otherVal); |
||||||
|
} catch (ArithmeticError $e) { |
||||||
|
echo "Exception: " . $e->getMessage() . "\n"; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
foreach ($otherVals as $otherVal) { |
||||||
|
foreach($longVals as $longVal) { |
||||||
|
echo "--- testing: $otherVal << $longVal ---\n"; |
||||||
|
try { |
||||||
|
var_dump($otherVal<<$longVal); |
||||||
|
} catch (ArithmeticError $e) { |
||||||
|
echo "Exception: " . $e->getMessage() . "\n"; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: 9223372036854775807 << 0 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 << 1 --- |
||||||
|
int(-2) |
||||||
|
--- testing: 9223372036854775807 << -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775807 << 7 --- |
||||||
|
int(-128) |
||||||
|
--- testing: 9223372036854775807 << 9 --- |
||||||
|
int(-512) |
||||||
|
--- testing: 9223372036854775807 << 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 << -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775807 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 << 0 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9223372036854775808 << 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 << -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -9223372036854775808 << 7 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 << 9 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 << 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 << -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -9223372036854775808 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 << 0 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 << 1 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 2147483647 << -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483647 << 7 --- |
||||||
|
int(274877906816) |
||||||
|
--- testing: 2147483647 << 9 --- |
||||||
|
int(1099511627264) |
||||||
|
--- testing: 2147483647 << 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 << -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483647 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483648 << 0 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -2147483648 << 1 --- |
||||||
|
int(-4294967296) |
||||||
|
--- testing: -2147483648 << -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -2147483648 << 7 --- |
||||||
|
int(-274877906944) |
||||||
|
--- testing: -2147483648 << 9 --- |
||||||
|
int(-1099511627776) |
||||||
|
--- testing: -2147483648 << 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483648 << -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -2147483648 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483648 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372034707292160 << 0 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 9223372034707292160 << 1 --- |
||||||
|
int(-4294967296) |
||||||
|
--- testing: 9223372034707292160 << -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372034707292160 << 7 --- |
||||||
|
int(-274877906944) |
||||||
|
--- testing: 9223372034707292160 << 9 --- |
||||||
|
int(-1099511627776) |
||||||
|
--- testing: 9223372034707292160 << 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372034707292160 << -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372034707292160 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372034707292160 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372034707292160 << 0 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: -9223372034707292160 << 1 --- |
||||||
|
int(4294967296) |
||||||
|
--- testing: -9223372034707292160 << -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -9223372034707292160 << 7 --- |
||||||
|
int(274877906944) |
||||||
|
--- testing: -9223372034707292160 << 9 --- |
||||||
|
int(1099511627776) |
||||||
|
--- testing: -9223372034707292160 << 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372034707292160 << -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -9223372034707292160 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372034707292160 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483648 << 0 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 2147483648 << 1 --- |
||||||
|
int(4294967296) |
||||||
|
--- testing: 2147483648 << -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483648 << 7 --- |
||||||
|
int(274877906944) |
||||||
|
--- testing: 2147483648 << 9 --- |
||||||
|
int(1099511627776) |
||||||
|
--- testing: 2147483648 << 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483648 << -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483648 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483648 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483649 << 0 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -2147483649 << 1 --- |
||||||
|
int(-4294967298) |
||||||
|
--- testing: -2147483649 << -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -2147483649 << 7 --- |
||||||
|
int(-274877907072) |
||||||
|
--- testing: -2147483649 << 9 --- |
||||||
|
int(-1099511628288) |
||||||
|
--- testing: -2147483649 << 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483649 << -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -2147483649 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483649 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967294 << 0 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 4294967294 << 1 --- |
||||||
|
int(8589934588) |
||||||
|
--- testing: 4294967294 << -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 4294967294 << 7 --- |
||||||
|
int(549755813632) |
||||||
|
--- testing: 4294967294 << 9 --- |
||||||
|
int(2199023254528) |
||||||
|
--- testing: 4294967294 << 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967294 << -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 4294967294 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967294 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967295 << 0 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967295 << 1 --- |
||||||
|
int(8589934590) |
||||||
|
--- testing: 4294967295 << -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 4294967295 << 7 --- |
||||||
|
int(549755813760) |
||||||
|
--- testing: 4294967295 << 9 --- |
||||||
|
int(2199023255040) |
||||||
|
--- testing: 4294967295 << 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967295 << -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 4294967295 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967295 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967293 << 0 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 4294967293 << 1 --- |
||||||
|
int(8589934586) |
||||||
|
--- testing: 4294967293 << -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 4294967293 << 7 --- |
||||||
|
int(549755813504) |
||||||
|
--- testing: 4294967293 << 9 --- |
||||||
|
int(2199023254016) |
||||||
|
--- testing: 4294967293 << 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967293 << -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 4294967293 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967293 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775806 << 0 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 9223372036854775806 << 1 --- |
||||||
|
int(-4) |
||||||
|
--- testing: 9223372036854775806 << -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775806 << 7 --- |
||||||
|
int(-256) |
||||||
|
--- testing: 9223372036854775806 << 9 --- |
||||||
|
int(-1024) |
||||||
|
--- testing: 9223372036854775806 << 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775806 << -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- 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 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- 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 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- 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 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -9223372036854775807 << 7 --- |
||||||
|
int(128) |
||||||
|
--- testing: -9223372036854775807 << 9 --- |
||||||
|
int(512) |
||||||
|
--- testing: -9223372036854775807 << 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775807 << -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -9223372036854775807 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775807 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9.2233720368548E+18 << 0 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9.2233720368548E+18 << 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9.2233720368548E+18 << -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- 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 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -9.2233720368548E+18 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9.2233720368548E+18 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 0 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 0 << -9223372036854775808 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 0 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 0 << -2147483648 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 0 << 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 0 << -9223372034707292160 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 0 << 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 0 << -2147483649 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- 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 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 0 << -9223372036854775807 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 0 << -9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 1 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 << -9223372036854775808 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 1 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 << -2147483648 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 1 << 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 << -9223372034707292160 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 1 << 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 << -2147483649 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 1 << 4294967294 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 << 4294967295 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 << 4294967293 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 << 9223372036854775806 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 << 9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 1 << -9223372036854775807 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 1 << -9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -1 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: -1 << -9223372036854775808 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -1 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: -1 << -2147483648 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -1 << 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: -1 << -9223372034707292160 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -1 << 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: -1 << -2147483649 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -1 << 4294967294 --- |
||||||
|
int(0) |
||||||
|
--- testing: -1 << 4294967295 --- |
||||||
|
int(0) |
||||||
|
--- testing: -1 << 4294967293 --- |
||||||
|
int(0) |
||||||
|
--- testing: -1 << 9223372036854775806 --- |
||||||
|
int(0) |
||||||
|
--- testing: -1 << 9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -1 << -9223372036854775807 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -1 << -9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 7 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 << -9223372036854775808 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 7 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 << -2147483648 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 7 << 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 << -9223372034707292160 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 7 << 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 << -2147483649 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 7 << 4294967294 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 << 4294967295 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 << 4294967293 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 << 9223372036854775806 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 << 9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 7 << -9223372036854775807 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 7 << -9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 << -9223372036854775808 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 << -2147483648 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9 << 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 << -9223372034707292160 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9 << 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 << -2147483649 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9 << 4294967294 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 << 4294967295 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 << 4294967293 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 << 9223372036854775806 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 << 9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9 << -9223372036854775807 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9 << -9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 65 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 << -9223372036854775808 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 65 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 << -2147483648 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 65 << 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 << -9223372034707292160 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 65 << 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 << -2147483649 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 65 << 4294967294 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 << 4294967295 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 << 4294967293 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 << 9223372036854775806 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 << 9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 65 << -9223372036854775807 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 65 << -9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -44 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: -44 << -9223372036854775808 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -44 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: -44 << -2147483648 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -44 << 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: -44 << -9223372034707292160 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -44 << 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: -44 << -2147483649 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -44 << 4294967294 --- |
||||||
|
int(0) |
||||||
|
--- testing: -44 << 4294967295 --- |
||||||
|
int(0) |
||||||
|
--- testing: -44 << 4294967293 --- |
||||||
|
int(0) |
||||||
|
--- testing: -44 << 9223372036854775806 --- |
||||||
|
int(0) |
||||||
|
--- testing: -44 << 9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -44 << -9223372036854775807 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -44 << -9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483647 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 << -9223372036854775808 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483647 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 << -2147483648 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483647 << 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 << -9223372034707292160 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483647 << 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 << -2147483649 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483647 << 4294967294 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 << 4294967295 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 << 4294967293 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 << 9223372036854775806 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 << 9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483647 << -9223372036854775807 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483647 << -9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775807 << 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 << -9223372036854775808 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775807 << 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 << -2147483648 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775807 << 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 << -9223372034707292160 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775807 << 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 << -2147483649 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775807 << 4294967294 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 << 4294967295 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 << 4294967293 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 << 9223372036854775806 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 << 9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775807 << -9223372036854775807 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775807 << -9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
@ -0,0 +1,419 @@ |
|||||||
|
--TEST-- |
||||||
|
Test << operator : various numbers as strings |
||||||
|
--SKIPIF-- |
||||||
|
<?php die("skip");?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$strVals = array( |
||||||
|
"0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", |
||||||
|
"a5.9" |
||||||
|
); |
||||||
|
|
||||||
|
error_reporting(E_ERROR); |
||||||
|
|
||||||
|
foreach ($strVals as $strVal) { |
||||||
|
foreach($strVals as $otherVal) { |
||||||
|
echo "--- testing: '$strVal' << '$otherVal' ---\n"; |
||||||
|
try { |
||||||
|
var_dump($strVal<<$otherVal); |
||||||
|
} catch (Throwable $e) { |
||||||
|
echo get_class($e) . ': ' . $e->getMessage() . "\n"; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: '0' << '0' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '0' << '1.2' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '0' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '0' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << '3.4a' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '65' << '0' --- |
||||||
|
int(65) |
||||||
|
--- testing: '65' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '65' << '1.2' --- |
||||||
|
int(130) |
||||||
|
--- testing: '65' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '65' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '65' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' << '3.4a' --- |
||||||
|
int(520) |
||||||
|
--- testing: '65' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '-44' << '0' --- |
||||||
|
int(-44) |
||||||
|
--- testing: '-44' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-44' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '-44' << '1.2' --- |
||||||
|
int(-88) |
||||||
|
--- testing: '-44' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '-44' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '-44' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-44' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-44' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-44' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-44' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-44' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-44' << '3.4a' --- |
||||||
|
int(-352) |
||||||
|
--- testing: '-44' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '1.2' << '0' --- |
||||||
|
int(1) |
||||||
|
--- testing: '1.2' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '1.2' << '1.2' --- |
||||||
|
int(2) |
||||||
|
--- testing: '1.2' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '1.2' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '1.2' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' << '3.4a' --- |
||||||
|
int(8) |
||||||
|
--- testing: '1.2' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '-7.7' << '0' --- |
||||||
|
int(-7) |
||||||
|
--- testing: '-7.7' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-7.7' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '-7.7' << '1.2' --- |
||||||
|
int(-14) |
||||||
|
--- testing: '-7.7' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '-7.7' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '-7.7' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-7.7' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-7.7' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-7.7' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-7.7' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-7.7' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-7.7' << '3.4a' --- |
||||||
|
int(-56) |
||||||
|
--- testing: '-7.7' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '0' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '65' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '-44' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '1.2' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '-7.7' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '123abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '123e5' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '123e5xyz' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << ' 123abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '123 abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '123abc ' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '3.4a' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123abc' << '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123abc' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123abc' << '1.2' --- |
||||||
|
int(246) |
||||||
|
--- testing: '123abc' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123abc' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123abc' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' << '3.4a' --- |
||||||
|
int(984) |
||||||
|
--- testing: '123abc' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123e5' << '0' --- |
||||||
|
int(12300000) |
||||||
|
--- testing: '123e5' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123e5' << '1.2' --- |
||||||
|
int(24600000) |
||||||
|
--- testing: '123e5' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123e5' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123e5' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' << '3.4a' --- |
||||||
|
int(98400000) |
||||||
|
--- testing: '123e5' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123e5xyz' << '0' --- |
||||||
|
int(12300000) |
||||||
|
--- testing: '123e5xyz' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123e5xyz' << '1.2' --- |
||||||
|
int(24600000) |
||||||
|
--- testing: '123e5xyz' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123e5xyz' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123e5xyz' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' << '3.4a' --- |
||||||
|
int(98400000) |
||||||
|
--- testing: '123e5xyz' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: ' 123abc' << '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: ' 123abc' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: ' 123abc' << '1.2' --- |
||||||
|
int(246) |
||||||
|
--- testing: ' 123abc' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: ' 123abc' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: ' 123abc' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' << '3.4a' --- |
||||||
|
int(984) |
||||||
|
--- testing: ' 123abc' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123 abc' << '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123 abc' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123 abc' << '1.2' --- |
||||||
|
int(246) |
||||||
|
--- testing: '123 abc' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123 abc' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123 abc' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' << '3.4a' --- |
||||||
|
int(984) |
||||||
|
--- testing: '123 abc' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123abc ' << '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123abc ' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123abc ' << '1.2' --- |
||||||
|
int(246) |
||||||
|
--- testing: '123abc ' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123abc ' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123abc ' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' << '3.4a' --- |
||||||
|
int(984) |
||||||
|
--- testing: '123abc ' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '3.4a' << '0' --- |
||||||
|
int(3) |
||||||
|
--- testing: '3.4a' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '3.4a' << '1.2' --- |
||||||
|
int(6) |
||||||
|
--- testing: '3.4a' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '3.4a' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '3.4a' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' << '3.4a' --- |
||||||
|
int(24) |
||||||
|
--- testing: '3.4a' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '0' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '65' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '-44' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '1.2' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '-7.7' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '123abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '123e5' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '123e5xyz' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << ' 123abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '123 abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '123abc ' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '3.4a' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
--TEST-- |
||||||
|
Test << operator : numbers as strings, simple |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
error_reporting(E_ERROR); |
||||||
|
|
||||||
|
var_dump("12" << "0"); |
||||||
|
var_dump("34" << "1"); |
||||||
|
var_dump("56" << "2"); |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
int(12) |
||||||
|
int(68) |
||||||
|
int(224) |
||||||
@ -0,0 +1,423 @@ |
|||||||
|
--TEST-- |
||||||
|
Test << operator : various numbers as strings |
||||||
|
--SKIPIF-- |
||||||
|
<?php die("skip");?> |
||||||
|
<?php |
||||||
|
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); |
||||||
|
?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$strVals = array( |
||||||
|
"0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", |
||||||
|
"a5.9" |
||||||
|
); |
||||||
|
|
||||||
|
error_reporting(E_ERROR); |
||||||
|
|
||||||
|
foreach ($strVals as $strVal) { |
||||||
|
foreach($strVals as $otherVal) { |
||||||
|
echo "--- testing: '$strVal' << '$otherVal' ---\n"; |
||||||
|
try { |
||||||
|
var_dump($strVal<<$otherVal); |
||||||
|
} catch (\Throwable $e) { |
||||||
|
echo get_class($e) . ': ' . $e->getMessage() . "\n"; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: '0' << '0' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '0' << '1.2' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '0' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '0' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << '3.4a' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '65' << '0' --- |
||||||
|
int(65) |
||||||
|
--- testing: '65' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '65' << '1.2' --- |
||||||
|
int(130) |
||||||
|
--- testing: '65' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '65' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '65' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' << '3.4a' --- |
||||||
|
int(520) |
||||||
|
--- testing: '65' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '-44' << '0' --- |
||||||
|
int(-44) |
||||||
|
--- testing: '-44' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-44' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '-44' << '1.2' --- |
||||||
|
int(-88) |
||||||
|
--- testing: '-44' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '-44' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '-44' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-44' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-44' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-44' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-44' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-44' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-44' << '3.4a' --- |
||||||
|
int(-352) |
||||||
|
--- testing: '-44' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '1.2' << '0' --- |
||||||
|
int(1) |
||||||
|
--- testing: '1.2' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '1.2' << '1.2' --- |
||||||
|
int(2) |
||||||
|
--- testing: '1.2' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '1.2' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '1.2' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' << '3.4a' --- |
||||||
|
int(8) |
||||||
|
--- testing: '1.2' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '-7.7' << '0' --- |
||||||
|
int(-7) |
||||||
|
--- testing: '-7.7' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-7.7' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '-7.7' << '1.2' --- |
||||||
|
int(-14) |
||||||
|
--- testing: '-7.7' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '-7.7' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '-7.7' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-7.7' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-7.7' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-7.7' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-7.7' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-7.7' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-7.7' << '3.4a' --- |
||||||
|
int(-56) |
||||||
|
--- testing: '-7.7' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '0' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '65' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '-44' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '1.2' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '-7.7' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '123abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '123e5' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '123e5xyz' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << ' 123abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '123 abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '123abc ' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << '3.4a' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'abc' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123abc' << '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123abc' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123abc' << '1.2' --- |
||||||
|
int(246) |
||||||
|
--- testing: '123abc' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123abc' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123abc' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' << '3.4a' --- |
||||||
|
int(984) |
||||||
|
--- testing: '123abc' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123e5' << '0' --- |
||||||
|
int(12300000) |
||||||
|
--- testing: '123e5' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123e5' << '1.2' --- |
||||||
|
int(24600000) |
||||||
|
--- testing: '123e5' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123e5' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123e5' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' << '3.4a' --- |
||||||
|
int(98400000) |
||||||
|
--- testing: '123e5' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123e5xyz' << '0' --- |
||||||
|
int(12300000) |
||||||
|
--- testing: '123e5xyz' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123e5xyz' << '1.2' --- |
||||||
|
int(24600000) |
||||||
|
--- testing: '123e5xyz' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123e5xyz' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123e5xyz' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' << '3.4a' --- |
||||||
|
int(98400000) |
||||||
|
--- testing: '123e5xyz' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: ' 123abc' << '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: ' 123abc' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: ' 123abc' << '1.2' --- |
||||||
|
int(246) |
||||||
|
--- testing: ' 123abc' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: ' 123abc' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: ' 123abc' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' << '3.4a' --- |
||||||
|
int(984) |
||||||
|
--- testing: ' 123abc' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123 abc' << '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123 abc' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123 abc' << '1.2' --- |
||||||
|
int(246) |
||||||
|
--- testing: '123 abc' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123 abc' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123 abc' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' << '3.4a' --- |
||||||
|
int(984) |
||||||
|
--- testing: '123 abc' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123abc ' << '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123abc ' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123abc ' << '1.2' --- |
||||||
|
int(246) |
||||||
|
--- testing: '123abc ' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123abc ' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '123abc ' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' << '3.4a' --- |
||||||
|
int(984) |
||||||
|
--- testing: '123abc ' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '3.4a' << '0' --- |
||||||
|
int(3) |
||||||
|
--- testing: '3.4a' << '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' << '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '3.4a' << '1.2' --- |
||||||
|
int(6) |
||||||
|
--- testing: '3.4a' << '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '3.4a' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: '3.4a' << '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' << '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' << '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' << ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' << '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' << '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' << '3.4a' --- |
||||||
|
int(24) |
||||||
|
--- testing: '3.4a' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '0' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '65' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '-44' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '1.2' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '-7.7' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '123abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '123e5' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '123e5xyz' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << ' 123abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '123 abc' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '123abc ' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << '3.4a' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
|
--- testing: 'a5.9' << 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string << string |
||||||
@ -0,0 +1,589 @@ |
|||||||
|
--TEST-- |
||||||
|
Test >> operator : 64bit long tests |
||||||
|
--SKIPIF-- |
||||||
|
<?php die("skip");?> |
||||||
|
<?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"; |
||||||
|
try { |
||||||
|
var_dump($longVal>>$otherVal); |
||||||
|
} catch (ArithmeticError $e) { |
||||||
|
echo "Exception: " . $e->getMessage() . "\n"; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
foreach ($otherVals as $otherVal) { |
||||||
|
foreach($longVals as $longVal) { |
||||||
|
echo "--- testing: $otherVal >> $longVal ---\n"; |
||||||
|
try { |
||||||
|
var_dump($otherVal>>$longVal); |
||||||
|
} catch (ArithmeticError $e) { |
||||||
|
echo "Exception: " . $e->getMessage() . "\n"; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: 9223372036854775807 >> 0 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 >> 1 --- |
||||||
|
int(4611686018427387903) |
||||||
|
--- testing: 9223372036854775807 >> -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775807 >> 7 --- |
||||||
|
int(72057594037927935) |
||||||
|
--- testing: 9223372036854775807 >> 9 --- |
||||||
|
int(18014398509481983) |
||||||
|
--- testing: 9223372036854775807 >> 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 >> -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775807 >> 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 >> 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 >> 0 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9223372036854775808 >> 1 --- |
||||||
|
int(-4611686018427387904) |
||||||
|
--- testing: -9223372036854775808 >> -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -9223372036854775808 >> 7 --- |
||||||
|
int(-72057594037927936) |
||||||
|
--- testing: -9223372036854775808 >> 9 --- |
||||||
|
int(-18014398509481984) |
||||||
|
--- testing: -9223372036854775808 >> 65 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9223372036854775808 >> -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -9223372036854775808 >> 2147483647 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9223372036854775808 >> 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 2147483647 >> 0 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 >> 1 --- |
||||||
|
int(1073741823) |
||||||
|
--- testing: 2147483647 >> -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483647 >> 7 --- |
||||||
|
int(16777215) |
||||||
|
--- testing: 2147483647 >> 9 --- |
||||||
|
int(4194303) |
||||||
|
--- testing: 2147483647 >> 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 >> -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483647 >> 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 >> 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483648 >> 0 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -2147483648 >> 1 --- |
||||||
|
int(-1073741824) |
||||||
|
--- testing: -2147483648 >> -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -2147483648 >> 7 --- |
||||||
|
int(-16777216) |
||||||
|
--- testing: -2147483648 >> 9 --- |
||||||
|
int(-4194304) |
||||||
|
--- testing: -2147483648 >> 65 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -2147483648 >> -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -2147483648 >> 2147483647 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -2147483648 >> 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9223372034707292160 >> 0 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 9223372034707292160 >> 1 --- |
||||||
|
int(4611686017353646080) |
||||||
|
--- testing: 9223372034707292160 >> -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372034707292160 >> 7 --- |
||||||
|
int(72057594021150720) |
||||||
|
--- testing: 9223372034707292160 >> 9 --- |
||||||
|
int(18014398505287680) |
||||||
|
--- testing: 9223372034707292160 >> 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372034707292160 >> -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372034707292160 >> 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372034707292160 >> 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372034707292160 >> 0 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: -9223372034707292160 >> 1 --- |
||||||
|
int(-4611686017353646080) |
||||||
|
--- testing: -9223372034707292160 >> -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -9223372034707292160 >> 7 --- |
||||||
|
int(-72057594021150720) |
||||||
|
--- testing: -9223372034707292160 >> 9 --- |
||||||
|
int(-18014398505287680) |
||||||
|
--- testing: -9223372034707292160 >> 65 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9223372034707292160 >> -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -9223372034707292160 >> 2147483647 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9223372034707292160 >> 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 2147483648 >> 0 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 2147483648 >> 1 --- |
||||||
|
int(1073741824) |
||||||
|
--- testing: 2147483648 >> -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483648 >> 7 --- |
||||||
|
int(16777216) |
||||||
|
--- testing: 2147483648 >> 9 --- |
||||||
|
int(4194304) |
||||||
|
--- testing: 2147483648 >> 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483648 >> -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483648 >> 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483648 >> 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483649 >> 0 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -2147483649 >> 1 --- |
||||||
|
int(-1073741825) |
||||||
|
--- testing: -2147483649 >> -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -2147483649 >> 7 --- |
||||||
|
int(-16777217) |
||||||
|
--- testing: -2147483649 >> 9 --- |
||||||
|
int(-4194305) |
||||||
|
--- testing: -2147483649 >> 65 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -2147483649 >> -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -2147483649 >> 2147483647 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -2147483649 >> 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 4294967294 >> 0 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 4294967294 >> 1 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 4294967294 >> -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 4294967294 >> 7 --- |
||||||
|
int(33554431) |
||||||
|
--- testing: 4294967294 >> 9 --- |
||||||
|
int(8388607) |
||||||
|
--- testing: 4294967294 >> 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967294 >> -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 4294967294 >> 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967294 >> 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967295 >> 0 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967295 >> 1 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 4294967295 >> -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 4294967295 >> 7 --- |
||||||
|
int(33554431) |
||||||
|
--- testing: 4294967295 >> 9 --- |
||||||
|
int(8388607) |
||||||
|
--- testing: 4294967295 >> 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967295 >> -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 4294967295 >> 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967295 >> 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967293 >> 0 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 4294967293 >> 1 --- |
||||||
|
int(2147483646) |
||||||
|
--- testing: 4294967293 >> -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 4294967293 >> 7 --- |
||||||
|
int(33554431) |
||||||
|
--- testing: 4294967293 >> 9 --- |
||||||
|
int(8388607) |
||||||
|
--- testing: 4294967293 >> 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967293 >> -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 4294967293 >> 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967293 >> 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775806 >> 0 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 9223372036854775806 >> 1 --- |
||||||
|
int(4611686018427387903) |
||||||
|
--- testing: 9223372036854775806 >> -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775806 >> 7 --- |
||||||
|
int(72057594037927935) |
||||||
|
--- testing: 9223372036854775806 >> 9 --- |
||||||
|
int(18014398509481983) |
||||||
|
--- testing: 9223372036854775806 >> 65 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775806 >> -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775806 >> 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775806 >> 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9.2233720368548E+18 >> 0 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: 9.2233720368548E+18 >> 1 --- |
||||||
|
int(-4611686018427387904) |
||||||
|
--- testing: 9.2233720368548E+18 >> -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9.2233720368548E+18 >> 7 --- |
||||||
|
int(-72057594037927936) |
||||||
|
--- testing: 9.2233720368548E+18 >> 9 --- |
||||||
|
int(-18014398509481984) |
||||||
|
--- testing: 9.2233720368548E+18 >> 65 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9.2233720368548E+18 >> -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9.2233720368548E+18 >> 2147483647 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9.2233720368548E+18 >> 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9223372036854775807 >> 0 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -9223372036854775807 >> 1 --- |
||||||
|
int(-4611686018427387904) |
||||||
|
--- testing: -9223372036854775807 >> -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -9223372036854775807 >> 7 --- |
||||||
|
int(-72057594037927936) |
||||||
|
--- testing: -9223372036854775807 >> 9 --- |
||||||
|
int(-18014398509481984) |
||||||
|
--- testing: -9223372036854775807 >> 65 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9223372036854775807 >> -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -9223372036854775807 >> 2147483647 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9223372036854775807 >> 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9.2233720368548E+18 >> 0 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9.2233720368548E+18 >> 1 --- |
||||||
|
int(-4611686018427387904) |
||||||
|
--- testing: -9.2233720368548E+18 >> -1 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -9.2233720368548E+18 >> 7 --- |
||||||
|
int(-72057594037927936) |
||||||
|
--- testing: -9.2233720368548E+18 >> 9 --- |
||||||
|
int(-18014398509481984) |
||||||
|
--- testing: -9.2233720368548E+18 >> 65 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9.2233720368548E+18 >> -44 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -9.2233720368548E+18 >> 2147483647 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9.2233720368548E+18 >> 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 0 >> 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 0 >> -9223372036854775808 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 0 >> 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 0 >> -2147483648 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 0 >> 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 0 >> -9223372034707292160 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 0 >> 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 0 >> -2147483649 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- 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 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 0 >> -9223372036854775807 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 0 >> -9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 1 >> 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 >> -9223372036854775808 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 1 >> 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 >> -2147483648 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 1 >> 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 >> -9223372034707292160 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 1 >> 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 >> -2147483649 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 1 >> 4294967294 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 >> 4294967295 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 >> 4294967293 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 >> 9223372036854775806 --- |
||||||
|
int(0) |
||||||
|
--- testing: 1 >> 9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 1 >> -9223372036854775807 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 1 >> -9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -1 >> 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 >> -9223372036854775808 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -1 >> 2147483647 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 >> -2147483648 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -1 >> 9223372034707292160 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 >> -9223372034707292160 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -1 >> 2147483648 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 >> -2147483649 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -1 >> 4294967294 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 >> 4294967295 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 >> 4294967293 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 >> 9223372036854775806 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 >> 9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -1 >> -9223372036854775807 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -1 >> -9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 7 >> 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 >> -9223372036854775808 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 7 >> 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 >> -2147483648 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 7 >> 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 >> -9223372034707292160 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 7 >> 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 >> -2147483649 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 7 >> 4294967294 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 >> 4294967295 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 >> 4294967293 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 >> 9223372036854775806 --- |
||||||
|
int(0) |
||||||
|
--- testing: 7 >> 9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 7 >> -9223372036854775807 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 7 >> -9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9 >> 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 >> -9223372036854775808 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9 >> 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 >> -2147483648 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9 >> 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 >> -9223372034707292160 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9 >> 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 >> -2147483649 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9 >> 4294967294 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 >> 4294967295 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 >> 4294967293 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 >> 9223372036854775806 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9 >> 9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9 >> -9223372036854775807 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9 >> -9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 65 >> 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 >> -9223372036854775808 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 65 >> 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 >> -2147483648 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 65 >> 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 >> -9223372034707292160 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 65 >> 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 >> -2147483649 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 65 >> 4294967294 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 >> 4294967295 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 >> 4294967293 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 >> 9223372036854775806 --- |
||||||
|
int(0) |
||||||
|
--- testing: 65 >> 9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 65 >> -9223372036854775807 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 65 >> -9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -44 >> 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -44 >> -9223372036854775808 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -44 >> 2147483647 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -44 >> -2147483648 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -44 >> 9223372034707292160 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -44 >> -9223372034707292160 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -44 >> 2147483648 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -44 >> -2147483649 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -44 >> 4294967294 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -44 >> 4294967295 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -44 >> 4294967293 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -44 >> 9223372036854775806 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -44 >> 9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -44 >> -9223372036854775807 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: -44 >> -9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483647 >> 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 >> -9223372036854775808 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483647 >> 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 >> -2147483648 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483647 >> 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 >> -9223372034707292160 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483647 >> 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 >> -2147483649 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483647 >> 4294967294 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 >> 4294967295 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 >> 4294967293 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 >> 9223372036854775806 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 >> 9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483647 >> -9223372036854775807 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 2147483647 >> -9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775807 >> 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 >> -9223372036854775808 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775807 >> 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 >> -2147483648 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775807 >> 9223372034707292160 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 >> -9223372034707292160 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775807 >> 2147483648 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 >> -2147483649 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775807 >> 4294967294 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 >> 4294967295 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 >> 4294967293 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 >> 9223372036854775806 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 >> 9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775807 >> -9223372036854775807 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
|
--- testing: 9223372036854775807 >> -9.2233720368548E+18 --- |
||||||
|
Exception: Bit shift by negative number |
||||||
@ -0,0 +1,420 @@ |
|||||||
|
--TEST-- |
||||||
|
Test >> operator : various numbers as strings |
||||||
|
--SKIPIF-- |
||||||
|
<?php die("skip");?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$strVals = array( |
||||||
|
"0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", |
||||||
|
"a5.9" |
||||||
|
); |
||||||
|
|
||||||
|
error_reporting(E_ERROR); |
||||||
|
|
||||||
|
foreach ($strVals as $strVal) { |
||||||
|
foreach($strVals as $otherVal) { |
||||||
|
echo "--- testing: '$strVal' >> '$otherVal' ---\n"; |
||||||
|
try { |
||||||
|
var_dump($strVal>>$otherVal); |
||||||
|
} catch (\Throwable $e) { |
||||||
|
echo get_class($e) . ': ' . $e->getMessage() . "\n"; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: '0' >> '0' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' >> '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' >> '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '0' >> '1.2' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' >> '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '0' >> 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '0' >> '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' >> '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' >> '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' >> ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' >> '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' >> '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' >> '3.4a' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' >> 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '65' >> '0' --- |
||||||
|
int(65) |
||||||
|
--- testing: '65' >> '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' >> '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '65' >> '1.2' --- |
||||||
|
int(32) |
||||||
|
--- testing: '65' >> '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '65' >> 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '65' >> '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' >> '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' >> '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' >> ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' >> '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' >> '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' >> '3.4a' --- |
||||||
|
int(8) |
||||||
|
--- testing: '65' >> 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '-44' >> '0' --- |
||||||
|
int(-44) |
||||||
|
--- testing: '-44' >> '65' --- |
||||||
|
int(-1) |
||||||
|
--- testing: '-44' >> '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '-44' >> '1.2' --- |
||||||
|
int(-22) |
||||||
|
--- testing: '-44' >> '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '-44' >> 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '-44' >> '123abc' --- |
||||||
|
int(-1) |
||||||
|
--- testing: '-44' >> '123e5' --- |
||||||
|
int(-1) |
||||||
|
--- testing: '-44' >> '123e5xyz' --- |
||||||
|
int(-1) |
||||||
|
--- testing: '-44' >> ' 123abc' --- |
||||||
|
int(-1) |
||||||
|
--- testing: '-44' >> '123 abc' --- |
||||||
|
int(-1) |
||||||
|
--- testing: '-44' >> '123abc ' --- |
||||||
|
int(-1) |
||||||
|
--- testing: '-44' >> '3.4a' --- |
||||||
|
int(-6) |
||||||
|
--- testing: '-44' >> 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '1.2' >> '0' --- |
||||||
|
int(1) |
||||||
|
--- testing: '1.2' >> '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' >> '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '1.2' >> '1.2' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' >> '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '1.2' >> 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '1.2' >> '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' >> '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' >> '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' >> ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' >> '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' >> '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' >> '3.4a' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' >> 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '-7.7' >> '0' --- |
||||||
|
int(-7) |
||||||
|
--- testing: '-7.7' >> '65' --- |
||||||
|
int(-1) |
||||||
|
--- testing: '-7.7' >> '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '-7.7' >> '1.2' --- |
||||||
|
int(-4) |
||||||
|
--- testing: '-7.7' >> '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '-7.7' >> 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '-7.7' >> '123abc' --- |
||||||
|
int(-1) |
||||||
|
--- testing: '-7.7' >> '123e5' --- |
||||||
|
int(-1) |
||||||
|
--- testing: '-7.7' >> '123e5xyz' --- |
||||||
|
int(-1) |
||||||
|
--- testing: '-7.7' >> ' 123abc' --- |
||||||
|
int(-1) |
||||||
|
--- testing: '-7.7' >> '123 abc' --- |
||||||
|
int(-1) |
||||||
|
--- testing: '-7.7' >> '123abc ' --- |
||||||
|
int(-1) |
||||||
|
--- testing: '-7.7' >> '3.4a' --- |
||||||
|
int(-1) |
||||||
|
--- testing: '-7.7' >> 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'abc' >> '0' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'abc' >> '65' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'abc' >> '-44' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'abc' >> '1.2' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'abc' >> '-7.7' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'abc' >> 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'abc' >> '123abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'abc' >> '123e5' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'abc' >> '123e5xyz' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'abc' >> ' 123abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'abc' >> '123 abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'abc' >> '123abc ' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'abc' >> '3.4a' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'abc' >> 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '123abc' >> '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123abc' >> '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' >> '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123abc' >> '1.2' --- |
||||||
|
int(61) |
||||||
|
--- testing: '123abc' >> '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123abc' >> 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '123abc' >> '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' >> '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' >> '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' >> ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' >> '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' >> '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' >> '3.4a' --- |
||||||
|
int(15) |
||||||
|
--- testing: '123abc' >> 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '123e5' >> '0' --- |
||||||
|
int(12300000) |
||||||
|
--- testing: '123e5' >> '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' >> '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123e5' >> '1.2' --- |
||||||
|
int(6150000) |
||||||
|
--- testing: '123e5' >> '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123e5' >> 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '123e5' >> '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' >> '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' >> '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' >> ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' >> '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' >> '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' >> '3.4a' --- |
||||||
|
int(1537500) |
||||||
|
--- testing: '123e5' >> 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '123e5xyz' >> '0' --- |
||||||
|
int(12300000) |
||||||
|
--- testing: '123e5xyz' >> '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' >> '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123e5xyz' >> '1.2' --- |
||||||
|
int(6150000) |
||||||
|
--- testing: '123e5xyz' >> '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123e5xyz' >> 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '123e5xyz' >> '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' >> '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' >> '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' >> ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' >> '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' >> '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' >> '3.4a' --- |
||||||
|
int(1537500) |
||||||
|
--- testing: '123e5xyz' >> 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: ' 123abc' >> '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: ' 123abc' >> '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' >> '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: ' 123abc' >> '1.2' --- |
||||||
|
int(61) |
||||||
|
--- testing: ' 123abc' >> '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: ' 123abc' >> 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: ' 123abc' >> '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' >> '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' >> '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' >> ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' >> '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' >> '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' >> '3.4a' --- |
||||||
|
int(15) |
||||||
|
--- testing: ' 123abc' >> 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '123 abc' >> '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123 abc' >> '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' >> '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123 abc' >> '1.2' --- |
||||||
|
int(61) |
||||||
|
--- testing: '123 abc' >> '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123 abc' >> 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '123 abc' >> '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' >> '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' >> '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' >> ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' >> '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' >> '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' >> '3.4a' --- |
||||||
|
int(15) |
||||||
|
--- testing: '123 abc' >> 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '123abc ' >> '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123abc ' >> '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' >> '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123abc ' >> '1.2' --- |
||||||
|
int(61) |
||||||
|
--- testing: '123abc ' >> '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '123abc ' >> 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '123abc ' >> '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' >> '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' >> '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' >> ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' >> '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' >> '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' >> '3.4a' --- |
||||||
|
int(15) |
||||||
|
--- testing: '123abc ' >> 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '3.4a' >> '0' --- |
||||||
|
int(3) |
||||||
|
--- testing: '3.4a' >> '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' >> '-44' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '3.4a' >> '1.2' --- |
||||||
|
int(1) |
||||||
|
--- testing: '3.4a' >> '-7.7' --- |
||||||
|
ArithmeticError: Bit shift by negative number |
||||||
|
--- testing: '3.4a' >> 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: '3.4a' >> '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' >> '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' >> '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' >> ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' >> '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' >> '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' >> '3.4a' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' >> 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'a5.9' >> '0' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'a5.9' >> '65' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'a5.9' >> '-44' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'a5.9' >> '1.2' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'a5.9' >> '-7.7' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'a5.9' >> 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'a5.9' >> '123abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'a5.9' >> '123e5' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'a5.9' >> '123e5xyz' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'a5.9' >> ' 123abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'a5.9' >> '123 abc' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'a5.9' >> '123abc ' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'a5.9' >> '3.4a' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
|
--- testing: 'a5.9' >> 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string >> string |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
--TEST-- |
||||||
|
Test >> operator : numbers as strings, simple |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
error_reporting(E_ERROR); |
||||||
|
|
||||||
|
var_dump("12" >> "0"); |
||||||
|
var_dump("34" >> "1"); |
||||||
|
var_dump("56" >> "2"); |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
int(12) |
||||||
|
int(17) |
||||||
|
int(14) |
||||||
@ -0,0 +1,580 @@ |
|||||||
|
--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.0, MIN_64Bit + 1, MIN_64Bit - 1.0 |
||||||
|
); |
||||||
|
|
||||||
|
$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); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: 9223372036854775807 ^ 0 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 ^ 1 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 9223372036854775807 ^ -1 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: 9223372036854775807 ^ 7 --- |
||||||
|
int(9223372036854775800) |
||||||
|
--- testing: 9223372036854775807 ^ 9 --- |
||||||
|
int(9223372036854775798) |
||||||
|
--- testing: 9223372036854775807 ^ 65 --- |
||||||
|
int(9223372036854775742) |
||||||
|
--- testing: 9223372036854775807 ^ -44 --- |
||||||
|
int(-9223372036854775765) |
||||||
|
--- testing: 9223372036854775807 ^ 2147483647 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 9223372036854775807 ^ 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 ^ 0 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9223372036854775808 ^ 1 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -9223372036854775808 ^ -1 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: -9223372036854775808 ^ 7 --- |
||||||
|
int(-9223372036854775801) |
||||||
|
--- testing: -9223372036854775808 ^ 9 --- |
||||||
|
int(-9223372036854775799) |
||||||
|
--- testing: -9223372036854775808 ^ 65 --- |
||||||
|
int(-9223372036854775743) |
||||||
|
--- testing: -9223372036854775808 ^ -44 --- |
||||||
|
int(9223372036854775764) |
||||||
|
--- testing: -9223372036854775808 ^ 2147483647 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: -9223372036854775808 ^ 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 2147483647 ^ 0 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 ^ 1 --- |
||||||
|
int(2147483646) |
||||||
|
--- testing: 2147483647 ^ -1 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: 2147483647 ^ 7 --- |
||||||
|
int(2147483640) |
||||||
|
--- testing: 2147483647 ^ 9 --- |
||||||
|
int(2147483638) |
||||||
|
--- testing: 2147483647 ^ 65 --- |
||||||
|
int(2147483582) |
||||||
|
--- testing: 2147483647 ^ -44 --- |
||||||
|
int(-2147483605) |
||||||
|
--- testing: 2147483647 ^ 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 ^ 9223372036854775807 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: -2147483648 ^ 0 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -2147483648 ^ 1 --- |
||||||
|
int(-2147483647) |
||||||
|
--- testing: -2147483648 ^ -1 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: -2147483648 ^ 7 --- |
||||||
|
int(-2147483641) |
||||||
|
--- testing: -2147483648 ^ 9 --- |
||||||
|
int(-2147483639) |
||||||
|
--- testing: -2147483648 ^ 65 --- |
||||||
|
int(-2147483583) |
||||||
|
--- testing: -2147483648 ^ -44 --- |
||||||
|
int(2147483604) |
||||||
|
--- testing: -2147483648 ^ 2147483647 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -2147483648 ^ 9223372036854775807 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: 9223372034707292160 ^ 0 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 9223372034707292160 ^ 1 --- |
||||||
|
int(9223372034707292161) |
||||||
|
--- testing: 9223372034707292160 ^ -1 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: 9223372034707292160 ^ 7 --- |
||||||
|
int(9223372034707292167) |
||||||
|
--- testing: 9223372034707292160 ^ 9 --- |
||||||
|
int(9223372034707292169) |
||||||
|
--- testing: 9223372034707292160 ^ 65 --- |
||||||
|
int(9223372034707292225) |
||||||
|
--- testing: 9223372034707292160 ^ -44 --- |
||||||
|
int(-9223372034707292204) |
||||||
|
--- testing: 9223372034707292160 ^ 2147483647 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372034707292160 ^ 9223372036854775807 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: -9223372034707292160 ^ 0 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: -9223372034707292160 ^ 1 --- |
||||||
|
int(-9223372034707292159) |
||||||
|
--- testing: -9223372034707292160 ^ -1 --- |
||||||
|
int(9223372034707292159) |
||||||
|
--- testing: -9223372034707292160 ^ 7 --- |
||||||
|
int(-9223372034707292153) |
||||||
|
--- testing: -9223372034707292160 ^ 9 --- |
||||||
|
int(-9223372034707292151) |
||||||
|
--- testing: -9223372034707292160 ^ 65 --- |
||||||
|
int(-9223372034707292095) |
||||||
|
--- testing: -9223372034707292160 ^ -44 --- |
||||||
|
int(9223372034707292116) |
||||||
|
--- testing: -9223372034707292160 ^ 2147483647 --- |
||||||
|
int(-9223372032559808513) |
||||||
|
--- testing: -9223372034707292160 ^ 9223372036854775807 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: 2147483648 ^ 0 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 2147483648 ^ 1 --- |
||||||
|
int(2147483649) |
||||||
|
--- testing: 2147483648 ^ -1 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: 2147483648 ^ 7 --- |
||||||
|
int(2147483655) |
||||||
|
--- testing: 2147483648 ^ 9 --- |
||||||
|
int(2147483657) |
||||||
|
--- testing: 2147483648 ^ 65 --- |
||||||
|
int(2147483713) |
||||||
|
--- testing: 2147483648 ^ -44 --- |
||||||
|
int(-2147483692) |
||||||
|
--- testing: 2147483648 ^ 2147483647 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 2147483648 ^ 9223372036854775807 --- |
||||||
|
int(9223372034707292159) |
||||||
|
--- testing: -2147483649 ^ 0 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -2147483649 ^ 1 --- |
||||||
|
int(-2147483650) |
||||||
|
--- testing: -2147483649 ^ -1 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: -2147483649 ^ 7 --- |
||||||
|
int(-2147483656) |
||||||
|
--- testing: -2147483649 ^ 9 --- |
||||||
|
int(-2147483658) |
||||||
|
--- testing: -2147483649 ^ 65 --- |
||||||
|
int(-2147483714) |
||||||
|
--- testing: -2147483649 ^ -44 --- |
||||||
|
int(2147483691) |
||||||
|
--- testing: -2147483649 ^ 2147483647 --- |
||||||
|
int(-4294967296) |
||||||
|
--- testing: -2147483649 ^ 9223372036854775807 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: 4294967294 ^ 0 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 4294967294 ^ 1 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967294 ^ -1 --- |
||||||
|
int(-4294967295) |
||||||
|
--- testing: 4294967294 ^ 7 --- |
||||||
|
int(4294967289) |
||||||
|
--- testing: 4294967294 ^ 9 --- |
||||||
|
int(4294967287) |
||||||
|
--- testing: 4294967294 ^ 65 --- |
||||||
|
int(4294967231) |
||||||
|
--- testing: 4294967294 ^ -44 --- |
||||||
|
int(-4294967254) |
||||||
|
--- testing: 4294967294 ^ 2147483647 --- |
||||||
|
int(2147483649) |
||||||
|
--- testing: 4294967294 ^ 9223372036854775807 --- |
||||||
|
int(9223372032559808513) |
||||||
|
--- testing: 4294967295 ^ 0 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967295 ^ 1 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 4294967295 ^ -1 --- |
||||||
|
int(-4294967296) |
||||||
|
--- testing: 4294967295 ^ 7 --- |
||||||
|
int(4294967288) |
||||||
|
--- testing: 4294967295 ^ 9 --- |
||||||
|
int(4294967286) |
||||||
|
--- testing: 4294967295 ^ 65 --- |
||||||
|
int(4294967230) |
||||||
|
--- testing: 4294967295 ^ -44 --- |
||||||
|
int(-4294967253) |
||||||
|
--- testing: 4294967295 ^ 2147483647 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 4294967295 ^ 9223372036854775807 --- |
||||||
|
int(9223372032559808512) |
||||||
|
--- testing: 4294967293 ^ 0 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 4294967293 ^ 1 --- |
||||||
|
int(4294967292) |
||||||
|
--- testing: 4294967293 ^ -1 --- |
||||||
|
int(-4294967294) |
||||||
|
--- testing: 4294967293 ^ 7 --- |
||||||
|
int(4294967290) |
||||||
|
--- testing: 4294967293 ^ 9 --- |
||||||
|
int(4294967284) |
||||||
|
--- testing: 4294967293 ^ 65 --- |
||||||
|
int(4294967228) |
||||||
|
--- testing: 4294967293 ^ -44 --- |
||||||
|
int(-4294967255) |
||||||
|
--- testing: 4294967293 ^ 2147483647 --- |
||||||
|
int(2147483650) |
||||||
|
--- testing: 4294967293 ^ 9223372036854775807 --- |
||||||
|
int(9223372032559808514) |
||||||
|
--- testing: 9223372036854775806 ^ 0 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 9223372036854775806 ^ 1 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775806 ^ -1 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 9223372036854775806 ^ 7 --- |
||||||
|
int(9223372036854775801) |
||||||
|
--- testing: 9223372036854775806 ^ 9 --- |
||||||
|
int(9223372036854775799) |
||||||
|
--- testing: 9223372036854775806 ^ 65 --- |
||||||
|
int(9223372036854775743) |
||||||
|
--- testing: 9223372036854775806 ^ -44 --- |
||||||
|
int(-9223372036854775766) |
||||||
|
--- testing: 9223372036854775806 ^ 2147483647 --- |
||||||
|
int(9223372034707292161) |
||||||
|
--- testing: 9223372036854775806 ^ 9223372036854775807 --- |
||||||
|
int(1) |
||||||
|
--- testing: 9.2233720368548E+18 ^ 0 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: 9.2233720368548E+18 ^ 1 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 9.2233720368548E+18 ^ -1 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9.2233720368548E+18 ^ 7 --- |
||||||
|
int(-9223372036854775801) |
||||||
|
--- testing: 9.2233720368548E+18 ^ 9 --- |
||||||
|
int(-9223372036854775799) |
||||||
|
--- testing: 9.2233720368548E+18 ^ 65 --- |
||||||
|
int(-9223372036854775743) |
||||||
|
--- testing: 9.2233720368548E+18 ^ -44 --- |
||||||
|
int(9223372036854775764) |
||||||
|
--- testing: 9.2233720368548E+18 ^ 2147483647 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: 9.2233720368548E+18 ^ 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9223372036854775807 ^ 0 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -9223372036854775807 ^ 1 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9223372036854775807 ^ -1 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: -9223372036854775807 ^ 7 --- |
||||||
|
int(-9223372036854775802) |
||||||
|
--- testing: -9223372036854775807 ^ 9 --- |
||||||
|
int(-9223372036854775800) |
||||||
|
--- testing: -9223372036854775807 ^ 65 --- |
||||||
|
int(-9223372036854775744) |
||||||
|
--- testing: -9223372036854775807 ^ -44 --- |
||||||
|
int(9223372036854775765) |
||||||
|
--- testing: -9223372036854775807 ^ 2147483647 --- |
||||||
|
int(-9223372034707292162) |
||||||
|
--- testing: -9223372036854775807 ^ 9223372036854775807 --- |
||||||
|
int(-2) |
||||||
|
--- testing: -9.2233720368548E+18 ^ 0 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9.2233720368548E+18 ^ 1 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -9.2233720368548E+18 ^ -1 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: -9.2233720368548E+18 ^ 7 --- |
||||||
|
int(-9223372036854775801) |
||||||
|
--- testing: -9.2233720368548E+18 ^ 9 --- |
||||||
|
int(-9223372036854775799) |
||||||
|
--- testing: -9.2233720368548E+18 ^ 65 --- |
||||||
|
int(-9223372036854775743) |
||||||
|
--- testing: -9.2233720368548E+18 ^ -44 --- |
||||||
|
int(9223372036854775764) |
||||||
|
--- testing: -9.2233720368548E+18 ^ 2147483647 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: -9.2233720368548E+18 ^ 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 0 ^ 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 0 ^ -9223372036854775808 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: 0 ^ 2147483647 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 0 ^ -2147483648 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: 0 ^ 9223372034707292160 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 0 ^ -9223372034707292160 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: 0 ^ 2147483648 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 0 ^ -2147483649 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: 0 ^ 4294967294 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 0 ^ 4294967295 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 0 ^ 4294967293 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 0 ^ 9223372036854775806 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 0 ^ 9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: 0 ^ -9223372036854775807 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 0 ^ -9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: 1 ^ 9223372036854775807 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 1 ^ -9223372036854775808 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 1 ^ 2147483647 --- |
||||||
|
int(2147483646) |
||||||
|
--- testing: 1 ^ -2147483648 --- |
||||||
|
int(-2147483647) |
||||||
|
--- testing: 1 ^ 9223372034707292160 --- |
||||||
|
int(9223372034707292161) |
||||||
|
--- testing: 1 ^ -9223372034707292160 --- |
||||||
|
int(-9223372034707292159) |
||||||
|
--- testing: 1 ^ 2147483648 --- |
||||||
|
int(2147483649) |
||||||
|
--- testing: 1 ^ -2147483649 --- |
||||||
|
int(-2147483650) |
||||||
|
--- testing: 1 ^ 4294967294 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 1 ^ 4294967295 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 1 ^ 4294967293 --- |
||||||
|
int(4294967292) |
||||||
|
--- testing: 1 ^ 9223372036854775806 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 1 ^ 9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 1 ^ -9223372036854775807 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: 1 ^ -9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -1 ^ 9223372036854775807 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -1 ^ -9223372036854775808 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: -1 ^ 2147483647 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -1 ^ -2147483648 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: -1 ^ 9223372034707292160 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: -1 ^ -9223372034707292160 --- |
||||||
|
int(9223372034707292159) |
||||||
|
--- testing: -1 ^ 2147483648 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -1 ^ -2147483649 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: -1 ^ 4294967294 --- |
||||||
|
int(-4294967295) |
||||||
|
--- testing: -1 ^ 4294967295 --- |
||||||
|
int(-4294967296) |
||||||
|
--- testing: -1 ^ 4294967293 --- |
||||||
|
int(-4294967294) |
||||||
|
--- testing: -1 ^ 9223372036854775806 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -1 ^ 9.2233720368548E+18 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: -1 ^ -9223372036854775807 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: -1 ^ -9.2233720368548E+18 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 7 ^ 9223372036854775807 --- |
||||||
|
int(9223372036854775800) |
||||||
|
--- testing: 7 ^ -9223372036854775808 --- |
||||||
|
int(-9223372036854775801) |
||||||
|
--- testing: 7 ^ 2147483647 --- |
||||||
|
int(2147483640) |
||||||
|
--- testing: 7 ^ -2147483648 --- |
||||||
|
int(-2147483641) |
||||||
|
--- testing: 7 ^ 9223372034707292160 --- |
||||||
|
int(9223372034707292167) |
||||||
|
--- testing: 7 ^ -9223372034707292160 --- |
||||||
|
int(-9223372034707292153) |
||||||
|
--- testing: 7 ^ 2147483648 --- |
||||||
|
int(2147483655) |
||||||
|
--- testing: 7 ^ -2147483649 --- |
||||||
|
int(-2147483656) |
||||||
|
--- testing: 7 ^ 4294967294 --- |
||||||
|
int(4294967289) |
||||||
|
--- testing: 7 ^ 4294967295 --- |
||||||
|
int(4294967288) |
||||||
|
--- testing: 7 ^ 4294967293 --- |
||||||
|
int(4294967290) |
||||||
|
--- testing: 7 ^ 9223372036854775806 --- |
||||||
|
int(9223372036854775801) |
||||||
|
--- testing: 7 ^ 9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775801) |
||||||
|
--- testing: 7 ^ -9223372036854775807 --- |
||||||
|
int(-9223372036854775802) |
||||||
|
--- testing: 7 ^ -9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775801) |
||||||
|
--- testing: 9 ^ 9223372036854775807 --- |
||||||
|
int(9223372036854775798) |
||||||
|
--- testing: 9 ^ -9223372036854775808 --- |
||||||
|
int(-9223372036854775799) |
||||||
|
--- testing: 9 ^ 2147483647 --- |
||||||
|
int(2147483638) |
||||||
|
--- testing: 9 ^ -2147483648 --- |
||||||
|
int(-2147483639) |
||||||
|
--- testing: 9 ^ 9223372034707292160 --- |
||||||
|
int(9223372034707292169) |
||||||
|
--- testing: 9 ^ -9223372034707292160 --- |
||||||
|
int(-9223372034707292151) |
||||||
|
--- testing: 9 ^ 2147483648 --- |
||||||
|
int(2147483657) |
||||||
|
--- testing: 9 ^ -2147483649 --- |
||||||
|
int(-2147483658) |
||||||
|
--- testing: 9 ^ 4294967294 --- |
||||||
|
int(4294967287) |
||||||
|
--- testing: 9 ^ 4294967295 --- |
||||||
|
int(4294967286) |
||||||
|
--- testing: 9 ^ 4294967293 --- |
||||||
|
int(4294967284) |
||||||
|
--- testing: 9 ^ 9223372036854775806 --- |
||||||
|
int(9223372036854775799) |
||||||
|
--- testing: 9 ^ 9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775799) |
||||||
|
--- testing: 9 ^ -9223372036854775807 --- |
||||||
|
int(-9223372036854775800) |
||||||
|
--- testing: 9 ^ -9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775799) |
||||||
|
--- testing: 65 ^ 9223372036854775807 --- |
||||||
|
int(9223372036854775742) |
||||||
|
--- testing: 65 ^ -9223372036854775808 --- |
||||||
|
int(-9223372036854775743) |
||||||
|
--- testing: 65 ^ 2147483647 --- |
||||||
|
int(2147483582) |
||||||
|
--- testing: 65 ^ -2147483648 --- |
||||||
|
int(-2147483583) |
||||||
|
--- testing: 65 ^ 9223372034707292160 --- |
||||||
|
int(9223372034707292225) |
||||||
|
--- testing: 65 ^ -9223372034707292160 --- |
||||||
|
int(-9223372034707292095) |
||||||
|
--- testing: 65 ^ 2147483648 --- |
||||||
|
int(2147483713) |
||||||
|
--- testing: 65 ^ -2147483649 --- |
||||||
|
int(-2147483714) |
||||||
|
--- testing: 65 ^ 4294967294 --- |
||||||
|
int(4294967231) |
||||||
|
--- testing: 65 ^ 4294967295 --- |
||||||
|
int(4294967230) |
||||||
|
--- testing: 65 ^ 4294967293 --- |
||||||
|
int(4294967228) |
||||||
|
--- testing: 65 ^ 9223372036854775806 --- |
||||||
|
int(9223372036854775743) |
||||||
|
--- testing: 65 ^ 9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775743) |
||||||
|
--- testing: 65 ^ -9223372036854775807 --- |
||||||
|
int(-9223372036854775744) |
||||||
|
--- testing: 65 ^ -9.2233720368548E+18 --- |
||||||
|
int(-9223372036854775743) |
||||||
|
--- testing: -44 ^ 9223372036854775807 --- |
||||||
|
int(-9223372036854775765) |
||||||
|
--- testing: -44 ^ -9223372036854775808 --- |
||||||
|
int(9223372036854775764) |
||||||
|
--- testing: -44 ^ 2147483647 --- |
||||||
|
int(-2147483605) |
||||||
|
--- testing: -44 ^ -2147483648 --- |
||||||
|
int(2147483604) |
||||||
|
--- testing: -44 ^ 9223372034707292160 --- |
||||||
|
int(-9223372034707292204) |
||||||
|
--- testing: -44 ^ -9223372034707292160 --- |
||||||
|
int(9223372034707292116) |
||||||
|
--- testing: -44 ^ 2147483648 --- |
||||||
|
int(-2147483692) |
||||||
|
--- testing: -44 ^ -2147483649 --- |
||||||
|
int(2147483691) |
||||||
|
--- testing: -44 ^ 4294967294 --- |
||||||
|
int(-4294967254) |
||||||
|
--- testing: -44 ^ 4294967295 --- |
||||||
|
int(-4294967253) |
||||||
|
--- testing: -44 ^ 4294967293 --- |
||||||
|
int(-4294967255) |
||||||
|
--- testing: -44 ^ 9223372036854775806 --- |
||||||
|
int(-9223372036854775766) |
||||||
|
--- testing: -44 ^ 9.2233720368548E+18 --- |
||||||
|
int(9223372036854775764) |
||||||
|
--- testing: -44 ^ -9223372036854775807 --- |
||||||
|
int(9223372036854775765) |
||||||
|
--- testing: -44 ^ -9.2233720368548E+18 --- |
||||||
|
int(9223372036854775764) |
||||||
|
--- testing: 2147483647 ^ 9223372036854775807 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 2147483647 ^ -9223372036854775808 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: 2147483647 ^ 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 ^ -2147483648 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 2147483647 ^ 9223372034707292160 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 2147483647 ^ -9223372034707292160 --- |
||||||
|
int(-9223372032559808513) |
||||||
|
--- testing: 2147483647 ^ 2147483648 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 2147483647 ^ -2147483649 --- |
||||||
|
int(-4294967296) |
||||||
|
--- testing: 2147483647 ^ 4294967294 --- |
||||||
|
int(2147483649) |
||||||
|
--- testing: 2147483647 ^ 4294967295 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 2147483647 ^ 4294967293 --- |
||||||
|
int(2147483650) |
||||||
|
--- testing: 2147483647 ^ 9223372036854775806 --- |
||||||
|
int(9223372034707292161) |
||||||
|
--- testing: 2147483647 ^ 9.2233720368548E+18 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: 2147483647 ^ -9223372036854775807 --- |
||||||
|
int(-9223372034707292162) |
||||||
|
--- testing: 2147483647 ^ -9.2233720368548E+18 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: 9223372036854775807 ^ 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 ^ -9223372036854775808 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9223372036854775807 ^ 2147483647 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 9223372036854775807 ^ -2147483648 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: 9223372036854775807 ^ 9223372034707292160 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 9223372036854775807 ^ -9223372034707292160 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: 9223372036854775807 ^ 2147483648 --- |
||||||
|
int(9223372034707292159) |
||||||
|
--- testing: 9223372036854775807 ^ -2147483649 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: 9223372036854775807 ^ 4294967294 --- |
||||||
|
int(9223372032559808513) |
||||||
|
--- testing: 9223372036854775807 ^ 4294967295 --- |
||||||
|
int(9223372032559808512) |
||||||
|
--- testing: 9223372036854775807 ^ 4294967293 --- |
||||||
|
int(9223372032559808514) |
||||||
|
--- testing: 9223372036854775807 ^ 9223372036854775806 --- |
||||||
|
int(1) |
||||||
|
--- testing: 9223372036854775807 ^ 9.2233720368548E+18 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9223372036854775807 ^ -9223372036854775807 --- |
||||||
|
int(-2) |
||||||
|
--- testing: 9223372036854775807 ^ -9.2233720368548E+18 --- |
||||||
|
int(-1) |
||||||
@ -0,0 +1,414 @@ |
|||||||
|
--TEST-- |
||||||
|
Test ^ operator : various numbers as strings |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$strVals = array( |
||||||
|
"0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", |
||||||
|
"a5.9" |
||||||
|
); |
||||||
|
|
||||||
|
error_reporting(E_ERROR); |
||||||
|
|
||||||
|
foreach ($strVals as $strVal) { |
||||||
|
foreach($strVals as $otherVal) { |
||||||
|
echo "--- testing: '$strVal' ^ '$otherVal' ---\n"; |
||||||
|
var_dump(bin2hex($strVal^$otherVal)); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: '0' ^ '0' --- |
||||||
|
string(2) "00" |
||||||
|
--- testing: '0' ^ '65' --- |
||||||
|
string(2) "06" |
||||||
|
--- testing: '0' ^ '-44' --- |
||||||
|
string(2) "1d" |
||||||
|
--- testing: '0' ^ '1.2' --- |
||||||
|
string(2) "01" |
||||||
|
--- testing: '0' ^ '-7.7' --- |
||||||
|
string(2) "1d" |
||||||
|
--- testing: '0' ^ 'abc' --- |
||||||
|
string(2) "51" |
||||||
|
--- testing: '0' ^ '123abc' --- |
||||||
|
string(2) "01" |
||||||
|
--- testing: '0' ^ '123e5' --- |
||||||
|
string(2) "01" |
||||||
|
--- testing: '0' ^ '123e5xyz' --- |
||||||
|
string(2) "01" |
||||||
|
--- testing: '0' ^ ' 123abc' --- |
||||||
|
string(2) "10" |
||||||
|
--- testing: '0' ^ '123 abc' --- |
||||||
|
string(2) "01" |
||||||
|
--- testing: '0' ^ '123abc ' --- |
||||||
|
string(2) "01" |
||||||
|
--- testing: '0' ^ '3.4a' --- |
||||||
|
string(2) "03" |
||||||
|
--- testing: '0' ^ 'a5.9' --- |
||||||
|
string(2) "51" |
||||||
|
--- testing: '65' ^ '0' --- |
||||||
|
string(2) "06" |
||||||
|
--- testing: '65' ^ '65' --- |
||||||
|
string(4) "0000" |
||||||
|
--- testing: '65' ^ '-44' --- |
||||||
|
string(4) "1b01" |
||||||
|
--- testing: '65' ^ '1.2' --- |
||||||
|
string(4) "071b" |
||||||
|
--- testing: '65' ^ '-7.7' --- |
||||||
|
string(4) "1b02" |
||||||
|
--- testing: '65' ^ 'abc' --- |
||||||
|
string(4) "5757" |
||||||
|
--- testing: '65' ^ '123abc' --- |
||||||
|
string(4) "0707" |
||||||
|
--- testing: '65' ^ '123e5' --- |
||||||
|
string(4) "0707" |
||||||
|
--- testing: '65' ^ '123e5xyz' --- |
||||||
|
string(4) "0707" |
||||||
|
--- testing: '65' ^ ' 123abc' --- |
||||||
|
string(4) "1604" |
||||||
|
--- testing: '65' ^ '123 abc' --- |
||||||
|
string(4) "0707" |
||||||
|
--- testing: '65' ^ '123abc ' --- |
||||||
|
string(4) "0707" |
||||||
|
--- testing: '65' ^ '3.4a' --- |
||||||
|
string(4) "051b" |
||||||
|
--- testing: '65' ^ 'a5.9' --- |
||||||
|
string(4) "5700" |
||||||
|
--- testing: '-44' ^ '0' --- |
||||||
|
string(2) "1d" |
||||||
|
--- testing: '-44' ^ '65' --- |
||||||
|
string(4) "1b01" |
||||||
|
--- testing: '-44' ^ '-44' --- |
||||||
|
string(6) "000000" |
||||||
|
--- testing: '-44' ^ '1.2' --- |
||||||
|
string(6) "1c1a06" |
||||||
|
--- testing: '-44' ^ '-7.7' --- |
||||||
|
string(6) "00031a" |
||||||
|
--- testing: '-44' ^ 'abc' --- |
||||||
|
string(6) "4c5657" |
||||||
|
--- testing: '-44' ^ '123abc' --- |
||||||
|
string(6) "1c0607" |
||||||
|
--- testing: '-44' ^ '123e5' --- |
||||||
|
string(6) "1c0607" |
||||||
|
--- testing: '-44' ^ '123e5xyz' --- |
||||||
|
string(6) "1c0607" |
||||||
|
--- testing: '-44' ^ ' 123abc' --- |
||||||
|
string(6) "0d0506" |
||||||
|
--- testing: '-44' ^ '123 abc' --- |
||||||
|
string(6) "1c0607" |
||||||
|
--- testing: '-44' ^ '123abc ' --- |
||||||
|
string(6) "1c0607" |
||||||
|
--- testing: '-44' ^ '3.4a' --- |
||||||
|
string(6) "1e1a00" |
||||||
|
--- testing: '-44' ^ 'a5.9' --- |
||||||
|
string(6) "4c011a" |
||||||
|
--- testing: '1.2' ^ '0' --- |
||||||
|
string(2) "01" |
||||||
|
--- testing: '1.2' ^ '65' --- |
||||||
|
string(4) "071b" |
||||||
|
--- testing: '1.2' ^ '-44' --- |
||||||
|
string(6) "1c1a06" |
||||||
|
--- testing: '1.2' ^ '1.2' --- |
||||||
|
string(6) "000000" |
||||||
|
--- testing: '1.2' ^ '-7.7' --- |
||||||
|
string(6) "1c191c" |
||||||
|
--- testing: '1.2' ^ 'abc' --- |
||||||
|
string(6) "504c51" |
||||||
|
--- testing: '1.2' ^ '123abc' --- |
||||||
|
string(6) "001c01" |
||||||
|
--- testing: '1.2' ^ '123e5' --- |
||||||
|
string(6) "001c01" |
||||||
|
--- testing: '1.2' ^ '123e5xyz' --- |
||||||
|
string(6) "001c01" |
||||||
|
--- testing: '1.2' ^ ' 123abc' --- |
||||||
|
string(6) "111f00" |
||||||
|
--- testing: '1.2' ^ '123 abc' --- |
||||||
|
string(6) "001c01" |
||||||
|
--- testing: '1.2' ^ '123abc ' --- |
||||||
|
string(6) "001c01" |
||||||
|
--- testing: '1.2' ^ '3.4a' --- |
||||||
|
string(6) "020006" |
||||||
|
--- testing: '1.2' ^ 'a5.9' --- |
||||||
|
string(6) "501b1c" |
||||||
|
--- testing: '-7.7' ^ '0' --- |
||||||
|
string(2) "1d" |
||||||
|
--- testing: '-7.7' ^ '65' --- |
||||||
|
string(4) "1b02" |
||||||
|
--- testing: '-7.7' ^ '-44' --- |
||||||
|
string(6) "00031a" |
||||||
|
--- testing: '-7.7' ^ '1.2' --- |
||||||
|
string(6) "1c191c" |
||||||
|
--- testing: '-7.7' ^ '-7.7' --- |
||||||
|
string(8) "00000000" |
||||||
|
--- testing: '-7.7' ^ 'abc' --- |
||||||
|
string(6) "4c554d" |
||||||
|
--- testing: '-7.7' ^ '123abc' --- |
||||||
|
string(8) "1c051d56" |
||||||
|
--- testing: '-7.7' ^ '123e5' --- |
||||||
|
string(8) "1c051d52" |
||||||
|
--- testing: '-7.7' ^ '123e5xyz' --- |
||||||
|
string(8) "1c051d52" |
||||||
|
--- testing: '-7.7' ^ ' 123abc' --- |
||||||
|
string(8) "0d061c04" |
||||||
|
--- testing: '-7.7' ^ '123 abc' --- |
||||||
|
string(8) "1c051d17" |
||||||
|
--- testing: '-7.7' ^ '123abc ' --- |
||||||
|
string(8) "1c051d56" |
||||||
|
--- testing: '-7.7' ^ '3.4a' --- |
||||||
|
string(8) "1e191a56" |
||||||
|
--- testing: '-7.7' ^ 'a5.9' --- |
||||||
|
string(8) "4c02000e" |
||||||
|
--- testing: 'abc' ^ '0' --- |
||||||
|
string(2) "51" |
||||||
|
--- testing: 'abc' ^ '65' --- |
||||||
|
string(4) "5757" |
||||||
|
--- testing: 'abc' ^ '-44' --- |
||||||
|
string(6) "4c5657" |
||||||
|
--- testing: 'abc' ^ '1.2' --- |
||||||
|
string(6) "504c51" |
||||||
|
--- testing: 'abc' ^ '-7.7' --- |
||||||
|
string(6) "4c554d" |
||||||
|
--- testing: 'abc' ^ 'abc' --- |
||||||
|
string(6) "000000" |
||||||
|
--- testing: 'abc' ^ '123abc' --- |
||||||
|
string(6) "505050" |
||||||
|
--- testing: 'abc' ^ '123e5' --- |
||||||
|
string(6) "505050" |
||||||
|
--- testing: 'abc' ^ '123e5xyz' --- |
||||||
|
string(6) "505050" |
||||||
|
--- testing: 'abc' ^ ' 123abc' --- |
||||||
|
string(6) "415351" |
||||||
|
--- testing: 'abc' ^ '123 abc' --- |
||||||
|
string(6) "505050" |
||||||
|
--- testing: 'abc' ^ '123abc ' --- |
||||||
|
string(6) "505050" |
||||||
|
--- testing: 'abc' ^ '3.4a' --- |
||||||
|
string(6) "524c57" |
||||||
|
--- testing: 'abc' ^ 'a5.9' --- |
||||||
|
string(6) "00574d" |
||||||
|
--- testing: '123abc' ^ '0' --- |
||||||
|
string(2) "01" |
||||||
|
--- testing: '123abc' ^ '65' --- |
||||||
|
string(4) "0707" |
||||||
|
--- testing: '123abc' ^ '-44' --- |
||||||
|
string(6) "1c0607" |
||||||
|
--- testing: '123abc' ^ '1.2' --- |
||||||
|
string(6) "001c01" |
||||||
|
--- testing: '123abc' ^ '-7.7' --- |
||||||
|
string(8) "1c051d56" |
||||||
|
--- testing: '123abc' ^ 'abc' --- |
||||||
|
string(6) "505050" |
||||||
|
--- testing: '123abc' ^ '123abc' --- |
||||||
|
string(12) "000000000000" |
||||||
|
--- testing: '123abc' ^ '123e5' --- |
||||||
|
string(10) "0000000457" |
||||||
|
--- testing: '123abc' ^ '123e5xyz' --- |
||||||
|
string(12) "00000004571b" |
||||||
|
--- testing: '123abc' ^ ' 123abc' --- |
||||||
|
string(12) "110301520301" |
||||||
|
--- testing: '123abc' ^ '123 abc' --- |
||||||
|
string(12) "000000410301" |
||||||
|
--- testing: '123abc' ^ '123abc ' --- |
||||||
|
string(12) "000000000000" |
||||||
|
--- testing: '123abc' ^ '3.4a' --- |
||||||
|
string(8) "021c0700" |
||||||
|
--- testing: '123abc' ^ 'a5.9' --- |
||||||
|
string(8) "50071d58" |
||||||
|
--- testing: '123e5' ^ '0' --- |
||||||
|
string(2) "01" |
||||||
|
--- testing: '123e5' ^ '65' --- |
||||||
|
string(4) "0707" |
||||||
|
--- testing: '123e5' ^ '-44' --- |
||||||
|
string(6) "1c0607" |
||||||
|
--- testing: '123e5' ^ '1.2' --- |
||||||
|
string(6) "001c01" |
||||||
|
--- testing: '123e5' ^ '-7.7' --- |
||||||
|
string(8) "1c051d52" |
||||||
|
--- testing: '123e5' ^ 'abc' --- |
||||||
|
string(6) "505050" |
||||||
|
--- testing: '123e5' ^ '123abc' --- |
||||||
|
string(10) "0000000457" |
||||||
|
--- testing: '123e5' ^ '123e5' --- |
||||||
|
string(10) "0000000000" |
||||||
|
--- testing: '123e5' ^ '123e5xyz' --- |
||||||
|
string(10) "0000000000" |
||||||
|
--- testing: '123e5' ^ ' 123abc' --- |
||||||
|
string(10) "1103015654" |
||||||
|
--- testing: '123e5' ^ '123 abc' --- |
||||||
|
string(10) "0000004554" |
||||||
|
--- testing: '123e5' ^ '123abc ' --- |
||||||
|
string(10) "0000000457" |
||||||
|
--- testing: '123e5' ^ '3.4a' --- |
||||||
|
string(8) "021c0704" |
||||||
|
--- testing: '123e5' ^ 'a5.9' --- |
||||||
|
string(8) "50071d5c" |
||||||
|
--- testing: '123e5xyz' ^ '0' --- |
||||||
|
string(2) "01" |
||||||
|
--- testing: '123e5xyz' ^ '65' --- |
||||||
|
string(4) "0707" |
||||||
|
--- testing: '123e5xyz' ^ '-44' --- |
||||||
|
string(6) "1c0607" |
||||||
|
--- testing: '123e5xyz' ^ '1.2' --- |
||||||
|
string(6) "001c01" |
||||||
|
--- testing: '123e5xyz' ^ '-7.7' --- |
||||||
|
string(8) "1c051d52" |
||||||
|
--- testing: '123e5xyz' ^ 'abc' --- |
||||||
|
string(6) "505050" |
||||||
|
--- testing: '123e5xyz' ^ '123abc' --- |
||||||
|
string(12) "00000004571b" |
||||||
|
--- testing: '123e5xyz' ^ '123e5' --- |
||||||
|
string(10) "0000000000" |
||||||
|
--- testing: '123e5xyz' ^ '123e5xyz' --- |
||||||
|
string(16) "0000000000000000" |
||||||
|
--- testing: '123e5xyz' ^ ' 123abc' --- |
||||||
|
string(14) "11030156541a1a" |
||||||
|
--- testing: '123e5xyz' ^ '123 abc' --- |
||||||
|
string(14) "00000045541a1a" |
||||||
|
--- testing: '123e5xyz' ^ '123abc ' --- |
||||||
|
string(14) "00000004571b59" |
||||||
|
--- testing: '123e5xyz' ^ '3.4a' --- |
||||||
|
string(8) "021c0704" |
||||||
|
--- testing: '123e5xyz' ^ 'a5.9' --- |
||||||
|
string(8) "50071d5c" |
||||||
|
--- testing: ' 123abc' ^ '0' --- |
||||||
|
string(2) "10" |
||||||
|
--- testing: ' 123abc' ^ '65' --- |
||||||
|
string(4) "1604" |
||||||
|
--- testing: ' 123abc' ^ '-44' --- |
||||||
|
string(6) "0d0506" |
||||||
|
--- testing: ' 123abc' ^ '1.2' --- |
||||||
|
string(6) "111f00" |
||||||
|
--- testing: ' 123abc' ^ '-7.7' --- |
||||||
|
string(8) "0d061c04" |
||||||
|
--- testing: ' 123abc' ^ 'abc' --- |
||||||
|
string(6) "415351" |
||||||
|
--- testing: ' 123abc' ^ '123abc' --- |
||||||
|
string(12) "110301520301" |
||||||
|
--- testing: ' 123abc' ^ '123e5' --- |
||||||
|
string(10) "1103015654" |
||||||
|
--- testing: ' 123abc' ^ '123e5xyz' --- |
||||||
|
string(14) "11030156541a1a" |
||||||
|
--- testing: ' 123abc' ^ ' 123abc' --- |
||||||
|
string(14) "00000000000000" |
||||||
|
--- testing: ' 123abc' ^ '123 abc' --- |
||||||
|
string(14) "11030113000000" |
||||||
|
--- testing: ' 123abc' ^ '123abc ' --- |
||||||
|
string(14) "11030152030143" |
||||||
|
--- testing: ' 123abc' ^ '3.4a' --- |
||||||
|
string(8) "131f0652" |
||||||
|
--- testing: ' 123abc' ^ 'a5.9' --- |
||||||
|
string(8) "41041c0a" |
||||||
|
--- testing: '123 abc' ^ '0' --- |
||||||
|
string(2) "01" |
||||||
|
--- testing: '123 abc' ^ '65' --- |
||||||
|
string(4) "0707" |
||||||
|
--- testing: '123 abc' ^ '-44' --- |
||||||
|
string(6) "1c0607" |
||||||
|
--- testing: '123 abc' ^ '1.2' --- |
||||||
|
string(6) "001c01" |
||||||
|
--- testing: '123 abc' ^ '-7.7' --- |
||||||
|
string(8) "1c051d17" |
||||||
|
--- testing: '123 abc' ^ 'abc' --- |
||||||
|
string(6) "505050" |
||||||
|
--- testing: '123 abc' ^ '123abc' --- |
||||||
|
string(12) "000000410301" |
||||||
|
--- testing: '123 abc' ^ '123e5' --- |
||||||
|
string(10) "0000004554" |
||||||
|
--- testing: '123 abc' ^ '123e5xyz' --- |
||||||
|
string(14) "00000045541a1a" |
||||||
|
--- testing: '123 abc' ^ ' 123abc' --- |
||||||
|
string(14) "11030113000000" |
||||||
|
--- testing: '123 abc' ^ '123 abc' --- |
||||||
|
string(14) "00000000000000" |
||||||
|
--- testing: '123 abc' ^ '123abc ' --- |
||||||
|
string(14) "00000041030143" |
||||||
|
--- testing: '123 abc' ^ '3.4a' --- |
||||||
|
string(8) "021c0741" |
||||||
|
--- testing: '123 abc' ^ 'a5.9' --- |
||||||
|
string(8) "50071d19" |
||||||
|
--- testing: '123abc ' ^ '0' --- |
||||||
|
string(2) "01" |
||||||
|
--- testing: '123abc ' ^ '65' --- |
||||||
|
string(4) "0707" |
||||||
|
--- testing: '123abc ' ^ '-44' --- |
||||||
|
string(6) "1c0607" |
||||||
|
--- testing: '123abc ' ^ '1.2' --- |
||||||
|
string(6) "001c01" |
||||||
|
--- testing: '123abc ' ^ '-7.7' --- |
||||||
|
string(8) "1c051d56" |
||||||
|
--- testing: '123abc ' ^ 'abc' --- |
||||||
|
string(6) "505050" |
||||||
|
--- testing: '123abc ' ^ '123abc' --- |
||||||
|
string(12) "000000000000" |
||||||
|
--- testing: '123abc ' ^ '123e5' --- |
||||||
|
string(10) "0000000457" |
||||||
|
--- testing: '123abc ' ^ '123e5xyz' --- |
||||||
|
string(14) "00000004571b59" |
||||||
|
--- testing: '123abc ' ^ ' 123abc' --- |
||||||
|
string(14) "11030152030143" |
||||||
|
--- testing: '123abc ' ^ '123 abc' --- |
||||||
|
string(14) "00000041030143" |
||||||
|
--- testing: '123abc ' ^ '123abc ' --- |
||||||
|
string(14) "00000000000000" |
||||||
|
--- testing: '123abc ' ^ '3.4a' --- |
||||||
|
string(8) "021c0700" |
||||||
|
--- testing: '123abc ' ^ 'a5.9' --- |
||||||
|
string(8) "50071d58" |
||||||
|
--- testing: '3.4a' ^ '0' --- |
||||||
|
string(2) "03" |
||||||
|
--- testing: '3.4a' ^ '65' --- |
||||||
|
string(4) "051b" |
||||||
|
--- testing: '3.4a' ^ '-44' --- |
||||||
|
string(6) "1e1a00" |
||||||
|
--- testing: '3.4a' ^ '1.2' --- |
||||||
|
string(6) "020006" |
||||||
|
--- testing: '3.4a' ^ '-7.7' --- |
||||||
|
string(8) "1e191a56" |
||||||
|
--- testing: '3.4a' ^ 'abc' --- |
||||||
|
string(6) "524c57" |
||||||
|
--- testing: '3.4a' ^ '123abc' --- |
||||||
|
string(8) "021c0700" |
||||||
|
--- testing: '3.4a' ^ '123e5' --- |
||||||
|
string(8) "021c0704" |
||||||
|
--- testing: '3.4a' ^ '123e5xyz' --- |
||||||
|
string(8) "021c0704" |
||||||
|
--- testing: '3.4a' ^ ' 123abc' --- |
||||||
|
string(8) "131f0652" |
||||||
|
--- testing: '3.4a' ^ '123 abc' --- |
||||||
|
string(8) "021c0741" |
||||||
|
--- testing: '3.4a' ^ '123abc ' --- |
||||||
|
string(8) "021c0700" |
||||||
|
--- testing: '3.4a' ^ '3.4a' --- |
||||||
|
string(8) "00000000" |
||||||
|
--- testing: '3.4a' ^ 'a5.9' --- |
||||||
|
string(8) "521b1a58" |
||||||
|
--- testing: 'a5.9' ^ '0' --- |
||||||
|
string(2) "51" |
||||||
|
--- testing: 'a5.9' ^ '65' --- |
||||||
|
string(4) "5700" |
||||||
|
--- testing: 'a5.9' ^ '-44' --- |
||||||
|
string(6) "4c011a" |
||||||
|
--- testing: 'a5.9' ^ '1.2' --- |
||||||
|
string(6) "501b1c" |
||||||
|
--- testing: 'a5.9' ^ '-7.7' --- |
||||||
|
string(8) "4c02000e" |
||||||
|
--- testing: 'a5.9' ^ 'abc' --- |
||||||
|
string(6) "00574d" |
||||||
|
--- testing: 'a5.9' ^ '123abc' --- |
||||||
|
string(8) "50071d58" |
||||||
|
--- testing: 'a5.9' ^ '123e5' --- |
||||||
|
string(8) "50071d5c" |
||||||
|
--- testing: 'a5.9' ^ '123e5xyz' --- |
||||||
|
string(8) "50071d5c" |
||||||
|
--- testing: 'a5.9' ^ ' 123abc' --- |
||||||
|
string(8) "41041c0a" |
||||||
|
--- testing: 'a5.9' ^ '123 abc' --- |
||||||
|
string(8) "50071d19" |
||||||
|
--- testing: 'a5.9' ^ '123abc ' --- |
||||||
|
string(8) "50071d58" |
||||||
|
--- testing: 'a5.9' ^ '3.4a' --- |
||||||
|
string(8) "521b1a58" |
||||||
|
--- testing: 'a5.9' ^ 'a5.9' --- |
||||||
|
string(8) "00000000" |
||||||
@ -0,0 +1,83 @@ |
|||||||
|
--TEST-- |
||||||
|
Test ?? operator |
||||||
|
--SKIPIF-- |
||||||
|
<?php die("skip");?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
|
||||||
|
function foobar() { |
||||||
|
echo "called\n"; |
||||||
|
return ['a']; |
||||||
|
} |
||||||
|
function main() { |
||||||
|
$var = 7; |
||||||
|
$var2 = NULL; |
||||||
|
|
||||||
|
$obj = new StdClass; |
||||||
|
$obj->boo = 7; |
||||||
|
|
||||||
|
$arr = [ |
||||||
|
2 => 7, |
||||||
|
"foo" => "bar", |
||||||
|
"foobar" => NULL, |
||||||
|
"qux" => $obj, |
||||||
|
"bing" => [ |
||||||
|
"bang" |
||||||
|
] |
||||||
|
]; |
||||||
|
|
||||||
|
var_dump($nonexistent_variable ?? 3); |
||||||
|
echo PHP_EOL; |
||||||
|
var_dump($var ?? 3); |
||||||
|
var_dump($var2 ?? 3); |
||||||
|
echo PHP_EOL; |
||||||
|
var_dump($obj->boo ?? 3); |
||||||
|
var_dump($obj->bing ?? 3); |
||||||
|
var_dump($arr["qux"]->boo ?? 3); |
||||||
|
var_dump($arr["qux"]->bing ?? 3); |
||||||
|
echo PHP_EOL; |
||||||
|
var_dump($arr[2] ?? 3); |
||||||
|
var_dump($arr["foo"] ?? 3); |
||||||
|
var_dump($arr["foobar"] ?? 3); |
||||||
|
var_dump($arr["qux"] ?? 3); |
||||||
|
var_dump($arr["bing"][0] ?? 3); |
||||||
|
var_dump($arr["bing"][1] ?? 3); |
||||||
|
echo PHP_EOL; |
||||||
|
var_dump(foobar()[0] ?? false); |
||||||
|
echo PHP_EOL; |
||||||
|
function f($x) |
||||||
|
{ |
||||||
|
printf("%s(%d)\n", __FUNCTION__, $x); |
||||||
|
return $x; |
||||||
|
} |
||||||
|
|
||||||
|
$a = f(null) ?? f(1) ?? f(2); |
||||||
|
} |
||||||
|
?> |
||||||
|
--EXPECTF-- |
||||||
|
int(3) |
||||||
|
|
||||||
|
int(7) |
||||||
|
int(3) |
||||||
|
|
||||||
|
int(7) |
||||||
|
int(3) |
||||||
|
int(7) |
||||||
|
int(3) |
||||||
|
|
||||||
|
int(7) |
||||||
|
string(3) "bar" |
||||||
|
int(3) |
||||||
|
object(stdClass)#%d (%d) { |
||||||
|
["boo"]=> |
||||||
|
int(7) |
||||||
|
} |
||||||
|
string(4) "bang" |
||||||
|
int(3) |
||||||
|
|
||||||
|
called |
||||||
|
string(1) "a" |
||||||
|
|
||||||
|
f(0) |
||||||
|
f(1) |
||||||
@ -0,0 +1,585 @@ |
|||||||
|
--TEST-- |
||||||
|
Test / operator : 64bit long tests |
||||||
|
--SKIPIF-- |
||||||
|
<?php die("skip");?> |
||||||
|
<?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"; |
||||||
|
try { |
||||||
|
var_dump($longVal/$otherVal); |
||||||
|
} catch (\Throwable $e) { |
||||||
|
echo get_class($e) . ': ' . $e->getMessage() . \PHP_EOL; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
foreach ($otherVals as $otherVal) { |
||||||
|
foreach($longVals as $longVal) { |
||||||
|
echo "--- testing: $otherVal / $longVal ---\n"; |
||||||
|
var_dump($otherVal/$longVal); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: 9223372036854775807 / 0 --- |
||||||
|
DivisionByZeroError: Division by zero |
||||||
|
--- testing: 9223372036854775807 / 1 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 / -1 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 / 7 --- |
||||||
|
int(1317624576693539401) |
||||||
|
--- testing: 9223372036854775807 / 9 --- |
||||||
|
float(1.0248191152060861E+18) |
||||||
|
--- testing: 9223372036854775807 / 65 --- |
||||||
|
float(1.4189803133622733E+17) |
||||||
|
--- testing: 9223372036854775807 / -44 --- |
||||||
|
float(-2.0962209174669946E+17) |
||||||
|
--- testing: 9223372036854775807 / 2147483647 --- |
||||||
|
float(4294967298) |
||||||
|
--- testing: 9223372036854775807 / 9223372036854775807 --- |
||||||
|
int(1) |
||||||
|
--- testing: -9223372036854775808 / 0 --- |
||||||
|
DivisionByZeroError: Division by zero |
||||||
|
--- testing: -9223372036854775808 / 1 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9223372036854775808 / -1 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775808 / 7 --- |
||||||
|
float(-1.3176245766935393E+18) |
||||||
|
--- testing: -9223372036854775808 / 9 --- |
||||||
|
float(-1.0248191152060861E+18) |
||||||
|
--- testing: -9223372036854775808 / 65 --- |
||||||
|
float(-1.4189803133622733E+17) |
||||||
|
--- testing: -9223372036854775808 / -44 --- |
||||||
|
float(2.0962209174669946E+17) |
||||||
|
--- testing: -9223372036854775808 / 2147483647 --- |
||||||
|
float(-4294967298) |
||||||
|
--- testing: -9223372036854775808 / 9223372036854775807 --- |
||||||
|
float(-1) |
||||||
|
--- testing: 2147483647 / 0 --- |
||||||
|
DivisionByZeroError: Division by zero |
||||||
|
--- testing: 2147483647 / 1 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 / -1 --- |
||||||
|
int(-2147483647) |
||||||
|
--- testing: 2147483647 / 7 --- |
||||||
|
float(306783378.14285713) |
||||||
|
--- testing: 2147483647 / 9 --- |
||||||
|
float(238609294.1111111) |
||||||
|
--- testing: 2147483647 / 65 --- |
||||||
|
float(33038209.953846153) |
||||||
|
--- testing: 2147483647 / -44 --- |
||||||
|
float(-48806446.52272727) |
||||||
|
--- testing: 2147483647 / 2147483647 --- |
||||||
|
int(1) |
||||||
|
--- testing: 2147483647 / 9223372036854775807 --- |
||||||
|
float(2.328306435454494E-10) |
||||||
|
--- testing: -2147483648 / 0 --- |
||||||
|
DivisionByZeroError: Division by zero |
||||||
|
--- testing: -2147483648 / 1 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -2147483648 / -1 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: -2147483648 / 7 --- |
||||||
|
float(-306783378.28571427) |
||||||
|
--- testing: -2147483648 / 9 --- |
||||||
|
float(-238609294.2222222) |
||||||
|
--- testing: -2147483648 / 65 --- |
||||||
|
float(-33038209.96923077) |
||||||
|
--- testing: -2147483648 / -44 --- |
||||||
|
float(48806446.54545455) |
||||||
|
--- testing: -2147483648 / 2147483647 --- |
||||||
|
float(-1.0000000004656613) |
||||||
|
--- testing: -2147483648 / 9223372036854775807 --- |
||||||
|
float(-2.3283064365386963E-10) |
||||||
|
--- testing: 9223372034707292160 / 0 --- |
||||||
|
DivisionByZeroError: Division by zero |
||||||
|
--- testing: 9223372034707292160 / 1 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 9223372034707292160 / -1 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: 9223372034707292160 / 7 --- |
||||||
|
float(1.317624576386756E+18) |
||||||
|
--- testing: 9223372034707292160 / 9 --- |
||||||
|
float(1.0248191149674769E+18) |
||||||
|
--- testing: 9223372034707292160 / 65 --- |
||||||
|
float(1.418980313031891E+17) |
||||||
|
--- testing: 9223372034707292160 / -44 --- |
||||||
|
float(-2.09622091697893E+17) |
||||||
|
--- testing: 9223372034707292160 / 2147483647 --- |
||||||
|
float(4294967297) |
||||||
|
--- testing: 9223372034707292160 / 9223372036854775807 --- |
||||||
|
float(0.9999999997671694) |
||||||
|
--- testing: -9223372034707292160 / 0 --- |
||||||
|
DivisionByZeroError: Division by zero |
||||||
|
--- testing: -9223372034707292160 / 1 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: -9223372034707292160 / -1 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: -9223372034707292160 / 7 --- |
||||||
|
float(-1.317624576386756E+18) |
||||||
|
--- testing: -9223372034707292160 / 9 --- |
||||||
|
float(-1.0248191149674769E+18) |
||||||
|
--- testing: -9223372034707292160 / 65 --- |
||||||
|
float(-1.418980313031891E+17) |
||||||
|
--- testing: -9223372034707292160 / -44 --- |
||||||
|
float(2.09622091697893E+17) |
||||||
|
--- testing: -9223372034707292160 / 2147483647 --- |
||||||
|
float(-4294967297) |
||||||
|
--- testing: -9223372034707292160 / 9223372036854775807 --- |
||||||
|
float(-0.9999999997671694) |
||||||
|
--- testing: 2147483648 / 0 --- |
||||||
|
DivisionByZeroError: Division by zero |
||||||
|
--- testing: 2147483648 / 1 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 2147483648 / -1 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: 2147483648 / 7 --- |
||||||
|
float(306783378.28571427) |
||||||
|
--- testing: 2147483648 / 9 --- |
||||||
|
float(238609294.2222222) |
||||||
|
--- testing: 2147483648 / 65 --- |
||||||
|
float(33038209.96923077) |
||||||
|
--- testing: 2147483648 / -44 --- |
||||||
|
float(-48806446.54545455) |
||||||
|
--- testing: 2147483648 / 2147483647 --- |
||||||
|
float(1.0000000004656613) |
||||||
|
--- testing: 2147483648 / 9223372036854775807 --- |
||||||
|
float(2.3283064365386963E-10) |
||||||
|
--- testing: -2147483649 / 0 --- |
||||||
|
DivisionByZeroError: Division by zero |
||||||
|
--- testing: -2147483649 / 1 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -2147483649 / -1 --- |
||||||
|
int(2147483649) |
||||||
|
--- testing: -2147483649 / 7 --- |
||||||
|
float(-306783378.4285714) |
||||||
|
--- testing: -2147483649 / 9 --- |
||||||
|
float(-238609294.33333334) |
||||||
|
--- testing: -2147483649 / 65 --- |
||||||
|
float(-33038209.984615386) |
||||||
|
--- testing: -2147483649 / -44 --- |
||||||
|
float(48806446.56818182) |
||||||
|
--- testing: -2147483649 / 2147483647 --- |
||||||
|
float(-1.0000000009313226) |
||||||
|
--- testing: -2147483649 / 9223372036854775807 --- |
||||||
|
float(-2.3283064376228985E-10) |
||||||
|
--- testing: 4294967294 / 0 --- |
||||||
|
DivisionByZeroError: Division by zero |
||||||
|
--- testing: 4294967294 / 1 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 4294967294 / -1 --- |
||||||
|
int(-4294967294) |
||||||
|
--- testing: 4294967294 / 7 --- |
||||||
|
float(613566756.2857143) |
||||||
|
--- testing: 4294967294 / 9 --- |
||||||
|
float(477218588.2222222) |
||||||
|
--- testing: 4294967294 / 65 --- |
||||||
|
float(66076419.907692306) |
||||||
|
--- testing: 4294967294 / -44 --- |
||||||
|
float(-97612893.04545455) |
||||||
|
--- testing: 4294967294 / 2147483647 --- |
||||||
|
int(2) |
||||||
|
--- testing: 4294967294 / 9223372036854775807 --- |
||||||
|
float(4.656612870908988E-10) |
||||||
|
--- testing: 4294967295 / 0 --- |
||||||
|
DivisionByZeroError: Division by zero |
||||||
|
--- testing: 4294967295 / 1 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967295 / -1 --- |
||||||
|
int(-4294967295) |
||||||
|
--- testing: 4294967295 / 7 --- |
||||||
|
float(613566756.4285715) |
||||||
|
--- testing: 4294967295 / 9 --- |
||||||
|
float(477218588.3333333) |
||||||
|
--- testing: 4294967295 / 65 --- |
||||||
|
float(66076419.92307692) |
||||||
|
--- testing: 4294967295 / -44 --- |
||||||
|
float(-97612893.06818181) |
||||||
|
--- testing: 4294967295 / 2147483647 --- |
||||||
|
float(2.0000000004656613) |
||||||
|
--- testing: 4294967295 / 9223372036854775807 --- |
||||||
|
float(4.6566128719931904E-10) |
||||||
|
--- testing: 4294967293 / 0 --- |
||||||
|
DivisionByZeroError: Division by zero |
||||||
|
--- testing: 4294967293 / 1 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 4294967293 / -1 --- |
||||||
|
int(-4294967293) |
||||||
|
--- testing: 4294967293 / 7 --- |
||||||
|
float(613566756.1428572) |
||||||
|
--- testing: 4294967293 / 9 --- |
||||||
|
float(477218588.1111111) |
||||||
|
--- testing: 4294967293 / 65 --- |
||||||
|
float(66076419.89230769) |
||||||
|
--- testing: 4294967293 / -44 --- |
||||||
|
float(-97612893.02272727) |
||||||
|
--- testing: 4294967293 / 2147483647 --- |
||||||
|
float(1.9999999995343387) |
||||||
|
--- testing: 4294967293 / 9223372036854775807 --- |
||||||
|
float(4.656612869824786E-10) |
||||||
|
--- testing: 9223372036854775806 / 0 --- |
||||||
|
DivisionByZeroError: Division by zero |
||||||
|
--- testing: 9223372036854775806 / 1 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 9223372036854775806 / -1 --- |
||||||
|
int(-9223372036854775806) |
||||||
|
--- testing: 9223372036854775806 / 7 --- |
||||||
|
float(1.3176245766935393E+18) |
||||||
|
--- testing: 9223372036854775806 / 9 --- |
||||||
|
float(1.0248191152060861E+18) |
||||||
|
--- testing: 9223372036854775806 / 65 --- |
||||||
|
float(1.4189803133622733E+17) |
||||||
|
--- testing: 9223372036854775806 / -44 --- |
||||||
|
float(-2.0962209174669946E+17) |
||||||
|
--- testing: 9223372036854775806 / 2147483647 --- |
||||||
|
int(4294967298) |
||||||
|
--- testing: 9223372036854775806 / 9223372036854775807 --- |
||||||
|
float(1) |
||||||
|
--- testing: 9.2233720368548E+18 / 0 --- |
||||||
|
DivisionByZeroError: Division by zero |
||||||
|
--- testing: 9.2233720368548E+18 / 1 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9.2233720368548E+18 / -1 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: 9.2233720368548E+18 / 7 --- |
||||||
|
float(1.3176245766935393E+18) |
||||||
|
--- testing: 9.2233720368548E+18 / 9 --- |
||||||
|
float(1.0248191152060861E+18) |
||||||
|
--- testing: 9.2233720368548E+18 / 65 --- |
||||||
|
float(1.4189803133622733E+17) |
||||||
|
--- testing: 9.2233720368548E+18 / -44 --- |
||||||
|
float(-2.0962209174669946E+17) |
||||||
|
--- testing: 9.2233720368548E+18 / 2147483647 --- |
||||||
|
float(4294967298) |
||||||
|
--- testing: 9.2233720368548E+18 / 9223372036854775807 --- |
||||||
|
float(1) |
||||||
|
--- testing: -9223372036854775807 / 0 --- |
||||||
|
DivisionByZeroError: Division by zero |
||||||
|
--- testing: -9223372036854775807 / 1 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -9223372036854775807 / -1 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: -9223372036854775807 / 7 --- |
||||||
|
int(-1317624576693539401) |
||||||
|
--- testing: -9223372036854775807 / 9 --- |
||||||
|
float(-1.0248191152060861E+18) |
||||||
|
--- testing: -9223372036854775807 / 65 --- |
||||||
|
float(-1.4189803133622733E+17) |
||||||
|
--- testing: -9223372036854775807 / -44 --- |
||||||
|
float(2.0962209174669946E+17) |
||||||
|
--- testing: -9223372036854775807 / 2147483647 --- |
||||||
|
float(-4294967298) |
||||||
|
--- testing: -9223372036854775807 / 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9.2233720368548E+18 / 0 --- |
||||||
|
DivisionByZeroError: Division by zero |
||||||
|
--- testing: -9.2233720368548E+18 / 1 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9.2233720368548E+18 / -1 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: -9.2233720368548E+18 / 7 --- |
||||||
|
float(-1.3176245766935393E+18) |
||||||
|
--- testing: -9.2233720368548E+18 / 9 --- |
||||||
|
float(-1.0248191152060861E+18) |
||||||
|
--- testing: -9.2233720368548E+18 / 65 --- |
||||||
|
float(-1.4189803133622733E+17) |
||||||
|
--- testing: -9.2233720368548E+18 / -44 --- |
||||||
|
float(2.0962209174669946E+17) |
||||||
|
--- testing: -9.2233720368548E+18 / 2147483647 --- |
||||||
|
float(-4294967298) |
||||||
|
--- testing: -9.2233720368548E+18 / 9223372036854775807 --- |
||||||
|
float(-1) |
||||||
|
--- 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 --- |
||||||
|
float(0) |
||||||
|
--- testing: 0 / -9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 0 / -9.2233720368548E+18 --- |
||||||
|
float(-0) |
||||||
|
--- testing: 1 / 9223372036854775807 --- |
||||||
|
float(1.0842021724855044E-19) |
||||||
|
--- testing: 1 / -9223372036854775808 --- |
||||||
|
float(-1.0842021724855044E-19) |
||||||
|
--- testing: 1 / 2147483647 --- |
||||||
|
float(4.656612875245797E-10) |
||||||
|
--- testing: 1 / -2147483648 --- |
||||||
|
float(-4.656612873077393E-10) |
||||||
|
--- testing: 1 / 9223372034707292160 --- |
||||||
|
float(1.08420217273794E-19) |
||||||
|
--- testing: 1 / -9223372034707292160 --- |
||||||
|
float(-1.08420217273794E-19) |
||||||
|
--- testing: 1 / 2147483648 --- |
||||||
|
float(4.656612873077393E-10) |
||||||
|
--- testing: 1 / -2147483649 --- |
||||||
|
float(-4.656612870908988E-10) |
||||||
|
--- testing: 1 / 4294967294 --- |
||||||
|
float(2.3283064376228985E-10) |
||||||
|
--- testing: 1 / 4294967295 --- |
||||||
|
float(2.3283064370807974E-10) |
||||||
|
--- testing: 1 / 4294967293 --- |
||||||
|
float(2.3283064381649995E-10) |
||||||
|
--- testing: 1 / 9223372036854775806 --- |
||||||
|
float(1.0842021724855044E-19) |
||||||
|
--- testing: 1 / 9.2233720368548E+18 --- |
||||||
|
float(1.0842021724855044E-19) |
||||||
|
--- testing: 1 / -9223372036854775807 --- |
||||||
|
float(-1.0842021724855044E-19) |
||||||
|
--- testing: 1 / -9.2233720368548E+18 --- |
||||||
|
float(-1.0842021724855044E-19) |
||||||
|
--- testing: -1 / 9223372036854775807 --- |
||||||
|
float(-1.0842021724855044E-19) |
||||||
|
--- testing: -1 / -9223372036854775808 --- |
||||||
|
float(1.0842021724855044E-19) |
||||||
|
--- testing: -1 / 2147483647 --- |
||||||
|
float(-4.656612875245797E-10) |
||||||
|
--- testing: -1 / -2147483648 --- |
||||||
|
float(4.656612873077393E-10) |
||||||
|
--- testing: -1 / 9223372034707292160 --- |
||||||
|
float(-1.08420217273794E-19) |
||||||
|
--- testing: -1 / -9223372034707292160 --- |
||||||
|
float(1.08420217273794E-19) |
||||||
|
--- testing: -1 / 2147483648 --- |
||||||
|
float(-4.656612873077393E-10) |
||||||
|
--- testing: -1 / -2147483649 --- |
||||||
|
float(4.656612870908988E-10) |
||||||
|
--- testing: -1 / 4294967294 --- |
||||||
|
float(-2.3283064376228985E-10) |
||||||
|
--- testing: -1 / 4294967295 --- |
||||||
|
float(-2.3283064370807974E-10) |
||||||
|
--- testing: -1 / 4294967293 --- |
||||||
|
float(-2.3283064381649995E-10) |
||||||
|
--- testing: -1 / 9223372036854775806 --- |
||||||
|
float(-1.0842021724855044E-19) |
||||||
|
--- testing: -1 / 9.2233720368548E+18 --- |
||||||
|
float(-1.0842021724855044E-19) |
||||||
|
--- testing: -1 / -9223372036854775807 --- |
||||||
|
float(1.0842021724855044E-19) |
||||||
|
--- testing: -1 / -9.2233720368548E+18 --- |
||||||
|
float(1.0842021724855044E-19) |
||||||
|
--- testing: 7 / 9223372036854775807 --- |
||||||
|
float(7.589415207398531E-19) |
||||||
|
--- testing: 7 / -9223372036854775808 --- |
||||||
|
float(-7.589415207398531E-19) |
||||||
|
--- testing: 7 / 2147483647 --- |
||||||
|
float(3.259629012672058E-9) |
||||||
|
--- testing: 7 / -2147483648 --- |
||||||
|
float(-3.259629011154175E-9) |
||||||
|
--- testing: 7 / 9223372034707292160 --- |
||||||
|
float(7.589415209165579E-19) |
||||||
|
--- testing: 7 / -9223372034707292160 --- |
||||||
|
float(-7.589415209165579E-19) |
||||||
|
--- testing: 7 / 2147483648 --- |
||||||
|
float(3.259629011154175E-9) |
||||||
|
--- testing: 7 / -2147483649 --- |
||||||
|
float(-3.2596290096362918E-9) |
||||||
|
--- testing: 7 / 4294967294 --- |
||||||
|
float(1.629814506336029E-9) |
||||||
|
--- testing: 7 / 4294967295 --- |
||||||
|
float(1.6298145059565582E-9) |
||||||
|
--- testing: 7 / 4294967293 --- |
||||||
|
float(1.6298145067154997E-9) |
||||||
|
--- testing: 7 / 9223372036854775806 --- |
||||||
|
float(7.589415207398531E-19) |
||||||
|
--- testing: 7 / 9.2233720368548E+18 --- |
||||||
|
float(7.589415207398531E-19) |
||||||
|
--- testing: 7 / -9223372036854775807 --- |
||||||
|
float(-7.589415207398531E-19) |
||||||
|
--- testing: 7 / -9.2233720368548E+18 --- |
||||||
|
float(-7.589415207398531E-19) |
||||||
|
--- testing: 9 / 9223372036854775807 --- |
||||||
|
float(9.75781955236954E-19) |
||||||
|
--- testing: 9 / -9223372036854775808 --- |
||||||
|
float(-9.75781955236954E-19) |
||||||
|
--- testing: 9 / 2147483647 --- |
||||||
|
float(4.190951587721217E-9) |
||||||
|
--- testing: 9 / -2147483648 --- |
||||||
|
float(-4.190951585769653E-9) |
||||||
|
--- testing: 9 / 9223372034707292160 --- |
||||||
|
float(9.75781955464146E-19) |
||||||
|
--- testing: 9 / -9223372034707292160 --- |
||||||
|
float(-9.75781955464146E-19) |
||||||
|
--- testing: 9 / 2147483648 --- |
||||||
|
float(4.190951585769653E-9) |
||||||
|
--- testing: 9 / -2147483649 --- |
||||||
|
float(-4.190951583818089E-9) |
||||||
|
--- testing: 9 / 4294967294 --- |
||||||
|
float(2.0954757938606086E-9) |
||||||
|
--- testing: 9 / 4294967295 --- |
||||||
|
float(2.0954757933727176E-9) |
||||||
|
--- testing: 9 / 4294967293 --- |
||||||
|
float(2.0954757943484996E-9) |
||||||
|
--- testing: 9 / 9223372036854775806 --- |
||||||
|
float(9.75781955236954E-19) |
||||||
|
--- testing: 9 / 9.2233720368548E+18 --- |
||||||
|
float(9.75781955236954E-19) |
||||||
|
--- testing: 9 / -9223372036854775807 --- |
||||||
|
float(-9.75781955236954E-19) |
||||||
|
--- testing: 9 / -9.2233720368548E+18 --- |
||||||
|
float(-9.75781955236954E-19) |
||||||
|
--- testing: 65 / 9223372036854775807 --- |
||||||
|
float(7.047314121155779E-18) |
||||||
|
--- testing: 65 / -9223372036854775808 --- |
||||||
|
float(-7.047314121155779E-18) |
||||||
|
--- testing: 65 / 2147483647 --- |
||||||
|
float(3.026798368909768E-8) |
||||||
|
--- testing: 65 / -2147483648 --- |
||||||
|
float(-3.026798367500305E-8) |
||||||
|
--- testing: 65 / 9223372034707292160 --- |
||||||
|
float(7.04731412279661E-18) |
||||||
|
--- testing: 65 / -9223372034707292160 --- |
||||||
|
float(-7.04731412279661E-18) |
||||||
|
--- testing: 65 / 2147483648 --- |
||||||
|
float(3.026798367500305E-8) |
||||||
|
--- testing: 65 / -2147483649 --- |
||||||
|
float(-3.0267983660908424E-8) |
||||||
|
--- testing: 65 / 4294967294 --- |
||||||
|
float(1.513399184454884E-8) |
||||||
|
--- testing: 65 / 4294967295 --- |
||||||
|
float(1.5133991841025183E-8) |
||||||
|
--- testing: 65 / 4294967293 --- |
||||||
|
float(1.5133991848072497E-8) |
||||||
|
--- testing: 65 / 9223372036854775806 --- |
||||||
|
float(7.047314121155779E-18) |
||||||
|
--- testing: 65 / 9.2233720368548E+18 --- |
||||||
|
float(7.047314121155779E-18) |
||||||
|
--- testing: 65 / -9223372036854775807 --- |
||||||
|
float(-7.047314121155779E-18) |
||||||
|
--- testing: 65 / -9.2233720368548E+18 --- |
||||||
|
float(-7.047314121155779E-18) |
||||||
|
--- testing: -44 / 9223372036854775807 --- |
||||||
|
float(-4.7704895589362195E-18) |
||||||
|
--- testing: -44 / -9223372036854775808 --- |
||||||
|
float(4.7704895589362195E-18) |
||||||
|
--- testing: -44 / 2147483647 --- |
||||||
|
float(-2.0489096651081506E-8) |
||||||
|
--- testing: -44 / -2147483648 --- |
||||||
|
float(2.0489096641540527E-8) |
||||||
|
--- testing: -44 / 9223372034707292160 --- |
||||||
|
float(-4.770489560046936E-18) |
||||||
|
--- testing: -44 / -9223372034707292160 --- |
||||||
|
float(4.770489560046936E-18) |
||||||
|
--- testing: -44 / 2147483648 --- |
||||||
|
float(-2.0489096641540527E-8) |
||||||
|
--- testing: -44 / -2147483649 --- |
||||||
|
float(2.0489096631999548E-8) |
||||||
|
--- testing: -44 / 4294967294 --- |
||||||
|
float(-1.0244548325540753E-8) |
||||||
|
--- testing: -44 / 4294967295 --- |
||||||
|
float(-1.0244548323155508E-8) |
||||||
|
--- testing: -44 / 4294967293 --- |
||||||
|
float(-1.0244548327925998E-8) |
||||||
|
--- testing: -44 / 9223372036854775806 --- |
||||||
|
float(-4.7704895589362195E-18) |
||||||
|
--- testing: -44 / 9.2233720368548E+18 --- |
||||||
|
float(-4.7704895589362195E-18) |
||||||
|
--- testing: -44 / -9223372036854775807 --- |
||||||
|
float(4.7704895589362195E-18) |
||||||
|
--- testing: -44 / -9.2233720368548E+18 --- |
||||||
|
float(4.7704895589362195E-18) |
||||||
|
--- testing: 2147483647 / 9223372036854775807 --- |
||||||
|
float(2.328306435454494E-10) |
||||||
|
--- testing: 2147483647 / -9223372036854775808 --- |
||||||
|
float(-2.328306435454494E-10) |
||||||
|
--- testing: 2147483647 / 2147483647 --- |
||||||
|
int(1) |
||||||
|
--- testing: 2147483647 / -2147483648 --- |
||||||
|
float(-0.9999999995343387) |
||||||
|
--- testing: 2147483647 / 9223372034707292160 --- |
||||||
|
float(2.3283064359965952E-10) |
||||||
|
--- testing: 2147483647 / -9223372034707292160 --- |
||||||
|
float(-2.3283064359965952E-10) |
||||||
|
--- testing: 2147483647 / 2147483648 --- |
||||||
|
float(0.9999999995343387) |
||||||
|
--- testing: 2147483647 / -2147483649 --- |
||||||
|
float(-0.9999999990686774) |
||||||
|
--- testing: 2147483647 / 4294967294 --- |
||||||
|
float(0.5) |
||||||
|
--- testing: 2147483647 / 4294967295 --- |
||||||
|
float(0.4999999998835847) |
||||||
|
--- testing: 2147483647 / 4294967293 --- |
||||||
|
float(0.5000000001164153) |
||||||
|
--- testing: 2147483647 / 9223372036854775806 --- |
||||||
|
float(2.328306435454494E-10) |
||||||
|
--- testing: 2147483647 / 9.2233720368548E+18 --- |
||||||
|
float(2.328306435454494E-10) |
||||||
|
--- testing: 2147483647 / -9223372036854775807 --- |
||||||
|
float(-2.328306435454494E-10) |
||||||
|
--- testing: 2147483647 / -9.2233720368548E+18 --- |
||||||
|
float(-2.328306435454494E-10) |
||||||
|
--- testing: 9223372036854775807 / 9223372036854775807 --- |
||||||
|
int(1) |
||||||
|
--- testing: 9223372036854775807 / -9223372036854775808 --- |
||||||
|
float(-1) |
||||||
|
--- testing: 9223372036854775807 / 2147483647 --- |
||||||
|
float(4294967298) |
||||||
|
--- testing: 9223372036854775807 / -2147483648 --- |
||||||
|
float(-4294967296) |
||||||
|
--- testing: 9223372036854775807 / 9223372034707292160 --- |
||||||
|
float(1.0000000002328306) |
||||||
|
--- testing: 9223372036854775807 / -9223372034707292160 --- |
||||||
|
float(-1.0000000002328306) |
||||||
|
--- testing: 9223372036854775807 / 2147483648 --- |
||||||
|
float(4294967296) |
||||||
|
--- testing: 9223372036854775807 / -2147483649 --- |
||||||
|
float(-4294967294) |
||||||
|
--- testing: 9223372036854775807 / 4294967294 --- |
||||||
|
float(2147483649) |
||||||
|
--- testing: 9223372036854775807 / 4294967295 --- |
||||||
|
float(2147483648.5) |
||||||
|
--- testing: 9223372036854775807 / 4294967293 --- |
||||||
|
float(2147483649.5) |
||||||
|
--- testing: 9223372036854775807 / 9223372036854775806 --- |
||||||
|
float(1) |
||||||
|
--- testing: 9223372036854775807 / 9.2233720368548E+18 --- |
||||||
|
float(1) |
||||||
|
--- testing: 9223372036854775807 / -9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9223372036854775807 / -9.2233720368548E+18 --- |
||||||
|
float(-1) |
||||||
@ -0,0 +1,422 @@ |
|||||||
|
--TEST-- |
||||||
|
Test / operator : various numbers as strings |
||||||
|
--SKIPIF-- |
||||||
|
<?php die("skip");?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$strVals = array( |
||||||
|
"0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", |
||||||
|
"a5.9" |
||||||
|
); |
||||||
|
|
||||||
|
error_reporting(E_ERROR); |
||||||
|
|
||||||
|
foreach ($strVals as $strVal) { |
||||||
|
foreach($strVals as $otherVal) { |
||||||
|
echo "--- testing: '$strVal'/'$otherVal' ---\n"; |
||||||
|
try { |
||||||
|
var_dump($strVal/$otherVal); |
||||||
|
} catch (\TypeError $e) { |
||||||
|
echo $e->getMessage() . \PHP_EOL; |
||||||
|
} catch (\DivisionByZeroError $e) { |
||||||
|
echo $e->getMessage() . \PHP_EOL; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: '0'/'0' --- |
||||||
|
Division by zero |
||||||
|
--- testing: '0'/'65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0'/'-44' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0'/'1.2' --- |
||||||
|
float(0) |
||||||
|
--- testing: '0'/'-7.7' --- |
||||||
|
float(-0) |
||||||
|
--- testing: '0'/'abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '0'/'123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0'/'123e5' --- |
||||||
|
float(0) |
||||||
|
--- testing: '0'/'123e5xyz' --- |
||||||
|
float(0) |
||||||
|
--- testing: '0'/' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0'/'123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0'/'123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0'/'3.4a' --- |
||||||
|
float(0) |
||||||
|
--- testing: '0'/'a5.9' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '65'/'0' --- |
||||||
|
Division by zero |
||||||
|
--- testing: '65'/'65' --- |
||||||
|
int(1) |
||||||
|
--- testing: '65'/'-44' --- |
||||||
|
float(-1.4772727272727273) |
||||||
|
--- testing: '65'/'1.2' --- |
||||||
|
float(54.16666666666667) |
||||||
|
--- testing: '65'/'-7.7' --- |
||||||
|
float(-8.441558441558442) |
||||||
|
--- testing: '65'/'abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '65'/'123abc' --- |
||||||
|
float(0.5284552845528455) |
||||||
|
--- testing: '65'/'123e5' --- |
||||||
|
float(5.2845528455284555E-6) |
||||||
|
--- testing: '65'/'123e5xyz' --- |
||||||
|
float(5.2845528455284555E-6) |
||||||
|
--- testing: '65'/' 123abc' --- |
||||||
|
float(0.5284552845528455) |
||||||
|
--- testing: '65'/'123 abc' --- |
||||||
|
float(0.5284552845528455) |
||||||
|
--- testing: '65'/'123abc ' --- |
||||||
|
float(0.5284552845528455) |
||||||
|
--- testing: '65'/'3.4a' --- |
||||||
|
float(19.11764705882353) |
||||||
|
--- testing: '65'/'a5.9' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '-44'/'0' --- |
||||||
|
Division by zero |
||||||
|
--- testing: '-44'/'65' --- |
||||||
|
float(-0.676923076923077) |
||||||
|
--- testing: '-44'/'-44' --- |
||||||
|
int(1) |
||||||
|
--- testing: '-44'/'1.2' --- |
||||||
|
float(-36.66666666666667) |
||||||
|
--- testing: '-44'/'-7.7' --- |
||||||
|
float(5.714285714285714) |
||||||
|
--- testing: '-44'/'abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '-44'/'123abc' --- |
||||||
|
float(-0.35772357723577236) |
||||||
|
--- testing: '-44'/'123e5' --- |
||||||
|
float(-3.5772357723577236E-6) |
||||||
|
--- testing: '-44'/'123e5xyz' --- |
||||||
|
float(-3.5772357723577236E-6) |
||||||
|
--- testing: '-44'/' 123abc' --- |
||||||
|
float(-0.35772357723577236) |
||||||
|
--- testing: '-44'/'123 abc' --- |
||||||
|
float(-0.35772357723577236) |
||||||
|
--- testing: '-44'/'123abc ' --- |
||||||
|
float(-0.35772357723577236) |
||||||
|
--- testing: '-44'/'3.4a' --- |
||||||
|
float(-12.941176470588236) |
||||||
|
--- testing: '-44'/'a5.9' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '1.2'/'0' --- |
||||||
|
Division by zero |
||||||
|
--- testing: '1.2'/'65' --- |
||||||
|
float(0.01846153846153846) |
||||||
|
--- testing: '1.2'/'-44' --- |
||||||
|
float(-0.02727272727272727) |
||||||
|
--- testing: '1.2'/'1.2' --- |
||||||
|
float(1) |
||||||
|
--- testing: '1.2'/'-7.7' --- |
||||||
|
float(-0.15584415584415584) |
||||||
|
--- testing: '1.2'/'abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '1.2'/'123abc' --- |
||||||
|
float(0.00975609756097561) |
||||||
|
--- testing: '1.2'/'123e5' --- |
||||||
|
float(9.75609756097561E-8) |
||||||
|
--- testing: '1.2'/'123e5xyz' --- |
||||||
|
float(9.75609756097561E-8) |
||||||
|
--- testing: '1.2'/' 123abc' --- |
||||||
|
float(0.00975609756097561) |
||||||
|
--- testing: '1.2'/'123 abc' --- |
||||||
|
float(0.00975609756097561) |
||||||
|
--- testing: '1.2'/'123abc ' --- |
||||||
|
float(0.00975609756097561) |
||||||
|
--- testing: '1.2'/'3.4a' --- |
||||||
|
float(0.35294117647058826) |
||||||
|
--- testing: '1.2'/'a5.9' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '-7.7'/'0' --- |
||||||
|
Division by zero |
||||||
|
--- testing: '-7.7'/'65' --- |
||||||
|
float(-0.11846153846153847) |
||||||
|
--- testing: '-7.7'/'-44' --- |
||||||
|
float(0.17500000000000002) |
||||||
|
--- testing: '-7.7'/'1.2' --- |
||||||
|
float(-6.416666666666667) |
||||||
|
--- testing: '-7.7'/'-7.7' --- |
||||||
|
float(1) |
||||||
|
--- testing: '-7.7'/'abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '-7.7'/'123abc' --- |
||||||
|
float(-0.06260162601626017) |
||||||
|
--- testing: '-7.7'/'123e5' --- |
||||||
|
float(-6.260162601626017E-7) |
||||||
|
--- testing: '-7.7'/'123e5xyz' --- |
||||||
|
float(-6.260162601626017E-7) |
||||||
|
--- testing: '-7.7'/' 123abc' --- |
||||||
|
float(-0.06260162601626017) |
||||||
|
--- testing: '-7.7'/'123 abc' --- |
||||||
|
float(-0.06260162601626017) |
||||||
|
--- testing: '-7.7'/'123abc ' --- |
||||||
|
float(-0.06260162601626017) |
||||||
|
--- testing: '-7.7'/'3.4a' --- |
||||||
|
float(-2.264705882352941) |
||||||
|
--- testing: '-7.7'/'a5.9' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'abc'/'0' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'abc'/'65' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'abc'/'-44' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'abc'/'1.2' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'abc'/'-7.7' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'abc'/'abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'abc'/'123abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'abc'/'123e5' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'abc'/'123e5xyz' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'abc'/' 123abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'abc'/'123 abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'abc'/'123abc ' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'abc'/'3.4a' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'abc'/'a5.9' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '123abc'/'0' --- |
||||||
|
Division by zero |
||||||
|
--- testing: '123abc'/'65' --- |
||||||
|
float(1.8923076923076922) |
||||||
|
--- testing: '123abc'/'-44' --- |
||||||
|
float(-2.7954545454545454) |
||||||
|
--- testing: '123abc'/'1.2' --- |
||||||
|
float(102.5) |
||||||
|
--- testing: '123abc'/'-7.7' --- |
||||||
|
float(-15.974025974025974) |
||||||
|
--- testing: '123abc'/'abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '123abc'/'123abc' --- |
||||||
|
int(1) |
||||||
|
--- testing: '123abc'/'123e5' --- |
||||||
|
float(1.0E-5) |
||||||
|
--- testing: '123abc'/'123e5xyz' --- |
||||||
|
float(1.0E-5) |
||||||
|
--- testing: '123abc'/' 123abc' --- |
||||||
|
int(1) |
||||||
|
--- testing: '123abc'/'123 abc' --- |
||||||
|
int(1) |
||||||
|
--- testing: '123abc'/'123abc ' --- |
||||||
|
int(1) |
||||||
|
--- testing: '123abc'/'3.4a' --- |
||||||
|
float(36.1764705882353) |
||||||
|
--- testing: '123abc'/'a5.9' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '123e5'/'0' --- |
||||||
|
Division by zero |
||||||
|
--- testing: '123e5'/'65' --- |
||||||
|
float(189230.76923076922) |
||||||
|
--- testing: '123e5'/'-44' --- |
||||||
|
float(-279545.45454545453) |
||||||
|
--- testing: '123e5'/'1.2' --- |
||||||
|
float(10250000) |
||||||
|
--- testing: '123e5'/'-7.7' --- |
||||||
|
float(-1597402.5974025973) |
||||||
|
--- testing: '123e5'/'abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '123e5'/'123abc' --- |
||||||
|
float(100000) |
||||||
|
--- testing: '123e5'/'123e5' --- |
||||||
|
float(1) |
||||||
|
--- testing: '123e5'/'123e5xyz' --- |
||||||
|
float(1) |
||||||
|
--- testing: '123e5'/' 123abc' --- |
||||||
|
float(100000) |
||||||
|
--- testing: '123e5'/'123 abc' --- |
||||||
|
float(100000) |
||||||
|
--- testing: '123e5'/'123abc ' --- |
||||||
|
float(100000) |
||||||
|
--- testing: '123e5'/'3.4a' --- |
||||||
|
float(3617647.0588235296) |
||||||
|
--- testing: '123e5'/'a5.9' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '123e5xyz'/'0' --- |
||||||
|
Division by zero |
||||||
|
--- testing: '123e5xyz'/'65' --- |
||||||
|
float(189230.76923076922) |
||||||
|
--- testing: '123e5xyz'/'-44' --- |
||||||
|
float(-279545.45454545453) |
||||||
|
--- testing: '123e5xyz'/'1.2' --- |
||||||
|
float(10250000) |
||||||
|
--- testing: '123e5xyz'/'-7.7' --- |
||||||
|
float(-1597402.5974025973) |
||||||
|
--- testing: '123e5xyz'/'abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '123e5xyz'/'123abc' --- |
||||||
|
float(100000) |
||||||
|
--- testing: '123e5xyz'/'123e5' --- |
||||||
|
float(1) |
||||||
|
--- testing: '123e5xyz'/'123e5xyz' --- |
||||||
|
float(1) |
||||||
|
--- testing: '123e5xyz'/' 123abc' --- |
||||||
|
float(100000) |
||||||
|
--- testing: '123e5xyz'/'123 abc' --- |
||||||
|
float(100000) |
||||||
|
--- testing: '123e5xyz'/'123abc ' --- |
||||||
|
float(100000) |
||||||
|
--- testing: '123e5xyz'/'3.4a' --- |
||||||
|
float(3617647.0588235296) |
||||||
|
--- testing: '123e5xyz'/'a5.9' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: ' 123abc'/'0' --- |
||||||
|
Division by zero |
||||||
|
--- testing: ' 123abc'/'65' --- |
||||||
|
float(1.8923076923076922) |
||||||
|
--- testing: ' 123abc'/'-44' --- |
||||||
|
float(-2.7954545454545454) |
||||||
|
--- testing: ' 123abc'/'1.2' --- |
||||||
|
float(102.5) |
||||||
|
--- testing: ' 123abc'/'-7.7' --- |
||||||
|
float(-15.974025974025974) |
||||||
|
--- testing: ' 123abc'/'abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: ' 123abc'/'123abc' --- |
||||||
|
int(1) |
||||||
|
--- testing: ' 123abc'/'123e5' --- |
||||||
|
float(1.0E-5) |
||||||
|
--- testing: ' 123abc'/'123e5xyz' --- |
||||||
|
float(1.0E-5) |
||||||
|
--- testing: ' 123abc'/' 123abc' --- |
||||||
|
int(1) |
||||||
|
--- testing: ' 123abc'/'123 abc' --- |
||||||
|
int(1) |
||||||
|
--- testing: ' 123abc'/'123abc ' --- |
||||||
|
int(1) |
||||||
|
--- testing: ' 123abc'/'3.4a' --- |
||||||
|
float(36.1764705882353) |
||||||
|
--- testing: ' 123abc'/'a5.9' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '123 abc'/'0' --- |
||||||
|
Division by zero |
||||||
|
--- testing: '123 abc'/'65' --- |
||||||
|
float(1.8923076923076922) |
||||||
|
--- testing: '123 abc'/'-44' --- |
||||||
|
float(-2.7954545454545454) |
||||||
|
--- testing: '123 abc'/'1.2' --- |
||||||
|
float(102.5) |
||||||
|
--- testing: '123 abc'/'-7.7' --- |
||||||
|
float(-15.974025974025974) |
||||||
|
--- testing: '123 abc'/'abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '123 abc'/'123abc' --- |
||||||
|
int(1) |
||||||
|
--- testing: '123 abc'/'123e5' --- |
||||||
|
float(1.0E-5) |
||||||
|
--- testing: '123 abc'/'123e5xyz' --- |
||||||
|
float(1.0E-5) |
||||||
|
--- testing: '123 abc'/' 123abc' --- |
||||||
|
int(1) |
||||||
|
--- testing: '123 abc'/'123 abc' --- |
||||||
|
int(1) |
||||||
|
--- testing: '123 abc'/'123abc ' --- |
||||||
|
int(1) |
||||||
|
--- testing: '123 abc'/'3.4a' --- |
||||||
|
float(36.1764705882353) |
||||||
|
--- testing: '123 abc'/'a5.9' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '123abc '/'0' --- |
||||||
|
Division by zero |
||||||
|
--- testing: '123abc '/'65' --- |
||||||
|
float(1.8923076923076922) |
||||||
|
--- testing: '123abc '/'-44' --- |
||||||
|
float(-2.7954545454545454) |
||||||
|
--- testing: '123abc '/'1.2' --- |
||||||
|
float(102.5) |
||||||
|
--- testing: '123abc '/'-7.7' --- |
||||||
|
float(-15.974025974025974) |
||||||
|
--- testing: '123abc '/'abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '123abc '/'123abc' --- |
||||||
|
int(1) |
||||||
|
--- testing: '123abc '/'123e5' --- |
||||||
|
float(1.0E-5) |
||||||
|
--- testing: '123abc '/'123e5xyz' --- |
||||||
|
float(1.0E-5) |
||||||
|
--- testing: '123abc '/' 123abc' --- |
||||||
|
int(1) |
||||||
|
--- testing: '123abc '/'123 abc' --- |
||||||
|
int(1) |
||||||
|
--- testing: '123abc '/'123abc ' --- |
||||||
|
int(1) |
||||||
|
--- testing: '123abc '/'3.4a' --- |
||||||
|
float(36.1764705882353) |
||||||
|
--- testing: '123abc '/'a5.9' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '3.4a'/'0' --- |
||||||
|
Division by zero |
||||||
|
--- testing: '3.4a'/'65' --- |
||||||
|
float(0.052307692307692305) |
||||||
|
--- testing: '3.4a'/'-44' --- |
||||||
|
float(-0.07727272727272727) |
||||||
|
--- testing: '3.4a'/'1.2' --- |
||||||
|
float(2.8333333333333335) |
||||||
|
--- testing: '3.4a'/'-7.7' --- |
||||||
|
float(-0.44155844155844154) |
||||||
|
--- testing: '3.4a'/'abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: '3.4a'/'123abc' --- |
||||||
|
float(0.027642276422764227) |
||||||
|
--- testing: '3.4a'/'123e5' --- |
||||||
|
float(2.764227642276423E-7) |
||||||
|
--- testing: '3.4a'/'123e5xyz' --- |
||||||
|
float(2.764227642276423E-7) |
||||||
|
--- testing: '3.4a'/' 123abc' --- |
||||||
|
float(0.027642276422764227) |
||||||
|
--- testing: '3.4a'/'123 abc' --- |
||||||
|
float(0.027642276422764227) |
||||||
|
--- testing: '3.4a'/'123abc ' --- |
||||||
|
float(0.027642276422764227) |
||||||
|
--- testing: '3.4a'/'3.4a' --- |
||||||
|
float(1) |
||||||
|
--- testing: '3.4a'/'a5.9' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'a5.9'/'0' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'a5.9'/'65' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'a5.9'/'-44' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'a5.9'/'1.2' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'a5.9'/'-7.7' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'a5.9'/'abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'a5.9'/'123abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'a5.9'/'123e5' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'a5.9'/'123e5xyz' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'a5.9'/' 123abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'a5.9'/'123 abc' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'a5.9'/'123abc ' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'a5.9'/'3.4a' --- |
||||||
|
Unsupported operand types: string / string |
||||||
|
--- testing: 'a5.9'/'a5.9' --- |
||||||
|
Unsupported operand types: string / string |
||||||
@ -0,0 +1,589 @@ |
|||||||
|
--TEST-- |
||||||
|
Test % operator : 64bit long tests |
||||||
|
--SKIPIF-- |
||||||
|
<?php die("skip");?> |
||||||
|
<?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"; |
||||||
|
try { |
||||||
|
var_dump($longVal%$otherVal); |
||||||
|
} catch (DivisionByZeroError $e) { |
||||||
|
echo "Exception: " . $e->getMessage() . "\n"; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
foreach ($otherVals as $otherVal) { |
||||||
|
foreach($longVals as $longVal) { |
||||||
|
echo "--- testing: $otherVal % $longVal ---\n"; |
||||||
|
try { |
||||||
|
var_dump($otherVal%$longVal); |
||||||
|
} catch (DivisionByZeroError $e) { |
||||||
|
echo "Exception: " . $e->getMessage() . "\n"; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: 9223372036854775807 % 0 --- |
||||||
|
Exception: Modulo by zero |
||||||
|
--- testing: 9223372036854775807 % 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 % -1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 % 7 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 % 9 --- |
||||||
|
int(7) |
||||||
|
--- testing: 9223372036854775807 % 65 --- |
||||||
|
int(7) |
||||||
|
--- testing: 9223372036854775807 % -44 --- |
||||||
|
int(7) |
||||||
|
--- testing: 9223372036854775807 % 2147483647 --- |
||||||
|
int(1) |
||||||
|
--- testing: 9223372036854775807 % 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 % 0 --- |
||||||
|
Exception: Modulo by zero |
||||||
|
--- testing: -9223372036854775808 % 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 % -1 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 % 7 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9223372036854775808 % 9 --- |
||||||
|
int(-8) |
||||||
|
--- testing: -9223372036854775808 % 65 --- |
||||||
|
int(-8) |
||||||
|
--- testing: -9223372036854775808 % -44 --- |
||||||
|
int(-8) |
||||||
|
--- testing: -9223372036854775808 % 2147483647 --- |
||||||
|
int(-2) |
||||||
|
--- testing: -9223372036854775808 % 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 2147483647 % 0 --- |
||||||
|
Exception: Modulo by zero |
||||||
|
--- testing: 2147483647 % 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 % -1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 % 7 --- |
||||||
|
int(1) |
||||||
|
--- testing: 2147483647 % 9 --- |
||||||
|
int(1) |
||||||
|
--- testing: 2147483647 % 65 --- |
||||||
|
int(62) |
||||||
|
--- testing: 2147483647 % -44 --- |
||||||
|
int(23) |
||||||
|
--- testing: 2147483647 % 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 % 9223372036854775807 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: -2147483648 % 0 --- |
||||||
|
Exception: Modulo by zero |
||||||
|
--- testing: -2147483648 % 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483648 % -1 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483648 % 7 --- |
||||||
|
int(-2) |
||||||
|
--- testing: -2147483648 % 9 --- |
||||||
|
int(-2) |
||||||
|
--- testing: -2147483648 % 65 --- |
||||||
|
int(-63) |
||||||
|
--- testing: -2147483648 % -44 --- |
||||||
|
int(-24) |
||||||
|
--- testing: -2147483648 % 2147483647 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -2147483648 % 9223372036854775807 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: 9223372034707292160 % 0 --- |
||||||
|
Exception: Modulo by zero |
||||||
|
--- testing: 9223372034707292160 % 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372034707292160 % -1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372034707292160 % 7 --- |
||||||
|
int(6) |
||||||
|
--- testing: 9223372034707292160 % 9 --- |
||||||
|
int(6) |
||||||
|
--- testing: 9223372034707292160 % 65 --- |
||||||
|
int(10) |
||||||
|
--- testing: 9223372034707292160 % -44 --- |
||||||
|
int(28) |
||||||
|
--- testing: 9223372034707292160 % 2147483647 --- |
||||||
|
int(1) |
||||||
|
--- testing: 9223372034707292160 % 9223372036854775807 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: -9223372034707292160 % 0 --- |
||||||
|
Exception: Modulo by zero |
||||||
|
--- testing: -9223372034707292160 % 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372034707292160 % -1 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372034707292160 % 7 --- |
||||||
|
int(-6) |
||||||
|
--- testing: -9223372034707292160 % 9 --- |
||||||
|
int(-6) |
||||||
|
--- testing: -9223372034707292160 % 65 --- |
||||||
|
int(-10) |
||||||
|
--- testing: -9223372034707292160 % -44 --- |
||||||
|
int(-28) |
||||||
|
--- testing: -9223372034707292160 % 2147483647 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9223372034707292160 % 9223372036854775807 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: 2147483648 % 0 --- |
||||||
|
Exception: Modulo by zero |
||||||
|
--- testing: 2147483648 % 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483648 % -1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483648 % 7 --- |
||||||
|
int(2) |
||||||
|
--- testing: 2147483648 % 9 --- |
||||||
|
int(2) |
||||||
|
--- testing: 2147483648 % 65 --- |
||||||
|
int(63) |
||||||
|
--- testing: 2147483648 % -44 --- |
||||||
|
int(24) |
||||||
|
--- testing: 2147483648 % 2147483647 --- |
||||||
|
int(1) |
||||||
|
--- testing: 2147483648 % 9223372036854775807 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: -2147483649 % 0 --- |
||||||
|
Exception: Modulo by zero |
||||||
|
--- testing: -2147483649 % 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483649 % -1 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483649 % 7 --- |
||||||
|
int(-3) |
||||||
|
--- testing: -2147483649 % 9 --- |
||||||
|
int(-3) |
||||||
|
--- testing: -2147483649 % 65 --- |
||||||
|
int(-64) |
||||||
|
--- testing: -2147483649 % -44 --- |
||||||
|
int(-25) |
||||||
|
--- testing: -2147483649 % 2147483647 --- |
||||||
|
int(-2) |
||||||
|
--- testing: -2147483649 % 9223372036854775807 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: 4294967294 % 0 --- |
||||||
|
Exception: Modulo by zero |
||||||
|
--- testing: 4294967294 % 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967294 % -1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967294 % 7 --- |
||||||
|
int(2) |
||||||
|
--- testing: 4294967294 % 9 --- |
||||||
|
int(2) |
||||||
|
--- testing: 4294967294 % 65 --- |
||||||
|
int(59) |
||||||
|
--- testing: 4294967294 % -44 --- |
||||||
|
int(2) |
||||||
|
--- testing: 4294967294 % 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967294 % 9223372036854775807 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 4294967295 % 0 --- |
||||||
|
Exception: Modulo by zero |
||||||
|
--- testing: 4294967295 % 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967295 % -1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967295 % 7 --- |
||||||
|
int(3) |
||||||
|
--- testing: 4294967295 % 9 --- |
||||||
|
int(3) |
||||||
|
--- testing: 4294967295 % 65 --- |
||||||
|
int(60) |
||||||
|
--- testing: 4294967295 % -44 --- |
||||||
|
int(3) |
||||||
|
--- testing: 4294967295 % 2147483647 --- |
||||||
|
int(1) |
||||||
|
--- testing: 4294967295 % 9223372036854775807 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967293 % 0 --- |
||||||
|
Exception: Modulo by zero |
||||||
|
--- testing: 4294967293 % 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967293 % -1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967293 % 7 --- |
||||||
|
int(1) |
||||||
|
--- testing: 4294967293 % 9 --- |
||||||
|
int(1) |
||||||
|
--- testing: 4294967293 % 65 --- |
||||||
|
int(58) |
||||||
|
--- testing: 4294967293 % -44 --- |
||||||
|
int(1) |
||||||
|
--- testing: 4294967293 % 2147483647 --- |
||||||
|
int(2147483646) |
||||||
|
--- testing: 4294967293 % 9223372036854775807 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 9223372036854775806 % 0 --- |
||||||
|
Exception: Modulo by zero |
||||||
|
--- testing: 9223372036854775806 % 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775806 % -1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775806 % 7 --- |
||||||
|
int(6) |
||||||
|
--- testing: 9223372036854775806 % 9 --- |
||||||
|
int(6) |
||||||
|
--- testing: 9223372036854775806 % 65 --- |
||||||
|
int(6) |
||||||
|
--- testing: 9223372036854775806 % -44 --- |
||||||
|
int(6) |
||||||
|
--- testing: 9223372036854775806 % 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775806 % 9223372036854775807 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 9.2233720368548E+18 % 0 --- |
||||||
|
Exception: Modulo by zero |
||||||
|
--- testing: 9.2233720368548E+18 % 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9.2233720368548E+18 % -1 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9.2233720368548E+18 % 7 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9.2233720368548E+18 % 9 --- |
||||||
|
int(-8) |
||||||
|
--- testing: 9.2233720368548E+18 % 65 --- |
||||||
|
int(-8) |
||||||
|
--- testing: 9.2233720368548E+18 % -44 --- |
||||||
|
int(-8) |
||||||
|
--- testing: 9.2233720368548E+18 % 2147483647 --- |
||||||
|
int(-2) |
||||||
|
--- testing: 9.2233720368548E+18 % 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9223372036854775807 % 0 --- |
||||||
|
Exception: Modulo by zero |
||||||
|
--- testing: -9223372036854775807 % 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775807 % -1 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775807 % 7 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775807 % 9 --- |
||||||
|
int(-7) |
||||||
|
--- testing: -9223372036854775807 % 65 --- |
||||||
|
int(-7) |
||||||
|
--- testing: -9223372036854775807 % -44 --- |
||||||
|
int(-7) |
||||||
|
--- testing: -9223372036854775807 % 2147483647 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9223372036854775807 % 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9.2233720368548E+18 % 0 --- |
||||||
|
Exception: Modulo by zero |
||||||
|
--- testing: -9.2233720368548E+18 % 1 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9.2233720368548E+18 % -1 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9.2233720368548E+18 % 7 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -9.2233720368548E+18 % 9 --- |
||||||
|
int(-8) |
||||||
|
--- testing: -9.2233720368548E+18 % 65 --- |
||||||
|
int(-8) |
||||||
|
--- testing: -9.2233720368548E+18 % -44 --- |
||||||
|
int(-8) |
||||||
|
--- testing: -9.2233720368548E+18 % 2147483647 --- |
||||||
|
int(-2) |
||||||
|
--- testing: -9.2233720368548E+18 % 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- 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(1) |
||||||
|
--- testing: 1 % -9223372036854775808 --- |
||||||
|
int(1) |
||||||
|
--- testing: 1 % 2147483647 --- |
||||||
|
int(1) |
||||||
|
--- testing: 1 % -2147483648 --- |
||||||
|
int(1) |
||||||
|
--- testing: 1 % 9223372034707292160 --- |
||||||
|
int(1) |
||||||
|
--- testing: 1 % -9223372034707292160 --- |
||||||
|
int(1) |
||||||
|
--- testing: 1 % 2147483648 --- |
||||||
|
int(1) |
||||||
|
--- testing: 1 % -2147483649 --- |
||||||
|
int(1) |
||||||
|
--- testing: 1 % 4294967294 --- |
||||||
|
int(1) |
||||||
|
--- testing: 1 % 4294967295 --- |
||||||
|
int(1) |
||||||
|
--- testing: 1 % 4294967293 --- |
||||||
|
int(1) |
||||||
|
--- testing: 1 % 9223372036854775806 --- |
||||||
|
int(1) |
||||||
|
--- testing: 1 % 9.2233720368548E+18 --- |
||||||
|
int(1) |
||||||
|
--- testing: 1 % -9223372036854775807 --- |
||||||
|
int(1) |
||||||
|
--- testing: 1 % -9.2233720368548E+18 --- |
||||||
|
int(1) |
||||||
|
--- testing: -1 % 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 % -9223372036854775808 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 % 2147483647 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 % -2147483648 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 % 9223372034707292160 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 % -9223372034707292160 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 % 2147483648 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 % -2147483649 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 % 4294967294 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 % 4294967295 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 % 4294967293 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 % 9223372036854775806 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 % 9.2233720368548E+18 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 % -9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: -1 % -9.2233720368548E+18 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 7 % 9223372036854775807 --- |
||||||
|
int(7) |
||||||
|
--- testing: 7 % -9223372036854775808 --- |
||||||
|
int(7) |
||||||
|
--- testing: 7 % 2147483647 --- |
||||||
|
int(7) |
||||||
|
--- testing: 7 % -2147483648 --- |
||||||
|
int(7) |
||||||
|
--- testing: 7 % 9223372034707292160 --- |
||||||
|
int(7) |
||||||
|
--- testing: 7 % -9223372034707292160 --- |
||||||
|
int(7) |
||||||
|
--- testing: 7 % 2147483648 --- |
||||||
|
int(7) |
||||||
|
--- testing: 7 % -2147483649 --- |
||||||
|
int(7) |
||||||
|
--- testing: 7 % 4294967294 --- |
||||||
|
int(7) |
||||||
|
--- testing: 7 % 4294967295 --- |
||||||
|
int(7) |
||||||
|
--- testing: 7 % 4294967293 --- |
||||||
|
int(7) |
||||||
|
--- testing: 7 % 9223372036854775806 --- |
||||||
|
int(7) |
||||||
|
--- testing: 7 % 9.2233720368548E+18 --- |
||||||
|
int(7) |
||||||
|
--- testing: 7 % -9223372036854775807 --- |
||||||
|
int(7) |
||||||
|
--- testing: 7 % -9.2233720368548E+18 --- |
||||||
|
int(7) |
||||||
|
--- testing: 9 % 9223372036854775807 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 % -9223372036854775808 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 % 2147483647 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 % -2147483648 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 % 9223372034707292160 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 % -9223372034707292160 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 % 2147483648 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 % -2147483649 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 % 4294967294 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 % 4294967295 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 % 4294967293 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 % 9223372036854775806 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 % 9.2233720368548E+18 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 % -9223372036854775807 --- |
||||||
|
int(9) |
||||||
|
--- testing: 9 % -9.2233720368548E+18 --- |
||||||
|
int(9) |
||||||
|
--- testing: 65 % 9223372036854775807 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 % -9223372036854775808 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 % 2147483647 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 % -2147483648 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 % 9223372034707292160 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 % -9223372034707292160 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 % 2147483648 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 % -2147483649 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 % 4294967294 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 % 4294967295 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 % 4294967293 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 % 9223372036854775806 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 % 9.2233720368548E+18 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 % -9223372036854775807 --- |
||||||
|
int(65) |
||||||
|
--- testing: 65 % -9.2233720368548E+18 --- |
||||||
|
int(65) |
||||||
|
--- testing: -44 % 9223372036854775807 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 % -9223372036854775808 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 % 2147483647 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 % -2147483648 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 % 9223372034707292160 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 % -9223372034707292160 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 % 2147483648 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 % -2147483649 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 % 4294967294 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 % 4294967295 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 % 4294967293 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 % 9223372036854775806 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 % 9.2233720368548E+18 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 % -9223372036854775807 --- |
||||||
|
int(-44) |
||||||
|
--- testing: -44 % -9.2233720368548E+18 --- |
||||||
|
int(-44) |
||||||
|
--- testing: 2147483647 % 9223372036854775807 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 % -9223372036854775808 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 % 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 % -2147483648 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 % 9223372034707292160 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 % -9223372034707292160 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 % 2147483648 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 % -2147483649 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 % 4294967294 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 % 4294967295 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 % 4294967293 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 % 9223372036854775806 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 % 9.2233720368548E+18 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 % -9223372036854775807 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 % -9.2233720368548E+18 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 9223372036854775807 % 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 % -9223372036854775808 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 % 2147483647 --- |
||||||
|
int(1) |
||||||
|
--- testing: 9223372036854775807 % -2147483648 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 9223372036854775807 % 9223372034707292160 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 9223372036854775807 % -9223372034707292160 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 9223372036854775807 % 2147483648 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 9223372036854775807 % -2147483649 --- |
||||||
|
int(1) |
||||||
|
--- testing: 9223372036854775807 % 4294967294 --- |
||||||
|
int(1) |
||||||
|
--- testing: 9223372036854775807 % 4294967295 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 9223372036854775807 % 4294967293 --- |
||||||
|
int(2147483650) |
||||||
|
--- testing: 9223372036854775807 % 9223372036854775806 --- |
||||||
|
int(1) |
||||||
|
--- testing: 9223372036854775807 % 9.2233720368548E+18 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 % -9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 % -9.2233720368548E+18 --- |
||||||
|
int(9223372036854775807) |
||||||
@ -0,0 +1,420 @@ |
|||||||
|
--TEST-- |
||||||
|
Test % operator : various numbers as strings |
||||||
|
--SKIPIF-- |
||||||
|
<?php die("skip");?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$strVals = array( |
||||||
|
"0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", |
||||||
|
"a5.9" |
||||||
|
); |
||||||
|
|
||||||
|
error_reporting(E_ERROR); |
||||||
|
|
||||||
|
foreach ($strVals as $strVal) { |
||||||
|
foreach($strVals as $otherVal) { |
||||||
|
echo "--- testing: '$strVal' % '$otherVal' ---\n"; |
||||||
|
try { |
||||||
|
var_dump($strVal%$otherVal); |
||||||
|
} catch (\Throwable $e) { |
||||||
|
echo get_class($e) . ': ' . $e->getMessage() . "\n"; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: '0' % '0' --- |
||||||
|
DivisionByZeroError: Modulo by zero |
||||||
|
--- testing: '0' % '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' % '-44' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' % '1.2' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' % '-7.7' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' % 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '0' % '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' % '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' % '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' % ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' % '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' % '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' % '3.4a' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' % 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '65' % '0' --- |
||||||
|
DivisionByZeroError: Modulo by zero |
||||||
|
--- testing: '65' % '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' % '-44' --- |
||||||
|
int(21) |
||||||
|
--- testing: '65' % '1.2' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' % '-7.7' --- |
||||||
|
int(2) |
||||||
|
--- testing: '65' % 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '65' % '123abc' --- |
||||||
|
int(65) |
||||||
|
--- testing: '65' % '123e5' --- |
||||||
|
int(65) |
||||||
|
--- testing: '65' % '123e5xyz' --- |
||||||
|
int(65) |
||||||
|
--- testing: '65' % ' 123abc' --- |
||||||
|
int(65) |
||||||
|
--- testing: '65' % '123 abc' --- |
||||||
|
int(65) |
||||||
|
--- testing: '65' % '123abc ' --- |
||||||
|
int(65) |
||||||
|
--- testing: '65' % '3.4a' --- |
||||||
|
int(2) |
||||||
|
--- testing: '65' % 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '-44' % '0' --- |
||||||
|
DivisionByZeroError: Modulo by zero |
||||||
|
--- testing: '-44' % '65' --- |
||||||
|
int(-44) |
||||||
|
--- testing: '-44' % '-44' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-44' % '1.2' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-44' % '-7.7' --- |
||||||
|
int(-2) |
||||||
|
--- testing: '-44' % 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '-44' % '123abc' --- |
||||||
|
int(-44) |
||||||
|
--- testing: '-44' % '123e5' --- |
||||||
|
int(-44) |
||||||
|
--- testing: '-44' % '123e5xyz' --- |
||||||
|
int(-44) |
||||||
|
--- testing: '-44' % ' 123abc' --- |
||||||
|
int(-44) |
||||||
|
--- testing: '-44' % '123 abc' --- |
||||||
|
int(-44) |
||||||
|
--- testing: '-44' % '123abc ' --- |
||||||
|
int(-44) |
||||||
|
--- testing: '-44' % '3.4a' --- |
||||||
|
int(-2) |
||||||
|
--- testing: '-44' % 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '1.2' % '0' --- |
||||||
|
DivisionByZeroError: Modulo by zero |
||||||
|
--- testing: '1.2' % '65' --- |
||||||
|
int(1) |
||||||
|
--- testing: '1.2' % '-44' --- |
||||||
|
int(1) |
||||||
|
--- testing: '1.2' % '1.2' --- |
||||||
|
int(0) |
||||||
|
--- testing: '1.2' % '-7.7' --- |
||||||
|
int(1) |
||||||
|
--- testing: '1.2' % 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '1.2' % '123abc' --- |
||||||
|
int(1) |
||||||
|
--- testing: '1.2' % '123e5' --- |
||||||
|
int(1) |
||||||
|
--- testing: '1.2' % '123e5xyz' --- |
||||||
|
int(1) |
||||||
|
--- testing: '1.2' % ' 123abc' --- |
||||||
|
int(1) |
||||||
|
--- testing: '1.2' % '123 abc' --- |
||||||
|
int(1) |
||||||
|
--- testing: '1.2' % '123abc ' --- |
||||||
|
int(1) |
||||||
|
--- testing: '1.2' % '3.4a' --- |
||||||
|
int(1) |
||||||
|
--- testing: '1.2' % 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '-7.7' % '0' --- |
||||||
|
DivisionByZeroError: Modulo by zero |
||||||
|
--- testing: '-7.7' % '65' --- |
||||||
|
int(-7) |
||||||
|
--- testing: '-7.7' % '-44' --- |
||||||
|
int(-7) |
||||||
|
--- testing: '-7.7' % '1.2' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-7.7' % '-7.7' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-7.7' % 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '-7.7' % '123abc' --- |
||||||
|
int(-7) |
||||||
|
--- testing: '-7.7' % '123e5' --- |
||||||
|
int(-7) |
||||||
|
--- testing: '-7.7' % '123e5xyz' --- |
||||||
|
int(-7) |
||||||
|
--- testing: '-7.7' % ' 123abc' --- |
||||||
|
int(-7) |
||||||
|
--- testing: '-7.7' % '123 abc' --- |
||||||
|
int(-7) |
||||||
|
--- testing: '-7.7' % '123abc ' --- |
||||||
|
int(-7) |
||||||
|
--- testing: '-7.7' % '3.4a' --- |
||||||
|
int(-1) |
||||||
|
--- testing: '-7.7' % 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'abc' % '0' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'abc' % '65' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'abc' % '-44' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'abc' % '1.2' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'abc' % '-7.7' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'abc' % 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'abc' % '123abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'abc' % '123e5' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'abc' % '123e5xyz' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'abc' % ' 123abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'abc' % '123 abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'abc' % '123abc ' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'abc' % '3.4a' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'abc' % 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '123abc' % '0' --- |
||||||
|
DivisionByZeroError: Modulo by zero |
||||||
|
--- testing: '123abc' % '65' --- |
||||||
|
int(58) |
||||||
|
--- testing: '123abc' % '-44' --- |
||||||
|
int(35) |
||||||
|
--- testing: '123abc' % '1.2' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' % '-7.7' --- |
||||||
|
int(4) |
||||||
|
--- testing: '123abc' % 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '123abc' % '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' % '123e5' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123abc' % '123e5xyz' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123abc' % ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' % '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' % '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' % '3.4a' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' % 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '123e5' % '0' --- |
||||||
|
DivisionByZeroError: Modulo by zero |
||||||
|
--- testing: '123e5' % '65' --- |
||||||
|
int(50) |
||||||
|
--- testing: '123e5' % '-44' --- |
||||||
|
int(20) |
||||||
|
--- testing: '123e5' % '1.2' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' % '-7.7' --- |
||||||
|
int(6) |
||||||
|
--- testing: '123e5' % 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '123e5' % '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' % '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' % '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' % ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' % '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' % '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' % '3.4a' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5' % 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '123e5xyz' % '0' --- |
||||||
|
DivisionByZeroError: Modulo by zero |
||||||
|
--- testing: '123e5xyz' % '65' --- |
||||||
|
int(50) |
||||||
|
--- testing: '123e5xyz' % '-44' --- |
||||||
|
int(20) |
||||||
|
--- testing: '123e5xyz' % '1.2' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' % '-7.7' --- |
||||||
|
int(6) |
||||||
|
--- testing: '123e5xyz' % 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '123e5xyz' % '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' % '123e5' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' % '123e5xyz' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' % ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' % '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' % '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' % '3.4a' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123e5xyz' % 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: ' 123abc' % '0' --- |
||||||
|
DivisionByZeroError: Modulo by zero |
||||||
|
--- testing: ' 123abc' % '65' --- |
||||||
|
int(58) |
||||||
|
--- testing: ' 123abc' % '-44' --- |
||||||
|
int(35) |
||||||
|
--- testing: ' 123abc' % '1.2' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' % '-7.7' --- |
||||||
|
int(4) |
||||||
|
--- testing: ' 123abc' % 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: ' 123abc' % '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' % '123e5' --- |
||||||
|
int(123) |
||||||
|
--- testing: ' 123abc' % '123e5xyz' --- |
||||||
|
int(123) |
||||||
|
--- testing: ' 123abc' % ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' % '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' % '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' % '3.4a' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' % 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '123 abc' % '0' --- |
||||||
|
DivisionByZeroError: Modulo by zero |
||||||
|
--- testing: '123 abc' % '65' --- |
||||||
|
int(58) |
||||||
|
--- testing: '123 abc' % '-44' --- |
||||||
|
int(35) |
||||||
|
--- testing: '123 abc' % '1.2' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' % '-7.7' --- |
||||||
|
int(4) |
||||||
|
--- testing: '123 abc' % 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '123 abc' % '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' % '123e5' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123 abc' % '123e5xyz' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123 abc' % ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' % '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' % '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' % '3.4a' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' % 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '123abc ' % '0' --- |
||||||
|
DivisionByZeroError: Modulo by zero |
||||||
|
--- testing: '123abc ' % '65' --- |
||||||
|
int(58) |
||||||
|
--- testing: '123abc ' % '-44' --- |
||||||
|
int(35) |
||||||
|
--- testing: '123abc ' % '1.2' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' % '-7.7' --- |
||||||
|
int(4) |
||||||
|
--- testing: '123abc ' % 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '123abc ' % '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' % '123e5' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123abc ' % '123e5xyz' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123abc ' % ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' % '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' % '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' % '3.4a' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' % 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '3.4a' % '0' --- |
||||||
|
DivisionByZeroError: Modulo by zero |
||||||
|
--- testing: '3.4a' % '65' --- |
||||||
|
int(3) |
||||||
|
--- testing: '3.4a' % '-44' --- |
||||||
|
int(3) |
||||||
|
--- testing: '3.4a' % '1.2' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' % '-7.7' --- |
||||||
|
int(3) |
||||||
|
--- testing: '3.4a' % 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: '3.4a' % '123abc' --- |
||||||
|
int(3) |
||||||
|
--- testing: '3.4a' % '123e5' --- |
||||||
|
int(3) |
||||||
|
--- testing: '3.4a' % '123e5xyz' --- |
||||||
|
int(3) |
||||||
|
--- testing: '3.4a' % ' 123abc' --- |
||||||
|
int(3) |
||||||
|
--- testing: '3.4a' % '123 abc' --- |
||||||
|
int(3) |
||||||
|
--- testing: '3.4a' % '123abc ' --- |
||||||
|
int(3) |
||||||
|
--- testing: '3.4a' % '3.4a' --- |
||||||
|
int(0) |
||||||
|
--- testing: '3.4a' % 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'a5.9' % '0' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'a5.9' % '65' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'a5.9' % '-44' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'a5.9' % '1.2' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'a5.9' % '-7.7' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'a5.9' % 'abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'a5.9' % '123abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'a5.9' % '123e5' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'a5.9' % '123e5xyz' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'a5.9' % ' 123abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'a5.9' % '123 abc' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'a5.9' % '123abc ' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'a5.9' % '3.4a' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
|
--- testing: 'a5.9' % 'a5.9' --- |
||||||
|
TypeError: Unsupported operand types: string % string |
||||||
@ -0,0 +1,580 @@ |
|||||||
|
--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.0, MIN_64Bit + 1, MIN_64Bit - 1.0 |
||||||
|
); |
||||||
|
|
||||||
|
$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); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: 9223372036854775807 * 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 * 1 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 * -1 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 * 7 --- |
||||||
|
float(6.456360425798343E+19) |
||||||
|
--- testing: 9223372036854775807 * 9 --- |
||||||
|
float(8.301034833169298E+19) |
||||||
|
--- testing: 9223372036854775807 * 65 --- |
||||||
|
float(5.995191823955604E+20) |
||||||
|
--- testing: 9223372036854775807 * -44 --- |
||||||
|
float(-4.0582836962161014E+20) |
||||||
|
--- testing: 9223372036854775807 * 2147483647 --- |
||||||
|
float(1.9807040619342712E+28) |
||||||
|
--- testing: 9223372036854775807 * 9223372036854775807 --- |
||||||
|
float(8.507059173023462E+37) |
||||||
|
--- testing: -9223372036854775808 * 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 * 1 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9223372036854775808 * -1 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775808 * 7 --- |
||||||
|
float(-6.456360425798343E+19) |
||||||
|
--- testing: -9223372036854775808 * 9 --- |
||||||
|
float(-8.301034833169298E+19) |
||||||
|
--- testing: -9223372036854775808 * 65 --- |
||||||
|
float(-5.995191823955604E+20) |
||||||
|
--- testing: -9223372036854775808 * -44 --- |
||||||
|
float(4.0582836962161014E+20) |
||||||
|
--- testing: -9223372036854775808 * 2147483647 --- |
||||||
|
float(-1.9807040619342712E+28) |
||||||
|
--- testing: -9223372036854775808 * 9223372036854775807 --- |
||||||
|
float(-8.507059173023462E+37) |
||||||
|
--- testing: 2147483647 * 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 * 1 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 * -1 --- |
||||||
|
int(-2147483647) |
||||||
|
--- testing: 2147483647 * 7 --- |
||||||
|
int(15032385529) |
||||||
|
--- testing: 2147483647 * 9 --- |
||||||
|
int(19327352823) |
||||||
|
--- testing: 2147483647 * 65 --- |
||||||
|
int(139586437055) |
||||||
|
--- testing: 2147483647 * -44 --- |
||||||
|
int(-94489280468) |
||||||
|
--- testing: 2147483647 * 2147483647 --- |
||||||
|
int(4611686014132420609) |
||||||
|
--- testing: 2147483647 * 9223372036854775807 --- |
||||||
|
float(1.9807040619342712E+28) |
||||||
|
--- testing: -2147483648 * 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483648 * 1 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -2147483648 * -1 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: -2147483648 * 7 --- |
||||||
|
int(-15032385536) |
||||||
|
--- testing: -2147483648 * 9 --- |
||||||
|
int(-19327352832) |
||||||
|
--- testing: -2147483648 * 65 --- |
||||||
|
int(-139586437120) |
||||||
|
--- testing: -2147483648 * -44 --- |
||||||
|
int(94489280512) |
||||||
|
--- testing: -2147483648 * 2147483647 --- |
||||||
|
int(-4611686016279904256) |
||||||
|
--- testing: -2147483648 * 9223372036854775807 --- |
||||||
|
float(-1.9807040628566084E+28) |
||||||
|
--- testing: 9223372034707292160 * 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372034707292160 * 1 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 9223372034707292160 * -1 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: 9223372034707292160 * 7 --- |
||||||
|
float(6.4563604242951045E+19) |
||||||
|
--- testing: 9223372034707292160 * 9 --- |
||||||
|
float(8.301034831236563E+19) |
||||||
|
--- testing: 9223372034707292160 * 65 --- |
||||||
|
float(5.99519182255974E+20) |
||||||
|
--- testing: 9223372034707292160 * -44 --- |
||||||
|
float(-4.0582836952712086E+20) |
||||||
|
--- testing: 9223372034707292160 * 2147483647 --- |
||||||
|
float(1.9807040614731026E+28) |
||||||
|
--- testing: 9223372034707292160 * 9223372036854775807 --- |
||||||
|
float(8.5070591710427575E+37) |
||||||
|
--- testing: -9223372034707292160 * 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372034707292160 * 1 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: -9223372034707292160 * -1 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: -9223372034707292160 * 7 --- |
||||||
|
float(-6.4563604242951045E+19) |
||||||
|
--- testing: -9223372034707292160 * 9 --- |
||||||
|
float(-8.301034831236563E+19) |
||||||
|
--- testing: -9223372034707292160 * 65 --- |
||||||
|
float(-5.99519182255974E+20) |
||||||
|
--- testing: -9223372034707292160 * -44 --- |
||||||
|
float(4.0582836952712086E+20) |
||||||
|
--- testing: -9223372034707292160 * 2147483647 --- |
||||||
|
float(-1.9807040614731026E+28) |
||||||
|
--- testing: -9223372034707292160 * 9223372036854775807 --- |
||||||
|
float(-8.5070591710427575E+37) |
||||||
|
--- testing: 2147483648 * 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483648 * 1 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 2147483648 * -1 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: 2147483648 * 7 --- |
||||||
|
int(15032385536) |
||||||
|
--- testing: 2147483648 * 9 --- |
||||||
|
int(19327352832) |
||||||
|
--- testing: 2147483648 * 65 --- |
||||||
|
int(139586437120) |
||||||
|
--- testing: 2147483648 * -44 --- |
||||||
|
int(-94489280512) |
||||||
|
--- testing: 2147483648 * 2147483647 --- |
||||||
|
int(4611686016279904256) |
||||||
|
--- testing: 2147483648 * 9223372036854775807 --- |
||||||
|
float(1.9807040628566084E+28) |
||||||
|
--- testing: -2147483649 * 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: -2147483649 * 1 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -2147483649 * -1 --- |
||||||
|
int(2147483649) |
||||||
|
--- testing: -2147483649 * 7 --- |
||||||
|
int(-15032385543) |
||||||
|
--- testing: -2147483649 * 9 --- |
||||||
|
int(-19327352841) |
||||||
|
--- testing: -2147483649 * 65 --- |
||||||
|
int(-139586437185) |
||||||
|
--- testing: -2147483649 * -44 --- |
||||||
|
int(94489280556) |
||||||
|
--- testing: -2147483649 * 2147483647 --- |
||||||
|
int(-4611686018427387903) |
||||||
|
--- testing: -2147483649 * 9223372036854775807 --- |
||||||
|
float(-1.9807040637789456E+28) |
||||||
|
--- testing: 4294967294 * 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967294 * 1 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 4294967294 * -1 --- |
||||||
|
int(-4294967294) |
||||||
|
--- testing: 4294967294 * 7 --- |
||||||
|
int(30064771058) |
||||||
|
--- testing: 4294967294 * 9 --- |
||||||
|
int(38654705646) |
||||||
|
--- testing: 4294967294 * 65 --- |
||||||
|
int(279172874110) |
||||||
|
--- testing: 4294967294 * -44 --- |
||||||
|
int(-188978560936) |
||||||
|
--- testing: 4294967294 * 2147483647 --- |
||||||
|
int(9223372028264841218) |
||||||
|
--- testing: 4294967294 * 9223372036854775807 --- |
||||||
|
float(3.9614081238685425E+28) |
||||||
|
--- testing: 4294967295 * 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967295 * 1 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967295 * -1 --- |
||||||
|
int(-4294967295) |
||||||
|
--- testing: 4294967295 * 7 --- |
||||||
|
int(30064771065) |
||||||
|
--- testing: 4294967295 * 9 --- |
||||||
|
int(38654705655) |
||||||
|
--- testing: 4294967295 * 65 --- |
||||||
|
int(279172874175) |
||||||
|
--- testing: 4294967295 * -44 --- |
||||||
|
int(-188978560980) |
||||||
|
--- testing: 4294967295 * 2147483647 --- |
||||||
|
int(9223372030412324865) |
||||||
|
--- testing: 4294967295 * 9223372036854775807 --- |
||||||
|
float(3.9614081247908797E+28) |
||||||
|
--- testing: 4294967293 * 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: 4294967293 * 1 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 4294967293 * -1 --- |
||||||
|
int(-4294967293) |
||||||
|
--- testing: 4294967293 * 7 --- |
||||||
|
int(30064771051) |
||||||
|
--- testing: 4294967293 * 9 --- |
||||||
|
int(38654705637) |
||||||
|
--- testing: 4294967293 * 65 --- |
||||||
|
int(279172874045) |
||||||
|
--- testing: 4294967293 * -44 --- |
||||||
|
int(-188978560892) |
||||||
|
--- testing: 4294967293 * 2147483647 --- |
||||||
|
int(9223372026117357571) |
||||||
|
--- testing: 4294967293 * 9223372036854775807 --- |
||||||
|
float(3.9614081229462053E+28) |
||||||
|
--- testing: 9223372036854775806 * 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775806 * 1 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 9223372036854775806 * -1 --- |
||||||
|
int(-9223372036854775806) |
||||||
|
--- testing: 9223372036854775806 * 7 --- |
||||||
|
float(6.456360425798343E+19) |
||||||
|
--- testing: 9223372036854775806 * 9 --- |
||||||
|
float(8.301034833169298E+19) |
||||||
|
--- testing: 9223372036854775806 * 65 --- |
||||||
|
float(5.995191823955604E+20) |
||||||
|
--- testing: 9223372036854775806 * -44 --- |
||||||
|
float(-4.0582836962161014E+20) |
||||||
|
--- testing: 9223372036854775806 * 2147483647 --- |
||||||
|
float(1.9807040619342712E+28) |
||||||
|
--- testing: 9223372036854775806 * 9223372036854775807 --- |
||||||
|
float(8.507059173023462E+37) |
||||||
|
--- testing: 9.2233720368548E+18 * 0 --- |
||||||
|
float(0) |
||||||
|
--- testing: 9.2233720368548E+18 * 1 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9.2233720368548E+18 * -1 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: 9.2233720368548E+18 * 7 --- |
||||||
|
float(6.456360425798343E+19) |
||||||
|
--- testing: 9.2233720368548E+18 * 9 --- |
||||||
|
float(8.301034833169298E+19) |
||||||
|
--- testing: 9.2233720368548E+18 * 65 --- |
||||||
|
float(5.995191823955604E+20) |
||||||
|
--- testing: 9.2233720368548E+18 * -44 --- |
||||||
|
float(-4.0582836962161014E+20) |
||||||
|
--- testing: 9.2233720368548E+18 * 2147483647 --- |
||||||
|
float(1.9807040619342712E+28) |
||||||
|
--- testing: 9.2233720368548E+18 * 9223372036854775807 --- |
||||||
|
float(8.507059173023462E+37) |
||||||
|
--- testing: -9223372036854775807 * 0 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775807 * 1 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -9223372036854775807 * -1 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: -9223372036854775807 * 7 --- |
||||||
|
float(-6.456360425798343E+19) |
||||||
|
--- testing: -9223372036854775807 * 9 --- |
||||||
|
float(-8.301034833169298E+19) |
||||||
|
--- testing: -9223372036854775807 * 65 --- |
||||||
|
float(-5.995191823955604E+20) |
||||||
|
--- testing: -9223372036854775807 * -44 --- |
||||||
|
float(4.0582836962161014E+20) |
||||||
|
--- testing: -9223372036854775807 * 2147483647 --- |
||||||
|
float(-1.9807040619342712E+28) |
||||||
|
--- testing: -9223372036854775807 * 9223372036854775807 --- |
||||||
|
float(-8.507059173023462E+37) |
||||||
|
--- testing: -9.2233720368548E+18 * 0 --- |
||||||
|
float(-0) |
||||||
|
--- testing: -9.2233720368548E+18 * 1 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9.2233720368548E+18 * -1 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: -9.2233720368548E+18 * 7 --- |
||||||
|
float(-6.456360425798343E+19) |
||||||
|
--- testing: -9.2233720368548E+18 * 9 --- |
||||||
|
float(-8.301034833169298E+19) |
||||||
|
--- testing: -9.2233720368548E+18 * 65 --- |
||||||
|
float(-5.995191823955604E+20) |
||||||
|
--- testing: -9.2233720368548E+18 * -44 --- |
||||||
|
float(4.0582836962161014E+20) |
||||||
|
--- testing: -9.2233720368548E+18 * 2147483647 --- |
||||||
|
float(-1.9807040619342712E+28) |
||||||
|
--- testing: -9.2233720368548E+18 * 9223372036854775807 --- |
||||||
|
float(-8.507059173023462E+37) |
||||||
|
--- 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 --- |
||||||
|
float(0) |
||||||
|
--- testing: 0 * -9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 0 * -9.2233720368548E+18 --- |
||||||
|
float(-0) |
||||||
|
--- testing: 1 * 9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 1 * -9223372036854775808 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: 1 * 2147483647 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 1 * -2147483648 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: 1 * 9223372034707292160 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 1 * -9223372034707292160 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: 1 * 2147483648 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 1 * -2147483649 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: 1 * 4294967294 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 1 * 4294967295 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 1 * 4294967293 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 1 * 9223372036854775806 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 1 * 9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 1 * -9223372036854775807 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 1 * -9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -1 * 9223372036854775807 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -1 * -9223372036854775808 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: -1 * 2147483647 --- |
||||||
|
int(-2147483647) |
||||||
|
--- testing: -1 * -2147483648 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: -1 * 9223372034707292160 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: -1 * -9223372034707292160 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: -1 * 2147483648 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -1 * -2147483649 --- |
||||||
|
int(2147483649) |
||||||
|
--- testing: -1 * 4294967294 --- |
||||||
|
int(-4294967294) |
||||||
|
--- testing: -1 * 4294967295 --- |
||||||
|
int(-4294967295) |
||||||
|
--- testing: -1 * 4294967293 --- |
||||||
|
int(-4294967293) |
||||||
|
--- testing: -1 * 9223372036854775806 --- |
||||||
|
int(-9223372036854775806) |
||||||
|
--- testing: -1 * 9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -1 * -9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: -1 * -9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 7 * 9223372036854775807 --- |
||||||
|
float(6.456360425798343E+19) |
||||||
|
--- testing: 7 * -9223372036854775808 --- |
||||||
|
float(-6.456360425798343E+19) |
||||||
|
--- testing: 7 * 2147483647 --- |
||||||
|
int(15032385529) |
||||||
|
--- testing: 7 * -2147483648 --- |
||||||
|
int(-15032385536) |
||||||
|
--- testing: 7 * 9223372034707292160 --- |
||||||
|
float(6.4563604242951045E+19) |
||||||
|
--- testing: 7 * -9223372034707292160 --- |
||||||
|
float(-6.4563604242951045E+19) |
||||||
|
--- testing: 7 * 2147483648 --- |
||||||
|
int(15032385536) |
||||||
|
--- testing: 7 * -2147483649 --- |
||||||
|
int(-15032385543) |
||||||
|
--- testing: 7 * 4294967294 --- |
||||||
|
int(30064771058) |
||||||
|
--- testing: 7 * 4294967295 --- |
||||||
|
int(30064771065) |
||||||
|
--- testing: 7 * 4294967293 --- |
||||||
|
int(30064771051) |
||||||
|
--- testing: 7 * 9223372036854775806 --- |
||||||
|
float(6.456360425798343E+19) |
||||||
|
--- testing: 7 * 9.2233720368548E+18 --- |
||||||
|
float(6.456360425798343E+19) |
||||||
|
--- testing: 7 * -9223372036854775807 --- |
||||||
|
float(-6.456360425798343E+19) |
||||||
|
--- testing: 7 * -9.2233720368548E+18 --- |
||||||
|
float(-6.456360425798343E+19) |
||||||
|
--- testing: 9 * 9223372036854775807 --- |
||||||
|
float(8.301034833169298E+19) |
||||||
|
--- testing: 9 * -9223372036854775808 --- |
||||||
|
float(-8.301034833169298E+19) |
||||||
|
--- testing: 9 * 2147483647 --- |
||||||
|
int(19327352823) |
||||||
|
--- testing: 9 * -2147483648 --- |
||||||
|
int(-19327352832) |
||||||
|
--- testing: 9 * 9223372034707292160 --- |
||||||
|
float(8.301034831236563E+19) |
||||||
|
--- testing: 9 * -9223372034707292160 --- |
||||||
|
float(-8.301034831236563E+19) |
||||||
|
--- testing: 9 * 2147483648 --- |
||||||
|
int(19327352832) |
||||||
|
--- testing: 9 * -2147483649 --- |
||||||
|
int(-19327352841) |
||||||
|
--- testing: 9 * 4294967294 --- |
||||||
|
int(38654705646) |
||||||
|
--- testing: 9 * 4294967295 --- |
||||||
|
int(38654705655) |
||||||
|
--- testing: 9 * 4294967293 --- |
||||||
|
int(38654705637) |
||||||
|
--- testing: 9 * 9223372036854775806 --- |
||||||
|
float(8.301034833169298E+19) |
||||||
|
--- testing: 9 * 9.2233720368548E+18 --- |
||||||
|
float(8.301034833169298E+19) |
||||||
|
--- testing: 9 * -9223372036854775807 --- |
||||||
|
float(-8.301034833169298E+19) |
||||||
|
--- testing: 9 * -9.2233720368548E+18 --- |
||||||
|
float(-8.301034833169298E+19) |
||||||
|
--- testing: 65 * 9223372036854775807 --- |
||||||
|
float(5.995191823955604E+20) |
||||||
|
--- testing: 65 * -9223372036854775808 --- |
||||||
|
float(-5.995191823955604E+20) |
||||||
|
--- testing: 65 * 2147483647 --- |
||||||
|
int(139586437055) |
||||||
|
--- testing: 65 * -2147483648 --- |
||||||
|
int(-139586437120) |
||||||
|
--- testing: 65 * 9223372034707292160 --- |
||||||
|
float(5.99519182255974E+20) |
||||||
|
--- testing: 65 * -9223372034707292160 --- |
||||||
|
float(-5.99519182255974E+20) |
||||||
|
--- testing: 65 * 2147483648 --- |
||||||
|
int(139586437120) |
||||||
|
--- testing: 65 * -2147483649 --- |
||||||
|
int(-139586437185) |
||||||
|
--- testing: 65 * 4294967294 --- |
||||||
|
int(279172874110) |
||||||
|
--- testing: 65 * 4294967295 --- |
||||||
|
int(279172874175) |
||||||
|
--- testing: 65 * 4294967293 --- |
||||||
|
int(279172874045) |
||||||
|
--- testing: 65 * 9223372036854775806 --- |
||||||
|
float(5.995191823955604E+20) |
||||||
|
--- testing: 65 * 9.2233720368548E+18 --- |
||||||
|
float(5.995191823955604E+20) |
||||||
|
--- testing: 65 * -9223372036854775807 --- |
||||||
|
float(-5.995191823955604E+20) |
||||||
|
--- testing: 65 * -9.2233720368548E+18 --- |
||||||
|
float(-5.995191823955604E+20) |
||||||
|
--- testing: -44 * 9223372036854775807 --- |
||||||
|
float(-4.0582836962161014E+20) |
||||||
|
--- testing: -44 * -9223372036854775808 --- |
||||||
|
float(4.0582836962161014E+20) |
||||||
|
--- testing: -44 * 2147483647 --- |
||||||
|
int(-94489280468) |
||||||
|
--- testing: -44 * -2147483648 --- |
||||||
|
int(94489280512) |
||||||
|
--- testing: -44 * 9223372034707292160 --- |
||||||
|
float(-4.0582836952712086E+20) |
||||||
|
--- testing: -44 * -9223372034707292160 --- |
||||||
|
float(4.0582836952712086E+20) |
||||||
|
--- testing: -44 * 2147483648 --- |
||||||
|
int(-94489280512) |
||||||
|
--- testing: -44 * -2147483649 --- |
||||||
|
int(94489280556) |
||||||
|
--- testing: -44 * 4294967294 --- |
||||||
|
int(-188978560936) |
||||||
|
--- testing: -44 * 4294967295 --- |
||||||
|
int(-188978560980) |
||||||
|
--- testing: -44 * 4294967293 --- |
||||||
|
int(-188978560892) |
||||||
|
--- testing: -44 * 9223372036854775806 --- |
||||||
|
float(-4.0582836962161014E+20) |
||||||
|
--- testing: -44 * 9.2233720368548E+18 --- |
||||||
|
float(-4.0582836962161014E+20) |
||||||
|
--- testing: -44 * -9223372036854775807 --- |
||||||
|
float(4.0582836962161014E+20) |
||||||
|
--- testing: -44 * -9.2233720368548E+18 --- |
||||||
|
float(4.0582836962161014E+20) |
||||||
|
--- testing: 2147483647 * 9223372036854775807 --- |
||||||
|
float(1.9807040619342712E+28) |
||||||
|
--- testing: 2147483647 * -9223372036854775808 --- |
||||||
|
float(-1.9807040619342712E+28) |
||||||
|
--- testing: 2147483647 * 2147483647 --- |
||||||
|
int(4611686014132420609) |
||||||
|
--- testing: 2147483647 * -2147483648 --- |
||||||
|
int(-4611686016279904256) |
||||||
|
--- testing: 2147483647 * 9223372034707292160 --- |
||||||
|
float(1.9807040614731026E+28) |
||||||
|
--- testing: 2147483647 * -9223372034707292160 --- |
||||||
|
float(-1.9807040614731026E+28) |
||||||
|
--- testing: 2147483647 * 2147483648 --- |
||||||
|
int(4611686016279904256) |
||||||
|
--- testing: 2147483647 * -2147483649 --- |
||||||
|
int(-4611686018427387903) |
||||||
|
--- testing: 2147483647 * 4294967294 --- |
||||||
|
int(9223372028264841218) |
||||||
|
--- testing: 2147483647 * 4294967295 --- |
||||||
|
int(9223372030412324865) |
||||||
|
--- testing: 2147483647 * 4294967293 --- |
||||||
|
int(9223372026117357571) |
||||||
|
--- testing: 2147483647 * 9223372036854775806 --- |
||||||
|
float(1.9807040619342712E+28) |
||||||
|
--- testing: 2147483647 * 9.2233720368548E+18 --- |
||||||
|
float(1.9807040619342712E+28) |
||||||
|
--- testing: 2147483647 * -9223372036854775807 --- |
||||||
|
float(-1.9807040619342712E+28) |
||||||
|
--- testing: 2147483647 * -9.2233720368548E+18 --- |
||||||
|
float(-1.9807040619342712E+28) |
||||||
|
--- testing: 9223372036854775807 * 9223372036854775807 --- |
||||||
|
float(8.507059173023462E+37) |
||||||
|
--- testing: 9223372036854775807 * -9223372036854775808 --- |
||||||
|
float(-8.507059173023462E+37) |
||||||
|
--- testing: 9223372036854775807 * 2147483647 --- |
||||||
|
float(1.9807040619342712E+28) |
||||||
|
--- testing: 9223372036854775807 * -2147483648 --- |
||||||
|
float(-1.9807040628566084E+28) |
||||||
|
--- testing: 9223372036854775807 * 9223372034707292160 --- |
||||||
|
float(8.5070591710427575E+37) |
||||||
|
--- testing: 9223372036854775807 * -9223372034707292160 --- |
||||||
|
float(-8.5070591710427575E+37) |
||||||
|
--- testing: 9223372036854775807 * 2147483648 --- |
||||||
|
float(1.9807040628566084E+28) |
||||||
|
--- testing: 9223372036854775807 * -2147483649 --- |
||||||
|
float(-1.9807040637789456E+28) |
||||||
|
--- testing: 9223372036854775807 * 4294967294 --- |
||||||
|
float(3.9614081238685425E+28) |
||||||
|
--- testing: 9223372036854775807 * 4294967295 --- |
||||||
|
float(3.9614081247908797E+28) |
||||||
|
--- testing: 9223372036854775807 * 4294967293 --- |
||||||
|
float(3.9614081229462053E+28) |
||||||
|
--- testing: 9223372036854775807 * 9223372036854775806 --- |
||||||
|
float(8.507059173023462E+37) |
||||||
|
--- testing: 9223372036854775807 * 9.2233720368548E+18 --- |
||||||
|
float(8.507059173023462E+37) |
||||||
|
--- testing: 9223372036854775807 * -9223372036854775807 --- |
||||||
|
float(-8.507059173023462E+37) |
||||||
|
--- testing: 9223372036854775807 * -9.2233720368548E+18 --- |
||||||
|
float(-8.507059173023462E+37) |
||||||
@ -0,0 +1,419 @@ |
|||||||
|
--TEST-- |
||||||
|
Test * operator : various numbers as strings |
||||||
|
--SKIPIF-- |
||||||
|
<?php die("skip");?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$strVals = array( |
||||||
|
"0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", |
||||||
|
"a5.9" |
||||||
|
); |
||||||
|
|
||||||
|
error_reporting(E_ERROR); |
||||||
|
|
||||||
|
foreach ($strVals as $strVal) { |
||||||
|
foreach($strVals as $otherVal) { |
||||||
|
echo "--- testing: '$strVal' * '$otherVal' ---\n"; |
||||||
|
try { |
||||||
|
var_dump($strVal*$otherVal); |
||||||
|
} catch (\TypeError $e) { |
||||||
|
echo $e->getMessage() . \PHP_EOL; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: '0' * '0' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' * '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' * '-44' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' * '1.2' --- |
||||||
|
float(0) |
||||||
|
--- testing: '0' * '-7.7' --- |
||||||
|
float(-0) |
||||||
|
--- testing: '0' * 'abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '0' * '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' * '123e5' --- |
||||||
|
float(0) |
||||||
|
--- testing: '0' * '123e5xyz' --- |
||||||
|
float(0) |
||||||
|
--- testing: '0' * ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' * '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' * '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' * '3.4a' --- |
||||||
|
float(0) |
||||||
|
--- testing: '0' * 'a5.9' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '65' * '0' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' * '65' --- |
||||||
|
int(4225) |
||||||
|
--- testing: '65' * '-44' --- |
||||||
|
int(-2860) |
||||||
|
--- testing: '65' * '1.2' --- |
||||||
|
float(78) |
||||||
|
--- testing: '65' * '-7.7' --- |
||||||
|
float(-500.5) |
||||||
|
--- testing: '65' * 'abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '65' * '123abc' --- |
||||||
|
int(7995) |
||||||
|
--- testing: '65' * '123e5' --- |
||||||
|
float(799500000) |
||||||
|
--- testing: '65' * '123e5xyz' --- |
||||||
|
float(799500000) |
||||||
|
--- testing: '65' * ' 123abc' --- |
||||||
|
int(7995) |
||||||
|
--- testing: '65' * '123 abc' --- |
||||||
|
int(7995) |
||||||
|
--- testing: '65' * '123abc ' --- |
||||||
|
int(7995) |
||||||
|
--- testing: '65' * '3.4a' --- |
||||||
|
float(221) |
||||||
|
--- testing: '65' * 'a5.9' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '-44' * '0' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-44' * '65' --- |
||||||
|
int(-2860) |
||||||
|
--- testing: '-44' * '-44' --- |
||||||
|
int(1936) |
||||||
|
--- testing: '-44' * '1.2' --- |
||||||
|
float(-52.8) |
||||||
|
--- testing: '-44' * '-7.7' --- |
||||||
|
float(338.8) |
||||||
|
--- testing: '-44' * 'abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '-44' * '123abc' --- |
||||||
|
int(-5412) |
||||||
|
--- testing: '-44' * '123e5' --- |
||||||
|
float(-541200000) |
||||||
|
--- testing: '-44' * '123e5xyz' --- |
||||||
|
float(-541200000) |
||||||
|
--- testing: '-44' * ' 123abc' --- |
||||||
|
int(-5412) |
||||||
|
--- testing: '-44' * '123 abc' --- |
||||||
|
int(-5412) |
||||||
|
--- testing: '-44' * '123abc ' --- |
||||||
|
int(-5412) |
||||||
|
--- testing: '-44' * '3.4a' --- |
||||||
|
float(-149.6) |
||||||
|
--- testing: '-44' * 'a5.9' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '1.2' * '0' --- |
||||||
|
float(0) |
||||||
|
--- testing: '1.2' * '65' --- |
||||||
|
float(78) |
||||||
|
--- testing: '1.2' * '-44' --- |
||||||
|
float(-52.8) |
||||||
|
--- testing: '1.2' * '1.2' --- |
||||||
|
float(1.44) |
||||||
|
--- testing: '1.2' * '-7.7' --- |
||||||
|
float(-9.24) |
||||||
|
--- testing: '1.2' * 'abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '1.2' * '123abc' --- |
||||||
|
float(147.6) |
||||||
|
--- testing: '1.2' * '123e5' --- |
||||||
|
float(14760000) |
||||||
|
--- testing: '1.2' * '123e5xyz' --- |
||||||
|
float(14760000) |
||||||
|
--- testing: '1.2' * ' 123abc' --- |
||||||
|
float(147.6) |
||||||
|
--- testing: '1.2' * '123 abc' --- |
||||||
|
float(147.6) |
||||||
|
--- testing: '1.2' * '123abc ' --- |
||||||
|
float(147.6) |
||||||
|
--- testing: '1.2' * '3.4a' --- |
||||||
|
float(4.08) |
||||||
|
--- testing: '1.2' * 'a5.9' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '-7.7' * '0' --- |
||||||
|
float(-0) |
||||||
|
--- testing: '-7.7' * '65' --- |
||||||
|
float(-500.5) |
||||||
|
--- testing: '-7.7' * '-44' --- |
||||||
|
float(338.8) |
||||||
|
--- testing: '-7.7' * '1.2' --- |
||||||
|
float(-9.24) |
||||||
|
--- testing: '-7.7' * '-7.7' --- |
||||||
|
float(59.290000000000006) |
||||||
|
--- testing: '-7.7' * 'abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '-7.7' * '123abc' --- |
||||||
|
float(-947.1) |
||||||
|
--- testing: '-7.7' * '123e5' --- |
||||||
|
float(-94710000) |
||||||
|
--- testing: '-7.7' * '123e5xyz' --- |
||||||
|
float(-94710000) |
||||||
|
--- testing: '-7.7' * ' 123abc' --- |
||||||
|
float(-947.1) |
||||||
|
--- testing: '-7.7' * '123 abc' --- |
||||||
|
float(-947.1) |
||||||
|
--- testing: '-7.7' * '123abc ' --- |
||||||
|
float(-947.1) |
||||||
|
--- testing: '-7.7' * '3.4a' --- |
||||||
|
float(-26.18) |
||||||
|
--- testing: '-7.7' * 'a5.9' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'abc' * '0' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'abc' * '65' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'abc' * '-44' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'abc' * '1.2' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'abc' * '-7.7' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'abc' * 'abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'abc' * '123abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'abc' * '123e5' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'abc' * '123e5xyz' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'abc' * ' 123abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'abc' * '123 abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'abc' * '123abc ' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'abc' * '3.4a' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'abc' * 'a5.9' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '123abc' * '0' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' * '65' --- |
||||||
|
int(7995) |
||||||
|
--- testing: '123abc' * '-44' --- |
||||||
|
int(-5412) |
||||||
|
--- testing: '123abc' * '1.2' --- |
||||||
|
float(147.6) |
||||||
|
--- testing: '123abc' * '-7.7' --- |
||||||
|
float(-947.1) |
||||||
|
--- testing: '123abc' * 'abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '123abc' * '123abc' --- |
||||||
|
int(15129) |
||||||
|
--- testing: '123abc' * '123e5' --- |
||||||
|
float(1512900000) |
||||||
|
--- testing: '123abc' * '123e5xyz' --- |
||||||
|
float(1512900000) |
||||||
|
--- testing: '123abc' * ' 123abc' --- |
||||||
|
int(15129) |
||||||
|
--- testing: '123abc' * '123 abc' --- |
||||||
|
int(15129) |
||||||
|
--- testing: '123abc' * '123abc ' --- |
||||||
|
int(15129) |
||||||
|
--- testing: '123abc' * '3.4a' --- |
||||||
|
float(418.2) |
||||||
|
--- testing: '123abc' * 'a5.9' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '123e5' * '0' --- |
||||||
|
float(0) |
||||||
|
--- testing: '123e5' * '65' --- |
||||||
|
float(799500000) |
||||||
|
--- testing: '123e5' * '-44' --- |
||||||
|
float(-541200000) |
||||||
|
--- testing: '123e5' * '1.2' --- |
||||||
|
float(14760000) |
||||||
|
--- testing: '123e5' * '-7.7' --- |
||||||
|
float(-94710000) |
||||||
|
--- testing: '123e5' * 'abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '123e5' * '123abc' --- |
||||||
|
float(1512900000) |
||||||
|
--- testing: '123e5' * '123e5' --- |
||||||
|
float(151290000000000) |
||||||
|
--- testing: '123e5' * '123e5xyz' --- |
||||||
|
float(151290000000000) |
||||||
|
--- testing: '123e5' * ' 123abc' --- |
||||||
|
float(1512900000) |
||||||
|
--- testing: '123e5' * '123 abc' --- |
||||||
|
float(1512900000) |
||||||
|
--- testing: '123e5' * '123abc ' --- |
||||||
|
float(1512900000) |
||||||
|
--- testing: '123e5' * '3.4a' --- |
||||||
|
float(41820000) |
||||||
|
--- testing: '123e5' * 'a5.9' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '123e5xyz' * '0' --- |
||||||
|
float(0) |
||||||
|
--- testing: '123e5xyz' * '65' --- |
||||||
|
float(799500000) |
||||||
|
--- testing: '123e5xyz' * '-44' --- |
||||||
|
float(-541200000) |
||||||
|
--- testing: '123e5xyz' * '1.2' --- |
||||||
|
float(14760000) |
||||||
|
--- testing: '123e5xyz' * '-7.7' --- |
||||||
|
float(-94710000) |
||||||
|
--- testing: '123e5xyz' * 'abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '123e5xyz' * '123abc' --- |
||||||
|
float(1512900000) |
||||||
|
--- testing: '123e5xyz' * '123e5' --- |
||||||
|
float(151290000000000) |
||||||
|
--- testing: '123e5xyz' * '123e5xyz' --- |
||||||
|
float(151290000000000) |
||||||
|
--- testing: '123e5xyz' * ' 123abc' --- |
||||||
|
float(1512900000) |
||||||
|
--- testing: '123e5xyz' * '123 abc' --- |
||||||
|
float(1512900000) |
||||||
|
--- testing: '123e5xyz' * '123abc ' --- |
||||||
|
float(1512900000) |
||||||
|
--- testing: '123e5xyz' * '3.4a' --- |
||||||
|
float(41820000) |
||||||
|
--- testing: '123e5xyz' * 'a5.9' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: ' 123abc' * '0' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' * '65' --- |
||||||
|
int(7995) |
||||||
|
--- testing: ' 123abc' * '-44' --- |
||||||
|
int(-5412) |
||||||
|
--- testing: ' 123abc' * '1.2' --- |
||||||
|
float(147.6) |
||||||
|
--- testing: ' 123abc' * '-7.7' --- |
||||||
|
float(-947.1) |
||||||
|
--- testing: ' 123abc' * 'abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: ' 123abc' * '123abc' --- |
||||||
|
int(15129) |
||||||
|
--- testing: ' 123abc' * '123e5' --- |
||||||
|
float(1512900000) |
||||||
|
--- testing: ' 123abc' * '123e5xyz' --- |
||||||
|
float(1512900000) |
||||||
|
--- testing: ' 123abc' * ' 123abc' --- |
||||||
|
int(15129) |
||||||
|
--- testing: ' 123abc' * '123 abc' --- |
||||||
|
int(15129) |
||||||
|
--- testing: ' 123abc' * '123abc ' --- |
||||||
|
int(15129) |
||||||
|
--- testing: ' 123abc' * '3.4a' --- |
||||||
|
float(418.2) |
||||||
|
--- testing: ' 123abc' * 'a5.9' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '123 abc' * '0' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' * '65' --- |
||||||
|
int(7995) |
||||||
|
--- testing: '123 abc' * '-44' --- |
||||||
|
int(-5412) |
||||||
|
--- testing: '123 abc' * '1.2' --- |
||||||
|
float(147.6) |
||||||
|
--- testing: '123 abc' * '-7.7' --- |
||||||
|
float(-947.1) |
||||||
|
--- testing: '123 abc' * 'abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '123 abc' * '123abc' --- |
||||||
|
int(15129) |
||||||
|
--- testing: '123 abc' * '123e5' --- |
||||||
|
float(1512900000) |
||||||
|
--- testing: '123 abc' * '123e5xyz' --- |
||||||
|
float(1512900000) |
||||||
|
--- testing: '123 abc' * ' 123abc' --- |
||||||
|
int(15129) |
||||||
|
--- testing: '123 abc' * '123 abc' --- |
||||||
|
int(15129) |
||||||
|
--- testing: '123 abc' * '123abc ' --- |
||||||
|
int(15129) |
||||||
|
--- testing: '123 abc' * '3.4a' --- |
||||||
|
float(418.2) |
||||||
|
--- testing: '123 abc' * 'a5.9' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '123abc ' * '0' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' * '65' --- |
||||||
|
int(7995) |
||||||
|
--- testing: '123abc ' * '-44' --- |
||||||
|
int(-5412) |
||||||
|
--- testing: '123abc ' * '1.2' --- |
||||||
|
float(147.6) |
||||||
|
--- testing: '123abc ' * '-7.7' --- |
||||||
|
float(-947.1) |
||||||
|
--- testing: '123abc ' * 'abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '123abc ' * '123abc' --- |
||||||
|
int(15129) |
||||||
|
--- testing: '123abc ' * '123e5' --- |
||||||
|
float(1512900000) |
||||||
|
--- testing: '123abc ' * '123e5xyz' --- |
||||||
|
float(1512900000) |
||||||
|
--- testing: '123abc ' * ' 123abc' --- |
||||||
|
int(15129) |
||||||
|
--- testing: '123abc ' * '123 abc' --- |
||||||
|
int(15129) |
||||||
|
--- testing: '123abc ' * '123abc ' --- |
||||||
|
int(15129) |
||||||
|
--- testing: '123abc ' * '3.4a' --- |
||||||
|
float(418.2) |
||||||
|
--- testing: '123abc ' * 'a5.9' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '3.4a' * '0' --- |
||||||
|
float(0) |
||||||
|
--- testing: '3.4a' * '65' --- |
||||||
|
float(221) |
||||||
|
--- testing: '3.4a' * '-44' --- |
||||||
|
float(-149.6) |
||||||
|
--- testing: '3.4a' * '1.2' --- |
||||||
|
float(4.08) |
||||||
|
--- testing: '3.4a' * '-7.7' --- |
||||||
|
float(-26.18) |
||||||
|
--- testing: '3.4a' * 'abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: '3.4a' * '123abc' --- |
||||||
|
float(418.2) |
||||||
|
--- testing: '3.4a' * '123e5' --- |
||||||
|
float(41820000) |
||||||
|
--- testing: '3.4a' * '123e5xyz' --- |
||||||
|
float(41820000) |
||||||
|
--- testing: '3.4a' * ' 123abc' --- |
||||||
|
float(418.2) |
||||||
|
--- testing: '3.4a' * '123 abc' --- |
||||||
|
float(418.2) |
||||||
|
--- testing: '3.4a' * '123abc ' --- |
||||||
|
float(418.2) |
||||||
|
--- testing: '3.4a' * '3.4a' --- |
||||||
|
float(11.559999999999999) |
||||||
|
--- testing: '3.4a' * 'a5.9' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'a5.9' * '0' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'a5.9' * '65' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'a5.9' * '-44' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'a5.9' * '1.2' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'a5.9' * '-7.7' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'a5.9' * 'abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'a5.9' * '123abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'a5.9' * '123e5' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'a5.9' * '123e5xyz' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'a5.9' * ' 123abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'a5.9' * '123 abc' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'a5.9' * '123abc ' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'a5.9' * '3.4a' --- |
||||||
|
Unsupported operand types: string * string |
||||||
|
--- testing: 'a5.9' * 'a5.9' --- |
||||||
|
Unsupported operand types: string * string |
||||||
@ -0,0 +1,29 @@ |
|||||||
|
--TEST-- |
||||||
|
Comparisons with NAN should yield false, even at compile-time |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
echo "** CONST\n"; |
||||||
|
var_dump(0 < NAN); |
||||||
|
var_dump(0 <= NAN); |
||||||
|
var_dump(0 > NAN); |
||||||
|
var_dump(0 >= NAN); |
||||||
|
|
||||||
|
echo "** VAR\n"; |
||||||
|
$nan = NAN; |
||||||
|
var_dump(0 < $nan); |
||||||
|
var_dump(0 <= $nan); |
||||||
|
var_dump(0 > $nan); |
||||||
|
var_dump(0 >= $nan); |
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
** CONST |
||||||
|
bool(false) |
||||||
|
bool(false) |
||||||
|
bool(false) |
||||||
|
bool(false) |
||||||
|
** VAR |
||||||
|
bool(false) |
||||||
|
bool(false) |
||||||
|
bool(false) |
||||||
|
bool(false) |
||||||
@ -0,0 +1,58 @@ |
|||||||
|
--TEST-- |
||||||
|
Test -N 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.0, MIN_64Bit + 1, MIN_64Bit - 1.0 |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
foreach ($longVals as $longVal) { |
||||||
|
echo "--- testing: $longVal ---\n"; |
||||||
|
var_dump(-$longVal); |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: 9223372036854775807 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -9223372036854775808 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 2147483647 --- |
||||||
|
int(-2147483647) |
||||||
|
--- testing: -2147483648 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 9223372034707292160 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: -9223372034707292160 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 2147483648 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -2147483649 --- |
||||||
|
int(2147483649) |
||||||
|
--- testing: 4294967294 --- |
||||||
|
int(-4294967294) |
||||||
|
--- testing: 4294967295 --- |
||||||
|
int(-4294967295) |
||||||
|
--- testing: 4294967293 --- |
||||||
|
int(-4294967293) |
||||||
|
--- testing: 9223372036854775806 --- |
||||||
|
int(-9223372036854775806) |
||||||
|
--- testing: 9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: -9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
@ -0,0 +1,63 @@ |
|||||||
|
--TEST-- |
||||||
|
Test -N operator : various numbers as strings |
||||||
|
--SKIPIF-- |
||||||
|
<?php die("skip");?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$strVals = array( |
||||||
|
"0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", |
||||||
|
"a5.9" |
||||||
|
); |
||||||
|
|
||||||
|
foreach ($strVals as $strVal) { |
||||||
|
echo "--- testing: '$strVal' ---\n"; |
||||||
|
try { |
||||||
|
var_dump(-$strVal); |
||||||
|
} catch (\TypeError $e) { |
||||||
|
echo $e->getMessage() . \PHP_EOL; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECTF-- |
||||||
|
--- testing: '0' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' --- |
||||||
|
int(-65) |
||||||
|
--- testing: '-44' --- |
||||||
|
int(44) |
||||||
|
--- testing: '1.2' --- |
||||||
|
float(-1.2) |
||||||
|
--- testing: '-7.7' --- |
||||||
|
float(7.7) |
||||||
|
--- testing: 'abc' --- |
||||||
|
Unsupported operand types: string * int |
||||||
|
--- testing: '123abc' --- |
||||||
|
|
||||||
|
Warning: A non-numeric value encountered in %s on line %d |
||||||
|
int(-123) |
||||||
|
--- testing: '123e5' --- |
||||||
|
float(-12300000) |
||||||
|
--- testing: '123e5xyz' --- |
||||||
|
|
||||||
|
Warning: A non-numeric value encountered in %s on line %d |
||||||
|
float(-12300000) |
||||||
|
--- testing: ' 123abc' --- |
||||||
|
|
||||||
|
Warning: A non-numeric value encountered in %s on line %d |
||||||
|
int(-123) |
||||||
|
--- testing: '123 abc' --- |
||||||
|
|
||||||
|
Warning: A non-numeric value encountered in %s on line %d |
||||||
|
int(-123) |
||||||
|
--- testing: '123abc ' --- |
||||||
|
|
||||||
|
Warning: A non-numeric value encountered in %s on line %d |
||||||
|
int(-123) |
||||||
|
--- testing: '3.4a' --- |
||||||
|
|
||||||
|
Warning: A non-numeric value encountered in %s on line %d |
||||||
|
float(-3.4) |
||||||
|
--- testing: 'a5.9' --- |
||||||
|
Unsupported operand types: string * int |
||||||
@ -0,0 +1,63 @@ |
|||||||
|
--TEST-- |
||||||
|
Test == operator : different types |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$valid_true = array(1, "1", "true", 1.0, array(1)); |
||||||
|
$valid_false = array(0, "", 0.0, array(), NULL); |
||||||
|
|
||||||
|
$int1 = 679; |
||||||
|
$int2 = -67835; |
||||||
|
$valid_int1 = array("679", " 679", "679 ", 679.0, 6.79E2, "+679", +679); |
||||||
|
$valid_int2 = array("-67835", " -67835", "-67835 ", -67835.000, -6.7835E4); |
||||||
|
$invalid_int1 = array("679abc", "6 7 9", "6y79", 678); |
||||||
|
$invalid_int2 = array("-67835abc", "- 67835", "-67,835", "-67 835", "-678y35", -76834); |
||||||
|
|
||||||
|
$float1 = 57385.45835; |
||||||
|
$float2 = -67345.76567; |
||||||
|
$valid_float1 = array("57385.45835", " 57385.45835", 5.738545835e4); |
||||||
|
$valid_float2 = array("-67345.76567", " -67345.76567", -6.734576567E4); |
||||||
|
$invalid_float1 = array("57385.45835aaa", "57385. 45835", "57,385.45835", 57385.45834, 5.738545834e4); |
||||||
|
$invalid_float2 = array("-67345.76567aaa", "- 67345.76567", "-67,345.76567", -67345.76566, -6.734576566E4); |
||||||
|
|
||||||
|
|
||||||
|
$toCompare = array( |
||||||
|
true, $valid_true, $valid_false, |
||||||
|
false, $valid_false, $valid_true, |
||||||
|
$int1, $valid_int1, $invalid_int1, |
||||||
|
$int2, $valid_int2, $invalid_int2, |
||||||
|
$float1, $valid_float1, $invalid_float1, |
||||||
|
$float2, $valid_float2, $invalid_float2 |
||||||
|
); |
||||||
|
|
||||||
|
$failed = false; |
||||||
|
for ($i = 0; $i < count($toCompare); $i +=3) { |
||||||
|
$typeToTest = $toCompare[$i]; |
||||||
|
$valid_compares = $toCompare[$i + 1]; |
||||||
|
$invalid_compares = $toCompare[$i + 2]; |
||||||
|
|
||||||
|
foreach($valid_compares as $compareVal) { |
||||||
|
if ($typeToTest == $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTest' != '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
foreach($invalid_compares as $compareVal) { |
||||||
|
if ($typeToTest == $compareVal) { |
||||||
|
echo "FAILED: '$typeToTest' == '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,61 @@ |
|||||||
|
--TEST-- |
||||||
|
Test == operator : max int 32bit range |
||||||
|
--SKIPIF-- |
||||||
|
<?php |
||||||
|
if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); |
||||||
|
?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
define("MAX_64Bit", 9223372036854775807); |
||||||
|
define("MAX_32Bit", 2147483647); |
||||||
|
define("MIN_64Bit", -9223372036854775807 - 1); |
||||||
|
define("MIN_32Bit", -2147483647 - 1); |
||||||
|
|
||||||
|
$validEqual = array ( |
||||||
|
MAX_32Bit, array(MAX_32Bit, "2147483647", "2147483647.0000000", 2.147483647e9, 2147483647.0), |
||||||
|
MIN_32Bit, array(MIN_32Bit, "-2147483648", "-2147483648.000", -2.147483648e9, -2147483648.0), |
||||||
|
MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1, MAX_64Bit - 1), |
||||||
|
MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1, MIN_64Bit + 1), |
||||||
|
); |
||||||
|
|
||||||
|
$invalidEqual = array ( |
||||||
|
MAX_32Bit, array("2147483648", 2.1474836470001e9, MAX_32Bit - 1, MAX_32Bit + 1), |
||||||
|
MIN_32Bit, array("-2147483649", -2.1474836480001e9, MIN_32Bit -1, MIN_32Bit + 1), |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
$failed = false; |
||||||
|
// test valid values |
||||||
|
for ($i = 0; $i < count($validEqual); $i +=2) { |
||||||
|
$typeToTestVal = $validEqual[$i]; |
||||||
|
$compares = $validEqual[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal == $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTestVal' != '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
// test invalid values |
||||||
|
for ($i = 0; $i < count($invalidEqual); $i +=2) { |
||||||
|
$typeToTestVal = $invalidEqual[$i]; |
||||||
|
$compares = $invalidEqual[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal == $compareVal) { |
||||||
|
echo "FAILED: '$typeToTestVal' == '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,63 @@ |
|||||||
|
--TEST-- |
||||||
|
Test == operator : max int 64bit range |
||||||
|
--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); |
||||||
|
|
||||||
|
$validEqual = array ( |
||||||
|
MAX_32Bit, array(MAX_32Bit, "2147483647", "2147483647.0000000", 2.147483647e9), |
||||||
|
MIN_32Bit, array(MIN_32Bit, "-2147483648", "-2147483648.000", -2.147483648e9), |
||||||
|
MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1.0), |
||||||
|
MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1.0), |
||||||
|
); |
||||||
|
|
||||||
|
$invalidEqual = array ( |
||||||
|
MAX_32Bit, array("2147483648", 2.1474836470001e9, MAX_32Bit - 1, MAX_32Bit + 1), |
||||||
|
MIN_32Bit, array("-2147483649", -2.1474836480001e9, MIN_32Bit -1, MIN_32Bit + 1), |
||||||
|
MAX_64Bit, array(MAX_64Bit - 1), |
||||||
|
MIN_64Bit, array(MIN_64Bit + 1), |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
$failed = false; |
||||||
|
// test valid values |
||||||
|
for ($i = 0; $i < count($validEqual); $i +=2) { |
||||||
|
$typeToTestVal = $validEqual[$i]; |
||||||
|
$compares = $validEqual[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal == $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTestVal' != '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
// test invalid values |
||||||
|
for ($i = 0; $i < count($invalidEqual); $i +=2) { |
||||||
|
$typeToTestVal = $invalidEqual[$i]; |
||||||
|
$compares = $invalidEqual[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal == $compareVal) { |
||||||
|
echo "FAILED: '$typeToTestVal' == '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,63 @@ |
|||||||
|
--TEST-- |
||||||
|
Test > operator : different types |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
$valid_true = array(1, "1", "true", 1.0, array(1)); |
||||||
|
$valid_false = array(0, "", 0.0, array(), NULL); |
||||||
|
|
||||||
|
$int1 = 679; |
||||||
|
$int2 = -67835; |
||||||
|
$valid_int1 = array("678", "678abc", " 678", "678 ", 678.0, 6.789E2, "+678", +678); |
||||||
|
$valid_int2 = array("-67836", " -67836", -67835.0001, -6.78351E4, "-67836 "); |
||||||
|
$invalid_int1 = array(679, "679"); |
||||||
|
$invalid_int2 = array(-67835, "-67835", "-67836abc"); |
||||||
|
|
||||||
|
$float1 = 57385.45835; |
||||||
|
$float2 = -67345.76567; |
||||||
|
$valid_float1 = array("57385.45834", "57385.45834aaa", " 57385.45834", 5.738545834e4); |
||||||
|
$valid_float2 = array("-67345.76568", " -67345.76568", -6.734576568E4); |
||||||
|
$invalid_float1 = array(57385.45835, 5.738545835e4); |
||||||
|
$invalid_float2 = array(-67345.76567, -6.734576567E4, "-67345.76568aaa"); |
||||||
|
|
||||||
|
|
||||||
|
$toCompare = array( |
||||||
|
// boolean test will result in both sides being converted to boolean so !0 = true and true is not > true for example |
||||||
|
// also note that a string of "0" is converted to false but a string of "0.0" is converted to true |
||||||
|
// false cannot be tested as 0 can never be > 0 or 1 |
||||||
|
true, $valid_false, $valid_true, |
||||||
|
$int1, $valid_int1, $invalid_int1, |
||||||
|
$int2, $valid_int2, $invalid_int2, |
||||||
|
$float1, $valid_float1, $invalid_float1, |
||||||
|
$float2, $valid_float2, $invalid_float2 |
||||||
|
); |
||||||
|
|
||||||
|
$failed = false; |
||||||
|
for ($i = 0; $i < count($toCompare); $i +=3) { |
||||||
|
$typeToTest = $toCompare[$i]; |
||||||
|
$valid_compares = $toCompare[$i + 1]; |
||||||
|
$invalid_compares = $toCompare[$i + 2]; |
||||||
|
|
||||||
|
foreach($valid_compares as $compareVal) { |
||||||
|
if ($typeToTest > $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTest' <= '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
foreach($invalid_compares as $compareVal) { |
||||||
|
if ($typeToTest > $compareVal) { |
||||||
|
echo "FAILED: '$typeToTest' > '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,63 @@ |
|||||||
|
--TEST-- |
||||||
|
Test >= operator : different types |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
$valid_true = array(1, "1", "true", 1.0, array(1)); |
||||||
|
$valid_false = array(0, "", 0.0, array(), NULL); |
||||||
|
|
||||||
|
$int1 = 679; |
||||||
|
$int2 = -67835; |
||||||
|
$valid_int1 = array("679", " 679", 679.0, 6.79E2, "678", "678abc", " 678", 678.0, 6.78E2, 6.789E2, "+678", +678); |
||||||
|
$valid_int2 = array("-67835", " -67835", -67835.000, -6.7835E4, "-67836", -67835.0001, -6.78351E4, "-67836", -67835.0001, -6.78351E4); |
||||||
|
$invalid_int1 = array(680, "680", "679abc"); |
||||||
|
$invalid_int2 = array(-67834, "-67834", "-67835abc", "-67836abc". " -67836"); |
||||||
|
|
||||||
|
$float1 = 57385.45835; |
||||||
|
$float2 = -67345.76567; |
||||||
|
$valid_float1 = array("57385.45835", " 57385.45835", 5.738545835e4, "57385.45834", "57385.45834aaa", " 57385.45834", 5.738545834e4); |
||||||
|
$valid_float2 = array("-67345.76567", " -67345.76567", -6.734576567E4, "-67345.76568", " -67345.76568", -6.734576568E4); |
||||||
|
$invalid_float1 = array(57385.45836, 5.738545836e4, "57385.45835aaa"); |
||||||
|
$invalid_float2 = array(-67345.76564, -6.734576564E4, "-67345.76567aaa", "-67345.76568aaa"); |
||||||
|
|
||||||
|
$toCompare = array( |
||||||
|
|
||||||
|
true, array_merge($valid_false, $valid_true), NULL, |
||||||
|
false, $valid_false, $valid_true, |
||||||
|
$int1, $valid_int1, $invalid_int1, |
||||||
|
$int2, $valid_int2, $invalid_int2, |
||||||
|
$float1, $valid_float1, $invalid_float1, |
||||||
|
$float2, $valid_float2, $invalid_float2 |
||||||
|
); |
||||||
|
|
||||||
|
$failed = false; |
||||||
|
for ($i = 0; $i < count($toCompare); $i +=3) { |
||||||
|
$typeToTest = $toCompare[$i]; |
||||||
|
$valid_compares = $toCompare[$i + 1]; |
||||||
|
$invalid_compares = $toCompare[$i + 2]; |
||||||
|
|
||||||
|
foreach($valid_compares as $compareVal) { |
||||||
|
if ($typeToTest >= $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTest' < '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($invalid_compares != NULL) { |
||||||
|
foreach($invalid_compares as $compareVal) { |
||||||
|
if ($typeToTest >= $compareVal) { |
||||||
|
echo "FAILED: '$typeToTest' >= '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,61 @@ |
|||||||
|
--TEST-- |
||||||
|
Test >= operator : max int 32bit range |
||||||
|
--SKIPIF-- |
||||||
|
<?php |
||||||
|
if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); |
||||||
|
?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
define("MAX_64Bit", 9223372036854775807); |
||||||
|
define("MAX_32Bit", 2147483647); |
||||||
|
define("MIN_64Bit", -9223372036854775807 - 1); |
||||||
|
define("MIN_32Bit", -2147483647 - 1); |
||||||
|
|
||||||
|
$validGtOrEqual = array ( |
||||||
|
MAX_32Bit, array(MAX_32Bit, "2147483647", "2147483647.0000000", 2.147483647e9, 2147483647.0, MAX_32Bit - 1), |
||||||
|
MIN_32Bit, array(MIN_32Bit, "-2147483648", "-2147483648.000", -2.147483648e9, -2147483648.0, MIN_32Bit - 1), |
||||||
|
MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1, MAX_64Bit - 1), |
||||||
|
MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1, MIN_64Bit + 1), |
||||||
|
); |
||||||
|
|
||||||
|
$invalidGtOrEqual = array ( |
||||||
|
MAX_32Bit, array("2147483648", 2.1474836470001e9, MAX_32Bit + 1), |
||||||
|
MIN_32Bit, array(MIN_32Bit + 1,"-2147483646", -2.1474836460001e9) |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
$failed = false; |
||||||
|
// test valid values |
||||||
|
for ($i = 0; $i < count($validGtOrEqual); $i +=2) { |
||||||
|
$typeToTestVal = $validGtOrEqual[$i]; |
||||||
|
$compares = $validGtOrEqual[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal >= $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTestVal' < '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
// test for invalid values |
||||||
|
for ($i = 0; $i < count($invalidGtOrEqual); $i +=2) { |
||||||
|
$typeToTestVal = $invalidGtOrEqual[$i]; |
||||||
|
$compares = $invalidGtOrEqual[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal >= $compareVal) { |
||||||
|
echo "FAILED: '$typeToTestVal' >= '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,61 @@ |
|||||||
|
--TEST-- |
||||||
|
Test >= operator : max int 64bit range |
||||||
|
--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); |
||||||
|
|
||||||
|
$validGtOrEqual = array ( |
||||||
|
MAX_32Bit, array(MAX_32Bit, "2147483647", "2147483647.0000000", 2.147483647e9, 2147483647.0, MAX_32Bit - 1), |
||||||
|
MIN_32Bit, array(MIN_32Bit, "-2147483648", "-2147483648.000", -2.147483648e9, -2147483648.0, MIN_32Bit - 1), |
||||||
|
MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1.0, MAX_64Bit - 1), |
||||||
|
MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1.0), |
||||||
|
); |
||||||
|
|
||||||
|
$invalidGtOrEqual = array ( |
||||||
|
MAX_32Bit, array("2147483648", 2.1474836470001e9, MAX_32Bit + 1), |
||||||
|
MIN_32Bit, array(MIN_32Bit + 1,"-2147483646", -2.1474836460001e9) |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
$failed = false; |
||||||
|
// test valid values |
||||||
|
for ($i = 0; $i < count($validGtOrEqual); $i +=2) { |
||||||
|
$typeToTestVal = $validGtOrEqual[$i]; |
||||||
|
$compares = $validGtOrEqual[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal >= $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTestVal' < '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
// test for invalid values |
||||||
|
for ($i = 0; $i < count($invalidGtOrEqual); $i +=2) { |
||||||
|
$typeToTestVal = $invalidGtOrEqual[$i]; |
||||||
|
$compares = $invalidGtOrEqual[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal >= $compareVal) { |
||||||
|
echo "FAILED: '$typeToTestVal' >= '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,56 @@ |
|||||||
|
--TEST-- |
||||||
|
Test > operator : max int 32bit range |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
define("MAX_64Bit", 9223372036854775807); |
||||||
|
define("MAX_32Bit", 2147483647); |
||||||
|
define("MIN_64Bit", -9223372036854775807 - 1); |
||||||
|
define("MIN_32Bit", -2147483647 - 1); |
||||||
|
|
||||||
|
$validGreaterThan = array ( |
||||||
|
MAX_32Bit, array(MAX_32Bit - 1, "2147483646", "2147483646.999", 2.147483646e9, 2147483646.9, MIN_32Bit), |
||||||
|
-2147483647, array(MIN_32Bit, "-2147483648", "-2147483647.001", -2.1474836471e9, -2147483647.9), |
||||||
|
); |
||||||
|
|
||||||
|
$invalidGreaterThan = array ( |
||||||
|
MAX_32Bit, array(2e33, MAX_32Bit + 1), |
||||||
|
MIN_32Bit, array(MIN_32Bit + 1, MAX_32Bit) |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$failed = false; |
||||||
|
// test valid values |
||||||
|
for ($i = 0; $i < count($validGreaterThan); $i +=2) { |
||||||
|
$typeToTestVal = $validGreaterThan[$i]; |
||||||
|
$compares = $validGreaterThan[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal > $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTestVal' <= '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
// test for invalid values |
||||||
|
for ($i = 0; $i < count($invalidGreaterThan); $i +=2) { |
||||||
|
$typeToTestVal = $invalidGreaterThan[$i]; |
||||||
|
$compares = $invalidGreaterThan[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal > $compareVal) { |
||||||
|
echo "FAILED: '$typeToTestVal' > '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,60 @@ |
|||||||
|
--TEST-- |
||||||
|
Test > operator : max int 64bit range |
||||||
|
--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); |
||||||
|
|
||||||
|
$validGreaterThan = array ( |
||||||
|
MAX_32Bit, array(MAX_32Bit - 1, "2147483646", "2147483646.999", 2.147483646e9, 2147483646.9, MIN_32Bit), |
||||||
|
-2147483647, array(MIN_32Bit, "-2147483648", "-2147483647.001", -2.1474836471e9, -2147483647.9), |
||||||
|
); |
||||||
|
|
||||||
|
$invalidGreaterThan = array ( |
||||||
|
MAX_32Bit, array(2e33, MAX_32Bit + 1), |
||||||
|
MIN_32Bit, array(MIN_32Bit + 1, MAX_32Bit) |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$failed = false; |
||||||
|
// test valid values |
||||||
|
for ($i = 0; $i < count($validGreaterThan); $i +=2) { |
||||||
|
$typeToTestVal = $validGreaterThan[$i]; |
||||||
|
$compares = $validGreaterThan[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal > $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTestVal' <= '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
// test for invalid values |
||||||
|
for ($i = 0; $i < count($invalidGreaterThan); $i +=2) { |
||||||
|
$typeToTestVal = $invalidGreaterThan[$i]; |
||||||
|
$compares = $invalidGreaterThan[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal > $compareVal) { |
||||||
|
echo "FAILED: '$typeToTestVal' > '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,63 @@ |
|||||||
|
--TEST-- |
||||||
|
Test === operator : different types |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$valid_true = array(1, "1", "true", 1.0, array(1)); |
||||||
|
$valid_false = array(0, "", 0.0, array(), NULL); |
||||||
|
|
||||||
|
$int1 = 679; |
||||||
|
$int2 = -67835; |
||||||
|
$valid_int1 = array(679, +679); |
||||||
|
$valid_int2 = array(-67835); |
||||||
|
$invalid_int1 = array("679", "679abc", " 679", "679 ", 679.0, 6.79E2, "+679", "6 7 9", "6y79", 678); |
||||||
|
$invalid_int2 = array("-67835", "-67835abc", " -67835", "-67835 ", -67835.000, -6.7835E4, "- 67835", "-67,835", "-67 835", "-678y35", -76834); |
||||||
|
|
||||||
|
$float1 = 57385.45835; |
||||||
|
$float2 = -67345.76567; |
||||||
|
$valid_float1 = array(57385.45835, 5.738545835e4); |
||||||
|
$valid_float2 = array(-67345.76567, -6.734576567E4); |
||||||
|
$invalid_float1 = array("57385.45835", "57385.45835aaa", " 57385.45835", "57385. 45835", "57,385.45835", 57385.45834, 5.738545834e4); |
||||||
|
$invalid_float2 = array("-67345.76567", "-67345.76567aaa", " -67345.76567", "- 67345.76567", "-67,345.76567", -67345.76566, -6.734576566E4); |
||||||
|
|
||||||
|
|
||||||
|
$toCompare = array( |
||||||
|
true, array(true), array_merge($valid_true, $valid_false), |
||||||
|
false, array(false), array_merge($valid_true, $valid_false), |
||||||
|
$int1, $valid_int1, $invalid_int1, |
||||||
|
$int2, $valid_int2, $invalid_int2, |
||||||
|
$float1, $valid_float1, $invalid_float1, |
||||||
|
$float2, $valid_float2, $invalid_float2 |
||||||
|
); |
||||||
|
|
||||||
|
$failed = false; |
||||||
|
for ($i = 0; $i < count($toCompare); $i +=3) { |
||||||
|
$typeToTest = $toCompare[$i]; |
||||||
|
$valid_compares = $toCompare[$i + 1]; |
||||||
|
$invalid_compares = $toCompare[$i + 2]; |
||||||
|
|
||||||
|
foreach($valid_compares as $compareVal) { |
||||||
|
if ($typeToTest === $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTest' != '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
foreach($invalid_compares as $compareVal) { |
||||||
|
if ($typeToTest === $compareVal) { |
||||||
|
echo "FAILED: '$typeToTest' == '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,11 @@ |
|||||||
|
--TEST-- |
||||||
|
Test === operator : False recursion detection |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
$n = 0; |
||||||
|
$a = [[$n]]; |
||||||
|
$b = [&$a]; |
||||||
|
var_dump($a === $b); |
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
bool(false) |
||||||
@ -0,0 +1,61 @@ |
|||||||
|
--TEST-- |
||||||
|
Test === operator : max int 32bit range |
||||||
|
--SKIPIF-- |
||||||
|
<?php |
||||||
|
if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); |
||||||
|
?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
define("MAX_64Bit", 9223372036854775807); |
||||||
|
define("MAX_32Bit", 2147483647); |
||||||
|
define("MIN_64Bit", -9223372036854775807 - 1); |
||||||
|
define("MIN_32Bit", -2147483647 - 1); |
||||||
|
|
||||||
|
$validIdentical = array ( |
||||||
|
MAX_32Bit, array(MAX_32Bit), |
||||||
|
MIN_32Bit, array(MIN_32Bit), |
||||||
|
MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1, MAX_64Bit - 1), |
||||||
|
MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1, MIN_64Bit + 1), |
||||||
|
); |
||||||
|
|
||||||
|
$invalidIdentical = array ( |
||||||
|
MAX_32Bit, array("2147483647", "2147483647.0000000", 2.147483647e9, 2147483647.0, "2147483648", 2.1474836470001e9, MAX_32Bit - 1, MAX_32Bit + 1), |
||||||
|
MIN_32Bit, array("-2147483648", "-2147483648.000", -2.147483648e9, -2147483648.0, "-2147483649", -2.1474836480001e9, MIN_32Bit -1, MIN_32Bit + 1), |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
$failed = false; |
||||||
|
// test for valid values |
||||||
|
for ($i = 0; $i < count($validIdentical); $i +=2) { |
||||||
|
$typeToTestVal = $validIdentical[$i]; |
||||||
|
$compares = $validIdentical[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal === $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTestVal' !== '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
// test for invalid values |
||||||
|
for ($i = 0; $i < count($invalidIdentical); $i +=2) { |
||||||
|
$typeToTestVal = $invalidIdentical[$i]; |
||||||
|
$compares = $invalidIdentical[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal === $compareVal) { |
||||||
|
echo "FAILED: '$typeToTestVal' === '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,63 @@ |
|||||||
|
--TEST-- |
||||||
|
Test === operator : max int 64bit range |
||||||
|
--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); |
||||||
|
|
||||||
|
$validIdentical = array ( |
||||||
|
MAX_32Bit, array(MAX_32Bit), |
||||||
|
MIN_32Bit, array(MIN_32Bit), |
||||||
|
MAX_64Bit, array(MAX_64Bit), |
||||||
|
MIN_64Bit, array(MIN_64Bit), |
||||||
|
); |
||||||
|
|
||||||
|
$invalidIdentical = array ( |
||||||
|
MAX_32Bit, array("2147483647", "2147483647.0000000", 2.147483647e9, 2147483647.0, "2147483648", 2.1474836470001e9, MAX_32Bit - 1, MAX_32Bit + 1), |
||||||
|
MIN_32Bit, array("-2147483648", "-2147483648.000", -2.147483648e9, -2147483648.0, "-2147483649", -2.1474836480001e9, MIN_32Bit -1, MIN_32Bit + 1), |
||||||
|
MAX_64Bit, array(MAX_64Bit - 1, MAX_64Bit + 1), |
||||||
|
MIN_64Bit, array(MIN_64Bit + 1, MIN_64Bit - 1), |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
$failed = false; |
||||||
|
// test for valid values |
||||||
|
for ($i = 0; $i < count($validIdentical); $i +=2) { |
||||||
|
$typeToTestVal = $validIdentical[$i]; |
||||||
|
$compares = $validIdentical[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal === $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTestVal' !== '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
// test for invalid values |
||||||
|
for ($i = 0; $i < count($invalidIdentical); $i +=2) { |
||||||
|
$typeToTestVal = $invalidIdentical[$i]; |
||||||
|
$compares = $invalidIdentical[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal === $compareVal) { |
||||||
|
echo "FAILED: '$typeToTestVal' === '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,60 @@ |
|||||||
|
--TEST-- |
||||||
|
Test < operator : different types |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
$valid_true = array(1, "1", "true", 1.0, array(1)); |
||||||
|
$valid_false = array(0, "", 0.0, array(), NULL); |
||||||
|
|
||||||
|
$int1 = 677; |
||||||
|
$int2 = -67837; |
||||||
|
$valid_int1 = array("678", "678abc", " 678", "678 ", 678.0, 6.789E2, "+678", +678); |
||||||
|
$valid_int2 = array("-67836", " -67836", -67835.0001, -6.78351E4, "-67836 "); |
||||||
|
$invalid_int1 = array(676, "676"); |
||||||
|
$invalid_int2 = array(-67837, "-67837", "-67836abc"); |
||||||
|
|
||||||
|
$float1 = 57385.45835; |
||||||
|
$float2 = -67345.76567; |
||||||
|
$valid_float1 = array("57385.45836", "57385.45836aaa", " 57385.45836", 5.738545836e4); |
||||||
|
$valid_float2 = array("-67345.76566", " -67345.76566", -6.734576566E4); |
||||||
|
$invalid_float1 = array(57385.45835, 5.738545835e4); |
||||||
|
$invalid_float2 = array(-67345.76567, -6.734576567E4, "-67345.76566aaa"); |
||||||
|
|
||||||
|
|
||||||
|
$toCompare = array( |
||||||
|
false, $valid_true, $valid_false, |
||||||
|
$int1, $valid_int1, $invalid_int1, |
||||||
|
$int2, $valid_int2, $invalid_int2, |
||||||
|
$float1, $valid_float1, $invalid_float1, |
||||||
|
$float2, $valid_float2, $invalid_float2 |
||||||
|
); |
||||||
|
|
||||||
|
$failed = false; |
||||||
|
for ($i = 0; $i < count($toCompare); $i +=3) { |
||||||
|
$typeToTest = $toCompare[$i]; |
||||||
|
$valid_compares = $toCompare[$i + 1]; |
||||||
|
$invalid_compares = $toCompare[$i + 2]; |
||||||
|
|
||||||
|
foreach($valid_compares as $compareVal) { |
||||||
|
if ($typeToTest < $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTest' >= '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
foreach($invalid_compares as $compareVal) { |
||||||
|
if ($typeToTest < $compareVal) { |
||||||
|
echo "FAILED: '$typeToTest' < '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,62 @@ |
|||||||
|
--TEST-- |
||||||
|
Test <= operator : different types |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
$valid_true = array(1, "1", "true", 1.0, array(1)); |
||||||
|
$valid_false = array(0, "", 0.0, array(), NULL); |
||||||
|
|
||||||
|
$int1 = 678; |
||||||
|
$int2 = -67836; |
||||||
|
$valid_int1 = array("679", "679abc", " 679", 679.0, 6.79E2, "678", "678abc", " 678", 678.0, 6.78E2, 6.789E2, "+678", +678); |
||||||
|
$valid_int2 = array("-67835", " -67835", -67835.000, -6.7835E4, "-67836", "-67836abc". " -67836", -67835.0001, -6.78351E4, "-67836", -67835.0001, -6.78351E4); |
||||||
|
$invalid_int1 = array(677, "677"); |
||||||
|
$invalid_int2 = array(-67874, "-67837", "-67835abc"); |
||||||
|
|
||||||
|
$float1 = 57385.45834; |
||||||
|
$float2 = -67345.76568; |
||||||
|
$valid_float1 = array("57385.45835", "57385.45835aaa", " 57385.45835", 5.738545835e4, "57385.45834", "57385.45834aaa", " 57385.45834", 5.738545834e4); |
||||||
|
$valid_float2 = array("-67345.76567", " -67345.76567", -6.734576567E4, "-67345.76568", "-67345.76568aaa", " -67345.76568", -6.734576568E4); |
||||||
|
$invalid_float1 = array(57385.45833, 5.738545833e4); |
||||||
|
$invalid_float2 = array(-67345.76569, -6.734576569E4, "-67345.76567aaa"); |
||||||
|
|
||||||
|
$toCompare = array( |
||||||
|
true, $valid_true, $valid_false, |
||||||
|
false, array_merge($valid_false, $valid_true), NULL, |
||||||
|
$int1, $valid_int1, $invalid_int1, |
||||||
|
$int2, $valid_int2, $invalid_int2, |
||||||
|
$float1, $valid_float1, $invalid_float1, |
||||||
|
$float2, $valid_float2, $invalid_float2 |
||||||
|
); |
||||||
|
|
||||||
|
$failed = false; |
||||||
|
for ($i = 0; $i < count($toCompare); $i +=3) { |
||||||
|
$typeToTest = $toCompare[$i]; |
||||||
|
$valid_compares = $toCompare[$i + 1]; |
||||||
|
$invalid_compares = $toCompare[$i + 2]; |
||||||
|
|
||||||
|
foreach($valid_compares as $compareVal) { |
||||||
|
if ($typeToTest <= $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTest' > '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($invalid_compares != NULL) { |
||||||
|
foreach($invalid_compares as $compareVal) { |
||||||
|
if ($typeToTest <= $compareVal) { |
||||||
|
echo "FAILED: '$typeToTest' <= '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,61 @@ |
|||||||
|
--TEST-- |
||||||
|
Test <= operator : max int 32bit range |
||||||
|
--SKIPIF-- |
||||||
|
<?php |
||||||
|
if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); |
||||||
|
?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
define("MAX_64Bit", 9223372036854775807); |
||||||
|
define("MAX_32Bit", 2147483647); |
||||||
|
define("MIN_64Bit", -9223372036854775807 - 1); |
||||||
|
define("MIN_32Bit", -2147483647 - 1); |
||||||
|
|
||||||
|
$validLtOrEqual = array ( |
||||||
|
MAX_32Bit, array(MAX_32Bit, "2147483647", "2147483647.0000000", 2.147483647e9, 2147483647.0, MAX_32Bit + 1), |
||||||
|
MIN_32Bit, array(MIN_32Bit, "-2147483648", "-2147483648.000", -2.147483648e9, -2147483648.0, MIN_32Bit + 1), |
||||||
|
MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1, MAX_64Bit - 1), |
||||||
|
MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1, MIN_64Bit + 1), |
||||||
|
); |
||||||
|
|
||||||
|
$invalidLtOrEqual = array ( |
||||||
|
MAX_32Bit, array("2147483646", 2.1474836460001e9, MAX_32Bit - 1), |
||||||
|
MIN_32Bit, array(MIN_32Bit - 1, "-2147483649", -2.1474836480001e9) |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
$failed = false; |
||||||
|
// test valid values |
||||||
|
for ($i = 0; $i < count($validLtOrEqual); $i +=2) { |
||||||
|
$typeToTestVal = $validLtOrEqual[$i]; |
||||||
|
$compares = $validLtOrEqual[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal <= $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTestVal' > '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
// test invalid values |
||||||
|
for ($i = 0; $i < count($invalidLtOrEqual); $i +=2) { |
||||||
|
$typeToTestVal = $invalidLtOrEqual[$i]; |
||||||
|
$compares = $invalidLtOrEqual[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal <= $compareVal) { |
||||||
|
echo "FAILED: '$typeToTestVal' <= '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,61 @@ |
|||||||
|
--TEST-- |
||||||
|
Test <= operator : max int 64bit range |
||||||
|
--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); |
||||||
|
|
||||||
|
$validLtOrEqual = array ( |
||||||
|
MAX_32Bit, array(MAX_32Bit, "2147483647", "2147483647.0000000", 2.147483647e9, 2147483647.0, MAX_32Bit + 1), |
||||||
|
MIN_32Bit, array(MIN_32Bit, "-2147483648", "-2147483648.000", -2.147483648e9, -2147483648.0, MIN_32Bit + 1), |
||||||
|
MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1.0), |
||||||
|
MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1.0, MIN_64Bit + 1), |
||||||
|
); |
||||||
|
|
||||||
|
$invalidLtOrEqual = array ( |
||||||
|
MAX_32Bit, array("2147483646", 2.1474836460001e9, MAX_32Bit - 1), |
||||||
|
MIN_32Bit, array(MIN_32Bit - 1, "-2147483649", -2.1474836480001e9) |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
$failed = false; |
||||||
|
// test valid values |
||||||
|
for ($i = 0; $i < count($validLtOrEqual); $i +=2) { |
||||||
|
$typeToTestVal = $validLtOrEqual[$i]; |
||||||
|
$compares = $validLtOrEqual[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal <= $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTestVal' > '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
// test invalid values |
||||||
|
for ($i = 0; $i < count($invalidLtOrEqual); $i +=2) { |
||||||
|
$typeToTestVal = $invalidLtOrEqual[$i]; |
||||||
|
$compares = $invalidLtOrEqual[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal <= $compareVal) { |
||||||
|
echo "FAILED: '$typeToTestVal' <= '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,54 @@ |
|||||||
|
--TEST-- |
||||||
|
Test < operator : max int 32bit range |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
define("MAX_64Bit", 9223372036854775807); |
||||||
|
define("MAX_32Bit", 2147483647); |
||||||
|
define("MIN_64Bit", -9223372036854775807 - 1); |
||||||
|
define("MIN_32Bit", -2147483647 - 1); |
||||||
|
|
||||||
|
$validLessThan = array ( |
||||||
|
2147483646, array(MAX_32Bit, "2147483647", "2147483647.001", 2.147483647e9, 2147483647.9), |
||||||
|
MIN_32Bit, array(MIN_32Bit + 1, "-2147483647", "-2147483646.001", -2.1474836461e9, -2147483646.9), |
||||||
|
); |
||||||
|
|
||||||
|
$invalidLessThan = array ( |
||||||
|
MAX_32Bit, array("2147483646", 2.1474836460001e9, MAX_32Bit - 1), |
||||||
|
MIN_32Bit, array(MIN_32Bit - 1, "-2147483649", -2.1474836480001e9) |
||||||
|
); |
||||||
|
|
||||||
|
$failed = false; |
||||||
|
// test for equality |
||||||
|
for ($i = 0; $i < count($validLessThan); $i +=2) { |
||||||
|
$typeToTestVal = $validLessThan[$i]; |
||||||
|
$compares = $validLessThan[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal < $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTestVal' >= '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
// test for invalid values |
||||||
|
for ($i = 0; $i < count($invalidLessThan); $i +=2) { |
||||||
|
$typeToTestVal = $invalidLessThan[$i]; |
||||||
|
$compares = $invalidLessThan[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal < $compareVal) { |
||||||
|
echo "FAILED: '$typeToTestVal' < '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,58 @@ |
|||||||
|
--TEST-- |
||||||
|
Test < operator : max int 64bit range |
||||||
|
--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); |
||||||
|
|
||||||
|
$validLessThan = array ( |
||||||
|
2147483646, array(MAX_32Bit, "2147483647", "2147483647.001", 2.147483647e9, 2147483647.9), |
||||||
|
MIN_32Bit, array(MIN_32Bit + 1, "-2147483647", "-2147483646.001", -2.1474836461e9, -2147483646.9), |
||||||
|
); |
||||||
|
|
||||||
|
$invalidLessThan = array ( |
||||||
|
MAX_32Bit, array("2147483646", 2.1474836460001e9, MAX_32Bit - 1), |
||||||
|
MIN_32Bit, array(MIN_32Bit - 1, "-2147483649", -2.1474836480001e9) |
||||||
|
); |
||||||
|
|
||||||
|
$failed = false; |
||||||
|
// test for equality |
||||||
|
for ($i = 0; $i < count($validLessThan); $i +=2) { |
||||||
|
$typeToTestVal = $validLessThan[$i]; |
||||||
|
$compares = $validLessThan[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal < $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTestVal' >= '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
// test for invalid values |
||||||
|
for ($i = 0; $i < count($invalidLessThan); $i +=2) { |
||||||
|
$typeToTestVal = $invalidLessThan[$i]; |
||||||
|
$compares = $invalidLessThan[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal < $compareVal) { |
||||||
|
echo "FAILED: '$typeToTestVal' < '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,63 @@ |
|||||||
|
--TEST-- |
||||||
|
Test != operator : different types |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$valid_true = array(1, "1", "true", 1.0, array(1)); |
||||||
|
$valid_false = array(0, "", 0.0, array(), NULL); |
||||||
|
|
||||||
|
$int1 = 679; |
||||||
|
$int2 = -67835; |
||||||
|
$valid_int1 = array("679abc", "6 7 9", "6y79", 678); |
||||||
|
$valid_int2 = array("-67835abc", "- 67835", "-67,835", "-67 835", "-678y35", -76834); |
||||||
|
$invalid_int1 = array("679", " 679", "679 ", 679.0, 6.79E2, "+679", +679); |
||||||
|
$invalid_int2 = array("-67835", " -67835", "-67835 ", -67835.000, -6.7835E4); |
||||||
|
|
||||||
|
$float1 = 57385.45835; |
||||||
|
$float2 = -67345.76567; |
||||||
|
$valid_float1 = array("57385.45835aaa", "57385. 45835", "57,385.45835", 57385.45834, 5.738545834e4); |
||||||
|
$valid_float2 = array("-67345.76567aaa", "- 67345.76567", "-67,345.76567", -67345.76566, -6.734576566E4); |
||||||
|
$invalid_float1 = array("57385.45835", " 57385.45835", 5.738545835e4); |
||||||
|
$invalid_float2 = array("-67345.76567", " -67345.76567", -6.734576567E4); |
||||||
|
|
||||||
|
|
||||||
|
$toCompare = array( |
||||||
|
true, $valid_false, $valid_true, |
||||||
|
false, $valid_true, $valid_false, |
||||||
|
$int1, $valid_int1, $invalid_int1, |
||||||
|
$int2, $valid_int2, $invalid_int2, |
||||||
|
$float1, $valid_float1, $invalid_float1, |
||||||
|
$float2, $valid_float2, $invalid_float2 |
||||||
|
); |
||||||
|
|
||||||
|
$failed = false; |
||||||
|
for ($i = 0; $i < count($toCompare); $i +=3) { |
||||||
|
$typeToTest = $toCompare[$i]; |
||||||
|
$valid_compares = $toCompare[$i + 1]; |
||||||
|
$invalid_compares = $toCompare[$i + 2]; |
||||||
|
|
||||||
|
foreach($valid_compares as $compareVal) { |
||||||
|
if ($typeToTest != $compareVal && $typeToTest <> $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTest' == '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
foreach($invalid_compares as $compareVal) { |
||||||
|
if ($typeToTest != $compareVal || $typeToTest <> $compareVal) { |
||||||
|
echo "FAILED: '$typeToTest' != '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,61 @@ |
|||||||
|
--TEST-- |
||||||
|
Test != operator : max int 32bit range |
||||||
|
--SKIPIF-- |
||||||
|
<?php |
||||||
|
if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); |
||||||
|
?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
define("MAX_64Bit", 9223372036854775807); |
||||||
|
define("MAX_32Bit", 2147483647); |
||||||
|
define("MIN_64Bit", -9223372036854775807 - 1); |
||||||
|
define("MIN_32Bit", -2147483647 - 1); |
||||||
|
|
||||||
|
$invalidNotEquals = array ( |
||||||
|
MAX_32Bit, array(MAX_32Bit, "2147483647", "2147483647.0000000", 2.147483647e9), |
||||||
|
MIN_32Bit, array(MIN_32Bit, "-2147483648", "-2147483648.000", -2.147483648e9), |
||||||
|
MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1, MAX_64Bit - 1), |
||||||
|
MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1, MIN_64Bit + 1), |
||||||
|
); |
||||||
|
|
||||||
|
$validNotEquals = array ( |
||||||
|
MAX_32Bit, array("2147483648", 2.1474836470001e9, MAX_32Bit - 1, MAX_32Bit + 1), |
||||||
|
MIN_32Bit, array("-2147483649", -2.1474836480001e9, MIN_32Bit -1, MIN_32Bit + 1), |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
$failed = false; |
||||||
|
// test valid values |
||||||
|
for ($i = 0; $i < count($validNotEquals); $i +=2) { |
||||||
|
$typeToTestVal = $validNotEquals[$i]; |
||||||
|
$compares = $validNotEquals[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal != $compareVal && $typeToTestVal != $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTestVal' == '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
// test invalid values |
||||||
|
for ($i = 0; $i < count($invalidNotEquals); $i +=2) { |
||||||
|
$typeToTestVal = $invalidNotEquals[$i]; |
||||||
|
$compares = $invalidNotEquals[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal != $compareVal || $typeToTestVal != $compareVal) { |
||||||
|
echo "FAILED: '$typeToTestVal' != '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,63 @@ |
|||||||
|
--TEST-- |
||||||
|
Test == operator : max int 64bit range |
||||||
|
--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); |
||||||
|
|
||||||
|
$invalidNotEquals = array ( |
||||||
|
MAX_32Bit, array(MAX_32Bit, "2147483647", "2147483647.0000000", 2.147483647e9), |
||||||
|
MIN_32Bit, array(MIN_32Bit, "-2147483648", "-2147483648.000", -2.147483648e9), |
||||||
|
MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1.0), |
||||||
|
MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1.0), |
||||||
|
); |
||||||
|
|
||||||
|
$validNotEquals = array ( |
||||||
|
MAX_32Bit, array("2147483648", 2.1474836470001e9, MAX_32Bit - 1, MAX_32Bit + 1), |
||||||
|
MIN_32Bit, array("-2147483649", -2.1474836480001e9, MIN_32Bit -1, MIN_32Bit + 1), |
||||||
|
MAX_64Bit, array(MAX_64Bit - 1), |
||||||
|
MIN_64Bit, array(MIN_64Bit + 1), |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
$failed = false; |
||||||
|
// test valid values |
||||||
|
for ($i = 0; $i < count($validNotEquals); $i +=2) { |
||||||
|
$typeToTestVal = $validNotEquals[$i]; |
||||||
|
$compares = $validNotEquals[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal != $compareVal && $typeToTestVal <> $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTestVal' == '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
// test invalid values |
||||||
|
for ($i = 0; $i < count($invalidNotEquals); $i +=2) { |
||||||
|
$typeToTestVal = $invalidNotEquals[$i]; |
||||||
|
$compares = $invalidNotEquals[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal != $compareVal || $typeToTestVal <> $compareVal) { |
||||||
|
echo "FAILED: '$typeToTestVal' != '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,63 @@ |
|||||||
|
--TEST-- |
||||||
|
Test !== operator : different types |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$valid_true = array(1, "1", "true", 1.0, array(1)); |
||||||
|
$valid_false = array(0, "", 0.0, array(), NULL); |
||||||
|
|
||||||
|
$int1 = 679; |
||||||
|
$int2 = -67835; |
||||||
|
$valid_int1 = array("679", "679abc", " 679", "679 ", 679.0, 6.79E2, "+679", "6 7 9", "6y79", 678); |
||||||
|
$valid_int2 = array("-67835", "-67835abc", " -67835", "-67835 ", -67835.000, -6.7835E4, "- 67835", "-67,835", "-67 835", "-678y35", -76834); |
||||||
|
$invalid_int1 = array(679, +679); |
||||||
|
$invalid_int2 = array(-67835); |
||||||
|
|
||||||
|
$float1 = 57385.45835; |
||||||
|
$float2 = -67345.76567; |
||||||
|
$valid_float1 = array("57385.45835", "57385.45835aaa", " 57385.45835", "57385. 45835", "57,385.45835", 57385.45834, 5.738545834e4); |
||||||
|
$valid_float2 = array("-67345.76567", "-67345.76567aaa", " -67345.76567", "- 67345.76567", "-67,345.76567", -67345.76566, -6.734576566E4); |
||||||
|
$invalid_float1 = array(57385.45835, 5.738545835e4); |
||||||
|
$invalid_float2 = array(-67345.76567, -6.734576567E4); |
||||||
|
|
||||||
|
|
||||||
|
$toCompare = array( |
||||||
|
true, array_merge($valid_true, $valid_false), array(true), |
||||||
|
false, array_merge($valid_true, $valid_false), array(false), |
||||||
|
$int1, $valid_int1, $invalid_int1, |
||||||
|
$int2, $valid_int2, $invalid_int2, |
||||||
|
$float1, $valid_float1, $invalid_float1, |
||||||
|
$float2, $valid_float2, $invalid_float2 |
||||||
|
); |
||||||
|
|
||||||
|
$failed = false; |
||||||
|
for ($i = 0; $i < count($toCompare); $i +=3) { |
||||||
|
$typeToTest = $toCompare[$i]; |
||||||
|
$valid_compares = $toCompare[$i + 1]; |
||||||
|
$invalid_compares = $toCompare[$i + 2]; |
||||||
|
|
||||||
|
foreach($valid_compares as $compareVal) { |
||||||
|
if ($typeToTest !== $compareVal) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTest' === '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
foreach($invalid_compares as $compareVal) { |
||||||
|
if ($typeToTest !== $compareVal) { |
||||||
|
echo "FAILED: '$typeToTest' !== '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,62 @@ |
|||||||
|
--TEST-- |
||||||
|
Test !== operator : max int 32bit range |
||||||
|
--SKIPIF-- |
||||||
|
<?php |
||||||
|
if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); |
||||||
|
?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
define("MAX_64Bit", 9223372036854775807); |
||||||
|
define("MAX_32Bit", 2147483647); |
||||||
|
define("MIN_64Bit", -9223372036854775807 - 1); |
||||||
|
define("MIN_32Bit", -2147483647 - 1); |
||||||
|
|
||||||
|
$invalidNotIdentical = array ( |
||||||
|
MAX_32Bit, array(MAX_32Bit), |
||||||
|
MIN_32Bit, array(MIN_32Bit), |
||||||
|
MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1, MAX_64Bit - 1), |
||||||
|
MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1, MIN_64Bit + 1), |
||||||
|
); |
||||||
|
|
||||||
|
$validNotIdentical = array ( |
||||||
|
MAX_32Bit, array("2147483647", "2147483647.0000000", 2.147483647e9, 2147483647.0, "2147483648", 2.1474836470001e9, MAX_32Bit - 1, MAX_32Bit + 1), |
||||||
|
MIN_32Bit, array("-2147483648", "-2147483648.000", -2.147483648e9, -2147483648.0, "-2147483649", -2.1474836480001e9, MIN_32Bit -1, MIN_32Bit + 1), |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
$failed = false; |
||||||
|
// test for valid values |
||||||
|
for ($i = 0; $i < count($validNotIdentical); $i +=2) { |
||||||
|
$typeToTestVal = $validNotIdentical[$i]; |
||||||
|
$compares = $validNotIdentical[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal !== $compareVal) { |
||||||
|
//Do Nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTestVal' === '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
// test for invalid values |
||||||
|
for ($i = 0; $i < count($invalidNotIdentical); $i +=2) { |
||||||
|
$typeToTestVal = $invalidNotIdentical[$i]; |
||||||
|
$compares = $invalidNotIdentical[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal !== $compareVal) { |
||||||
|
echo "FAILED: '$typeToTestVal' !== '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,63 @@ |
|||||||
|
--TEST-- |
||||||
|
Test !== operator : max int 64bit range |
||||||
|
--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); |
||||||
|
|
||||||
|
$invalidNotIdentical = array ( |
||||||
|
MAX_32Bit, array(MAX_32Bit), |
||||||
|
MIN_32Bit, array(MIN_32Bit), |
||||||
|
MAX_64Bit, array(MAX_64Bit), |
||||||
|
MIN_64Bit, array(MIN_64Bit), |
||||||
|
); |
||||||
|
|
||||||
|
$validNotIdentical = array ( |
||||||
|
MAX_32Bit, array("2147483647", "2147483647.0000000", 2.147483647e9, 2147483647.0, "2147483648", 2.1474836470001e9, MAX_32Bit - 1, MAX_32Bit + 1), |
||||||
|
MIN_32Bit, array("-2147483648", "-2147483648.000", -2.147483648e9, -2147483648.0, "-2147483649", -2.1474836480001e9, MIN_32Bit -1, MIN_32Bit + 1), |
||||||
|
MAX_64Bit, array(MAX_64Bit - 1, MAX_64Bit + 1), |
||||||
|
MIN_64Bit, array(MIN_64Bit + 1, MIN_64Bit - 1), |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
$failed = false; |
||||||
|
// test for valid values |
||||||
|
for ($i = 0; $i < count($validNotIdentical); $i +=2) { |
||||||
|
$typeToTestVal = $validNotIdentical[$i]; |
||||||
|
$compares = $validNotIdentical[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal !== $compareVal) { |
||||||
|
//Do Nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: '$typeToTestVal' === '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
// test for invalid values |
||||||
|
for ($i = 0; $i < count($invalidNotIdentical); $i +=2) { |
||||||
|
$typeToTestVal = $invalidNotIdentical[$i]; |
||||||
|
$compares = $invalidNotIdentical[$i + 1]; |
||||||
|
foreach($compares as $compareVal) { |
||||||
|
if ($typeToTestVal !== $compareVal) { |
||||||
|
echo "FAILED: '$typeToTestVal' !== '$compareVal'\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,92 @@ |
|||||||
|
--TEST-- |
||||||
|
Test <=> operator : different types |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
$valid_true = array(1, "1", "true", 1.0, array(1)); |
||||||
|
$valid_false = array(0, "", 0.0, array(), NULL); |
||||||
|
|
||||||
|
$int1 = 679; |
||||||
|
$int2 = -67835; |
||||||
|
$valid_int1 = array("678", "678abc", " 678", "678 ", 678.0, 6.789E2, "+678", +678); |
||||||
|
$valid_int2 = array("-67836", " -67836", "-67836 ", -67835.0001, -6.78351E4); |
||||||
|
$invalid_int1 = array(679, "679"); |
||||||
|
$invalid_int2 = array(-67835, "-67835", "-67836abc"); |
||||||
|
|
||||||
|
$float1 = 57385.45835; |
||||||
|
$float2 = -67345.76567; |
||||||
|
$valid_float1 = array("57385.45834", "57385.45834aaa", " 57385.45834", 5.738545834e4); |
||||||
|
$valid_float2 = array("-67345.76568", " -67345.76568", -6.734576568E4); |
||||||
|
$invalid_float1 = array(57385.45835, 5.738545835e4); |
||||||
|
$invalid_float2 = array(-67345.76567, -6.734576567E4, "-67345.76568aaa"); |
||||||
|
|
||||||
|
|
||||||
|
$toCompare = array( |
||||||
|
// boolean test will result in both sides being converted to boolean so !0 = true and true is not > true for example |
||||||
|
// also note that a string of "0" is converted to false but a string of "0.0" is converted to true |
||||||
|
// false cannot be tested as 0 can never be > 0 or 1 |
||||||
|
true, $valid_false, $valid_true, |
||||||
|
$int1, $valid_int1, $invalid_int1, |
||||||
|
$int2, $valid_int2, $invalid_int2, |
||||||
|
$float1, $valid_float1, $invalid_float1, |
||||||
|
$float2, $valid_float2, $invalid_float2 |
||||||
|
); |
||||||
|
|
||||||
|
$failed = false; |
||||||
|
for ($i = 0; $i < count($toCompare); $i +=3) { |
||||||
|
$typeToTest = $toCompare[$i]; |
||||||
|
$valid_compares = $toCompare[$i + 1]; |
||||||
|
$invalid_compares = $toCompare[$i + 2]; |
||||||
|
|
||||||
|
foreach($valid_compares as $compareVal) { |
||||||
|
if (($typeToTest <=> $compareVal) === 1) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: ('$typeToTest' <=> '$compareVal') !== 1\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
if (($compareVal <=> $typeToTest) === -1) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: ('$compareVal' <=> '$typeToTest') !== -1\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
if (($compareVal <=> $compareVal) === 0) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: ('$compareVal' <=> '$compareVal') !== 0\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
foreach($invalid_compares as $compareVal) { |
||||||
|
if (($typeToTest <=> $compareVal) === 1) { |
||||||
|
echo "FAILED: ('$typeToTest' <=> '$compareVal') === 1\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
if (($compareVal <=> $typeToTest) === -1) { |
||||||
|
echo "FAILED: ('$compareVal' <=> '$typeToTest') === -1\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
if (($compareVal <=> $compareVal) !== 0) { |
||||||
|
echo "FAILED: ('$compareVal' <=> '$compareVal') !== 0\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if (($typeToTest <=> $typeToTest) === 0) { |
||||||
|
// do nothing |
||||||
|
} |
||||||
|
else { |
||||||
|
echo "FAILED: ('$typeToTest' <=> '$typeToTest') !== 0\n"; |
||||||
|
$failed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
if ($failed == false) { |
||||||
|
echo "Test Passed\n"; |
||||||
|
} |
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
Test Passed |
||||||
@ -0,0 +1,23 @@ |
|||||||
|
--TEST-- |
||||||
|
Operators on overloaded property reference |
||||||
|
--SKIPIF-- |
||||||
|
<?php die("skip");?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
class C { |
||||||
|
private $bar; |
||||||
|
function __construct() { $this->bar = str_repeat("1", 2); } |
||||||
|
function &__get($x) { return $this->bar; } |
||||||
|
function __set($x, $v) { $this->bar = $v; } |
||||||
|
} |
||||||
|
$x = new C; |
||||||
|
var_dump(++$x->foo); |
||||||
|
$x = new C; |
||||||
|
var_dump($x->foo++); |
||||||
|
$x = new C; |
||||||
|
var_dump($x->foo += 2); |
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
int(12) |
||||||
|
string(2) "11" |
||||||
|
int(13) |
||||||
@ -0,0 +1,59 @@ |
|||||||
|
--TEST-- |
||||||
|
Test N-- 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.0, MIN_64Bit + 1, MIN_64Bit - 1.0 |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
foreach ($longVals as $longVal) { |
||||||
|
echo "--- testing: $longVal ---\n"; |
||||||
|
$longVal--; |
||||||
|
var_dump($longVal); |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: 9223372036854775807 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: -9223372036854775808 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: 2147483647 --- |
||||||
|
int(2147483646) |
||||||
|
--- testing: -2147483648 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: 9223372034707292160 --- |
||||||
|
int(9223372034707292159) |
||||||
|
--- testing: -9223372034707292160 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: 2147483648 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: -2147483649 --- |
||||||
|
int(-2147483650) |
||||||
|
--- testing: 4294967294 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 4294967295 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 4294967293 --- |
||||||
|
int(4294967292) |
||||||
|
--- testing: 9223372036854775806 --- |
||||||
|
int(9223372036854775805) |
||||||
|
--- testing: 9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775807 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
@ -0,0 +1,47 @@ |
|||||||
|
--TEST-- |
||||||
|
Test N-- operator : various numbers as strings |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$strVals = array( |
||||||
|
"0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", |
||||||
|
"a5.9" |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
foreach ($strVals as $strVal) { |
||||||
|
echo "--- testing: '$strVal' ---\n"; |
||||||
|
$strVal--; |
||||||
|
var_dump($strVal); |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECTF-- |
||||||
|
--- testing: '0' --- |
||||||
|
int(-1) |
||||||
|
--- testing: '65' --- |
||||||
|
int(64) |
||||||
|
--- testing: '-44' --- |
||||||
|
int(-45) |
||||||
|
--- testing: '1.2' --- |
||||||
|
float(0.19999999999999996) |
||||||
|
--- testing: '-7.7' --- |
||||||
|
float(-8.7) |
||||||
|
--- testing: 'abc' --- |
||||||
|
string(3) "abc" |
||||||
|
--- testing: '123abc' --- |
||||||
|
string(6) "123abc" |
||||||
|
--- testing: '123e5' --- |
||||||
|
float(12299999) |
||||||
|
--- testing: '123e5xyz' --- |
||||||
|
string(8) "123e5xyz" |
||||||
|
--- testing: ' 123abc' --- |
||||||
|
string(7) " 123abc" |
||||||
|
--- testing: '123 abc' --- |
||||||
|
string(7) "123 abc" |
||||||
|
--- testing: '123abc ' --- |
||||||
|
string(7) "123abc " |
||||||
|
--- testing: '3.4a' --- |
||||||
|
string(4) "3.4a" |
||||||
|
--- testing: 'a5.9' --- |
||||||
|
string(4) "a5.9" |
||||||
@ -0,0 +1,59 @@ |
|||||||
|
--TEST-- |
||||||
|
Test N++ 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.0, MIN_64Bit + 1, MIN_64Bit - 1.0 |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
foreach ($longVals as $longVal) { |
||||||
|
echo "--- testing: $longVal ---\n"; |
||||||
|
$longVal++; |
||||||
|
var_dump($longVal); |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: 9223372036854775807 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775808 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 2147483647 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: -2147483648 --- |
||||||
|
int(-2147483647) |
||||||
|
--- testing: 9223372034707292160 --- |
||||||
|
int(9223372034707292161) |
||||||
|
--- testing: -9223372034707292160 --- |
||||||
|
int(-9223372034707292159) |
||||||
|
--- testing: 2147483648 --- |
||||||
|
int(2147483649) |
||||||
|
--- testing: -2147483649 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: 4294967294 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967295 --- |
||||||
|
int(4294967296) |
||||||
|
--- testing: 4294967293 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 9223372036854775806 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775807 --- |
||||||
|
int(-9223372036854775806) |
||||||
|
--- testing: -9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
@ -0,0 +1,47 @@ |
|||||||
|
--TEST-- |
||||||
|
Test N++ operator : various numbers as strings |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$strVals = array( |
||||||
|
"0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", |
||||||
|
"a5.9" |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
foreach ($strVals as $strVal) { |
||||||
|
echo "--- testing: '$strVal' ---\n"; |
||||||
|
$strVal++; |
||||||
|
var_dump($strVal); |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECTF-- |
||||||
|
--- testing: '0' --- |
||||||
|
int(1) |
||||||
|
--- testing: '65' --- |
||||||
|
int(66) |
||||||
|
--- testing: '-44' --- |
||||||
|
int(-43) |
||||||
|
--- testing: '1.2' --- |
||||||
|
float(2.2) |
||||||
|
--- testing: '-7.7' --- |
||||||
|
float(-6.7) |
||||||
|
--- testing: 'abc' --- |
||||||
|
string(3) "abd" |
||||||
|
--- testing: '123abc' --- |
||||||
|
string(6) "123abd" |
||||||
|
--- testing: '123e5' --- |
||||||
|
float(12300001) |
||||||
|
--- testing: '123e5xyz' --- |
||||||
|
string(8) "123e5xza" |
||||||
|
--- testing: ' 123abc' --- |
||||||
|
string(7) " 123abd" |
||||||
|
--- testing: '123 abc' --- |
||||||
|
string(7) "123 abd" |
||||||
|
--- testing: '123abc ' --- |
||||||
|
string(7) "123abc " |
||||||
|
--- testing: '3.4a' --- |
||||||
|
string(4) "3.4b" |
||||||
|
--- testing: 'a5.9' --- |
||||||
|
string(4) "a5.0" |
||||||
@ -0,0 +1,58 @@ |
|||||||
|
--TEST-- |
||||||
|
Test --N 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.0, MIN_64Bit + 1, MIN_64Bit - 1.0 |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
foreach ($longVals as $k=>$longVal) { |
||||||
|
echo "--- testing: $longVal ---\n"; |
||||||
|
var_dump(--$longVal); |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: 9223372036854775807 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: -9223372036854775808 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: 2147483647 --- |
||||||
|
int(2147483646) |
||||||
|
--- testing: -2147483648 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: 9223372034707292160 --- |
||||||
|
int(9223372034707292159) |
||||||
|
--- testing: -9223372034707292160 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: 2147483648 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: -2147483649 --- |
||||||
|
int(-2147483650) |
||||||
|
--- testing: 4294967294 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 4294967295 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 4294967293 --- |
||||||
|
int(4294967292) |
||||||
|
--- testing: 9223372036854775806 --- |
||||||
|
int(9223372036854775805) |
||||||
|
--- testing: 9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775807 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
@ -0,0 +1,46 @@ |
|||||||
|
--TEST-- |
||||||
|
Test --N operator : various numbers as strings |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$strVals = array( |
||||||
|
"0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", |
||||||
|
"a5.9" |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
foreach ($strVals as $strVal) { |
||||||
|
echo "--- testing: '$strVal' ---\n"; |
||||||
|
var_dump(--$strVal); |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECTF-- |
||||||
|
--- testing: '0' --- |
||||||
|
int(-1) |
||||||
|
--- testing: '65' --- |
||||||
|
int(64) |
||||||
|
--- testing: '-44' --- |
||||||
|
int(-45) |
||||||
|
--- testing: '1.2' --- |
||||||
|
float(0.19999999999999996) |
||||||
|
--- testing: '-7.7' --- |
||||||
|
float(-8.7) |
||||||
|
--- testing: 'abc' --- |
||||||
|
string(3) "abc" |
||||||
|
--- testing: '123abc' --- |
||||||
|
string(6) "123abc" |
||||||
|
--- testing: '123e5' --- |
||||||
|
float(12299999) |
||||||
|
--- testing: '123e5xyz' --- |
||||||
|
string(8) "123e5xyz" |
||||||
|
--- testing: ' 123abc' --- |
||||||
|
string(7) " 123abc" |
||||||
|
--- testing: '123 abc' --- |
||||||
|
string(7) "123 abc" |
||||||
|
--- testing: '123abc ' --- |
||||||
|
string(7) "123abc " |
||||||
|
--- testing: '3.4a' --- |
||||||
|
string(4) "3.4a" |
||||||
|
--- testing: 'a5.9' --- |
||||||
|
string(4) "a5.9" |
||||||
@ -0,0 +1,58 @@ |
|||||||
|
--TEST-- |
||||||
|
Test ++N 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.0, MIN_64Bit + 1, MIN_64Bit - 1.0 |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
foreach ($longVals as $longVal) { |
||||||
|
echo "--- testing: $longVal ---\n"; |
||||||
|
var_dump(++$longVal); |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: 9223372036854775807 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775808 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 2147483647 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: -2147483648 --- |
||||||
|
int(-2147483647) |
||||||
|
--- testing: 9223372034707292160 --- |
||||||
|
int(9223372034707292161) |
||||||
|
--- testing: -9223372034707292160 --- |
||||||
|
int(-9223372034707292159) |
||||||
|
--- testing: 2147483648 --- |
||||||
|
int(2147483649) |
||||||
|
--- testing: -2147483649 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: 4294967294 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967295 --- |
||||||
|
int(4294967296) |
||||||
|
--- testing: 4294967293 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 9223372036854775806 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775807 --- |
||||||
|
int(-9223372036854775806) |
||||||
|
--- testing: -9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
@ -0,0 +1,65 @@ |
|||||||
|
--TEST-- |
||||||
|
Test ++N operator : various numbers as strings |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$strVals = array( |
||||||
|
"0","65","-44", "1.2", "-7.7", |
||||||
|
"abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", "a5.9", |
||||||
|
"z", "az", "zz", "Z", "AZ", "ZZ", "9z", "19z", "99z", |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
foreach ($strVals as $strVal) { |
||||||
|
echo "--- testing: '$strVal' ---\n"; |
||||||
|
var_dump(++$strVal); |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECTF-- |
||||||
|
--- testing: '0' --- |
||||||
|
int(1) |
||||||
|
--- testing: '65' --- |
||||||
|
int(66) |
||||||
|
--- testing: '-44' --- |
||||||
|
int(-43) |
||||||
|
--- testing: '1.2' --- |
||||||
|
float(2.2) |
||||||
|
--- testing: '-7.7' --- |
||||||
|
float(-6.7) |
||||||
|
--- testing: 'abc' --- |
||||||
|
string(3) "abd" |
||||||
|
--- testing: '123abc' --- |
||||||
|
string(6) "123abd" |
||||||
|
--- testing: '123e5' --- |
||||||
|
float(12300001) |
||||||
|
--- testing: '123e5xyz' --- |
||||||
|
string(8) "123e5xza" |
||||||
|
--- testing: ' 123abc' --- |
||||||
|
string(7) " 123abd" |
||||||
|
--- testing: '123 abc' --- |
||||||
|
string(7) "123 abd" |
||||||
|
--- testing: '123abc ' --- |
||||||
|
string(7) "123abc " |
||||||
|
--- testing: '3.4a' --- |
||||||
|
string(4) "3.4b" |
||||||
|
--- testing: 'a5.9' --- |
||||||
|
string(4) "a5.0" |
||||||
|
--- testing: 'z' --- |
||||||
|
string(2) "aa" |
||||||
|
--- testing: 'az' --- |
||||||
|
string(2) "ba" |
||||||
|
--- testing: 'zz' --- |
||||||
|
string(3) "aaa" |
||||||
|
--- testing: 'Z' --- |
||||||
|
string(2) "AA" |
||||||
|
--- testing: 'AZ' --- |
||||||
|
string(2) "BA" |
||||||
|
--- testing: 'ZZ' --- |
||||||
|
string(3) "AAA" |
||||||
|
--- testing: '9z' --- |
||||||
|
string(3) "10a" |
||||||
|
--- testing: '19z' --- |
||||||
|
string(3) "20a" |
||||||
|
--- testing: '99z' --- |
||||||
|
string(4) "100a" |
||||||
@ -0,0 +1,580 @@ |
|||||||
|
--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.0, MIN_64Bit + 1, MIN_64Bit - 1.0 |
||||||
|
); |
||||||
|
|
||||||
|
$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); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: 9223372036854775807 - 0 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775807 - 1 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 9223372036854775807 - -1 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9223372036854775807 - 7 --- |
||||||
|
int(9223372036854775800) |
||||||
|
--- testing: 9223372036854775807 - 9 --- |
||||||
|
int(9223372036854775798) |
||||||
|
--- testing: 9223372036854775807 - 65 --- |
||||||
|
int(9223372036854775742) |
||||||
|
--- testing: 9223372036854775807 - -44 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9223372036854775807 - 2147483647 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 9223372036854775807 - 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: -9223372036854775808 - 0 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9223372036854775808 - 1 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775808 - -1 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -9223372036854775808 - 7 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775808 - 9 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775808 - 65 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775808 - -44 --- |
||||||
|
int(-9223372036854775764) |
||||||
|
--- testing: -9223372036854775808 - 2147483647 --- |
||||||
|
float(-9.22337203900226E+18) |
||||||
|
--- testing: -9223372036854775808 - 9223372036854775807 --- |
||||||
|
float(-1.8446744073709552E+19) |
||||||
|
--- testing: 2147483647 - 0 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483647 - 1 --- |
||||||
|
int(2147483646) |
||||||
|
--- testing: 2147483647 - -1 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 2147483647 - 7 --- |
||||||
|
int(2147483640) |
||||||
|
--- testing: 2147483647 - 9 --- |
||||||
|
int(2147483638) |
||||||
|
--- testing: 2147483647 - 65 --- |
||||||
|
int(2147483582) |
||||||
|
--- testing: 2147483647 - -44 --- |
||||||
|
int(2147483691) |
||||||
|
--- testing: 2147483647 - 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 - 9223372036854775807 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: -2147483648 - 0 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -2147483648 - 1 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -2147483648 - -1 --- |
||||||
|
int(-2147483647) |
||||||
|
--- testing: -2147483648 - 7 --- |
||||||
|
int(-2147483655) |
||||||
|
--- testing: -2147483648 - 9 --- |
||||||
|
int(-2147483657) |
||||||
|
--- testing: -2147483648 - 65 --- |
||||||
|
int(-2147483713) |
||||||
|
--- testing: -2147483648 - -44 --- |
||||||
|
int(-2147483604) |
||||||
|
--- testing: -2147483648 - 2147483647 --- |
||||||
|
int(-4294967295) |
||||||
|
--- testing: -2147483648 - 9223372036854775807 --- |
||||||
|
float(-9.22337203900226E+18) |
||||||
|
--- testing: 9223372034707292160 - 0 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 9223372034707292160 - 1 --- |
||||||
|
int(9223372034707292159) |
||||||
|
--- testing: 9223372034707292160 - -1 --- |
||||||
|
int(9223372034707292161) |
||||||
|
--- testing: 9223372034707292160 - 7 --- |
||||||
|
int(9223372034707292153) |
||||||
|
--- testing: 9223372034707292160 - 9 --- |
||||||
|
int(9223372034707292151) |
||||||
|
--- testing: 9223372034707292160 - 65 --- |
||||||
|
int(9223372034707292095) |
||||||
|
--- testing: 9223372034707292160 - -44 --- |
||||||
|
int(9223372034707292204) |
||||||
|
--- testing: 9223372034707292160 - 2147483647 --- |
||||||
|
int(9223372032559808513) |
||||||
|
--- testing: 9223372034707292160 - 9223372036854775807 --- |
||||||
|
int(-2147483647) |
||||||
|
--- testing: -9223372034707292160 - 0 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: -9223372034707292160 - 1 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: -9223372034707292160 - -1 --- |
||||||
|
int(-9223372034707292159) |
||||||
|
--- testing: -9223372034707292160 - 7 --- |
||||||
|
int(-9223372034707292167) |
||||||
|
--- testing: -9223372034707292160 - 9 --- |
||||||
|
int(-9223372034707292169) |
||||||
|
--- testing: -9223372034707292160 - 65 --- |
||||||
|
int(-9223372034707292225) |
||||||
|
--- testing: -9223372034707292160 - -44 --- |
||||||
|
int(-9223372034707292116) |
||||||
|
--- testing: -9223372034707292160 - 2147483647 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -9223372034707292160 - 9223372036854775807 --- |
||||||
|
float(-1.8446744071562068E+19) |
||||||
|
--- testing: 2147483648 - 0 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 2147483648 - 1 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 2147483648 - -1 --- |
||||||
|
int(2147483649) |
||||||
|
--- testing: 2147483648 - 7 --- |
||||||
|
int(2147483641) |
||||||
|
--- testing: 2147483648 - 9 --- |
||||||
|
int(2147483639) |
||||||
|
--- testing: 2147483648 - 65 --- |
||||||
|
int(2147483583) |
||||||
|
--- testing: 2147483648 - -44 --- |
||||||
|
int(2147483692) |
||||||
|
--- testing: 2147483648 - 2147483647 --- |
||||||
|
int(1) |
||||||
|
--- testing: 2147483648 - 9223372036854775807 --- |
||||||
|
int(-9223372034707292159) |
||||||
|
--- testing: -2147483649 - 0 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -2147483649 - 1 --- |
||||||
|
int(-2147483650) |
||||||
|
--- testing: -2147483649 - -1 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -2147483649 - 7 --- |
||||||
|
int(-2147483656) |
||||||
|
--- testing: -2147483649 - 9 --- |
||||||
|
int(-2147483658) |
||||||
|
--- testing: -2147483649 - 65 --- |
||||||
|
int(-2147483714) |
||||||
|
--- testing: -2147483649 - -44 --- |
||||||
|
int(-2147483605) |
||||||
|
--- testing: -2147483649 - 2147483647 --- |
||||||
|
int(-4294967296) |
||||||
|
--- testing: -2147483649 - 9223372036854775807 --- |
||||||
|
float(-9.22337203900226E+18) |
||||||
|
--- testing: 4294967294 - 0 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 4294967294 - 1 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 4294967294 - -1 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967294 - 7 --- |
||||||
|
int(4294967287) |
||||||
|
--- testing: 4294967294 - 9 --- |
||||||
|
int(4294967285) |
||||||
|
--- testing: 4294967294 - 65 --- |
||||||
|
int(4294967229) |
||||||
|
--- testing: 4294967294 - -44 --- |
||||||
|
int(4294967338) |
||||||
|
--- testing: 4294967294 - 2147483647 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 4294967294 - 9223372036854775807 --- |
||||||
|
int(-9223372032559808513) |
||||||
|
--- testing: 4294967295 - 0 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 4294967295 - 1 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 4294967295 - -1 --- |
||||||
|
int(4294967296) |
||||||
|
--- testing: 4294967295 - 7 --- |
||||||
|
int(4294967288) |
||||||
|
--- testing: 4294967295 - 9 --- |
||||||
|
int(4294967286) |
||||||
|
--- testing: 4294967295 - 65 --- |
||||||
|
int(4294967230) |
||||||
|
--- testing: 4294967295 - -44 --- |
||||||
|
int(4294967339) |
||||||
|
--- testing: 4294967295 - 2147483647 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 4294967295 - 9223372036854775807 --- |
||||||
|
int(-9223372032559808512) |
||||||
|
--- testing: 4294967293 - 0 --- |
||||||
|
int(4294967293) |
||||||
|
--- testing: 4294967293 - 1 --- |
||||||
|
int(4294967292) |
||||||
|
--- testing: 4294967293 - -1 --- |
||||||
|
int(4294967294) |
||||||
|
--- testing: 4294967293 - 7 --- |
||||||
|
int(4294967286) |
||||||
|
--- testing: 4294967293 - 9 --- |
||||||
|
int(4294967284) |
||||||
|
--- testing: 4294967293 - 65 --- |
||||||
|
int(4294967228) |
||||||
|
--- testing: 4294967293 - -44 --- |
||||||
|
int(4294967337) |
||||||
|
--- testing: 4294967293 - 2147483647 --- |
||||||
|
int(2147483646) |
||||||
|
--- testing: 4294967293 - 9223372036854775807 --- |
||||||
|
int(-9223372032559808514) |
||||||
|
--- testing: 9223372036854775806 - 0 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: 9223372036854775806 - 1 --- |
||||||
|
int(9223372036854775805) |
||||||
|
--- testing: 9223372036854775806 - -1 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 9223372036854775806 - 7 --- |
||||||
|
int(9223372036854775799) |
||||||
|
--- testing: 9223372036854775806 - 9 --- |
||||||
|
int(9223372036854775797) |
||||||
|
--- testing: 9223372036854775806 - 65 --- |
||||||
|
int(9223372036854775741) |
||||||
|
--- testing: 9223372036854775806 - -44 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9223372036854775806 - 2147483647 --- |
||||||
|
int(9223372034707292159) |
||||||
|
--- testing: 9223372036854775806 - 9223372036854775807 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 9.2233720368548E+18 - 0 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9.2233720368548E+18 - 1 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9.2233720368548E+18 - -1 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9.2233720368548E+18 - 7 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9.2233720368548E+18 - 9 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9.2233720368548E+18 - 65 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9.2233720368548E+18 - -44 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9.2233720368548E+18 - 2147483647 --- |
||||||
|
float(9.223372034707292E+18) |
||||||
|
--- testing: 9.2233720368548E+18 - 9223372036854775807 --- |
||||||
|
float(0) |
||||||
|
--- testing: -9223372036854775807 - 0 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -9223372036854775807 - 1 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -9223372036854775807 - -1 --- |
||||||
|
int(-9223372036854775806) |
||||||
|
--- testing: -9223372036854775807 - 7 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775807 - 9 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775807 - 65 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9223372036854775807 - -44 --- |
||||||
|
int(-9223372036854775763) |
||||||
|
--- testing: -9223372036854775807 - 2147483647 --- |
||||||
|
float(-9.22337203900226E+18) |
||||||
|
--- testing: -9223372036854775807 - 9223372036854775807 --- |
||||||
|
float(-1.8446744073709552E+19) |
||||||
|
--- testing: -9.2233720368548E+18 - 0 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9.2233720368548E+18 - 1 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9.2233720368548E+18 - -1 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9.2233720368548E+18 - 7 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9.2233720368548E+18 - 9 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9.2233720368548E+18 - 65 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9.2233720368548E+18 - -44 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -9.2233720368548E+18 - 2147483647 --- |
||||||
|
float(-9.22337203900226E+18) |
||||||
|
--- testing: -9.2233720368548E+18 - 9223372036854775807 --- |
||||||
|
float(-1.8446744073709552E+19) |
||||||
|
--- testing: 0 - 9223372036854775807 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: 0 - -9223372036854775808 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 0 - 2147483647 --- |
||||||
|
int(-2147483647) |
||||||
|
--- testing: 0 - -2147483648 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: 0 - 9223372034707292160 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: 0 - -9223372034707292160 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 0 - 2147483648 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: 0 - -2147483649 --- |
||||||
|
int(2147483649) |
||||||
|
--- testing: 0 - 4294967294 --- |
||||||
|
int(-4294967294) |
||||||
|
--- testing: 0 - 4294967295 --- |
||||||
|
int(-4294967295) |
||||||
|
--- testing: 0 - 4294967293 --- |
||||||
|
int(-4294967293) |
||||||
|
--- testing: 0 - 9223372036854775806 --- |
||||||
|
int(-9223372036854775806) |
||||||
|
--- testing: 0 - 9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: 0 - -9223372036854775807 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 0 - -9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 1 - 9223372036854775807 --- |
||||||
|
int(-9223372036854775806) |
||||||
|
--- testing: 1 - -9223372036854775808 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 1 - 2147483647 --- |
||||||
|
int(-2147483646) |
||||||
|
--- testing: 1 - -2147483648 --- |
||||||
|
int(2147483649) |
||||||
|
--- testing: 1 - 9223372034707292160 --- |
||||||
|
int(-9223372034707292159) |
||||||
|
--- testing: 1 - -9223372034707292160 --- |
||||||
|
int(9223372034707292161) |
||||||
|
--- testing: 1 - 2147483648 --- |
||||||
|
int(-2147483647) |
||||||
|
--- testing: 1 - -2147483649 --- |
||||||
|
int(2147483650) |
||||||
|
--- testing: 1 - 4294967294 --- |
||||||
|
int(-4294967293) |
||||||
|
--- testing: 1 - 4294967295 --- |
||||||
|
int(-4294967294) |
||||||
|
--- testing: 1 - 4294967293 --- |
||||||
|
int(-4294967292) |
||||||
|
--- testing: 1 - 9223372036854775806 --- |
||||||
|
int(-9223372036854775805) |
||||||
|
--- testing: 1 - 9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: 1 - -9223372036854775807 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 1 - -9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: -1 - 9223372036854775807 --- |
||||||
|
int(-9223372036854775808) |
||||||
|
--- testing: -1 - -9223372036854775808 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: -1 - 2147483647 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: -1 - -2147483648 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: -1 - 9223372034707292160 --- |
||||||
|
int(-9223372034707292161) |
||||||
|
--- testing: -1 - -9223372034707292160 --- |
||||||
|
int(9223372034707292159) |
||||||
|
--- testing: -1 - 2147483648 --- |
||||||
|
int(-2147483649) |
||||||
|
--- testing: -1 - -2147483649 --- |
||||||
|
int(2147483648) |
||||||
|
--- testing: -1 - 4294967294 --- |
||||||
|
int(-4294967295) |
||||||
|
--- testing: -1 - 4294967295 --- |
||||||
|
int(-4294967296) |
||||||
|
--- testing: -1 - 4294967293 --- |
||||||
|
int(-4294967294) |
||||||
|
--- testing: -1 - 9223372036854775806 --- |
||||||
|
int(-9223372036854775807) |
||||||
|
--- testing: -1 - 9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -1 - -9223372036854775807 --- |
||||||
|
int(9223372036854775806) |
||||||
|
--- testing: -1 - -9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 7 - 9223372036854775807 --- |
||||||
|
int(-9223372036854775800) |
||||||
|
--- testing: 7 - -9223372036854775808 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 7 - 2147483647 --- |
||||||
|
int(-2147483640) |
||||||
|
--- testing: 7 - -2147483648 --- |
||||||
|
int(2147483655) |
||||||
|
--- testing: 7 - 9223372034707292160 --- |
||||||
|
int(-9223372034707292153) |
||||||
|
--- testing: 7 - -9223372034707292160 --- |
||||||
|
int(9223372034707292167) |
||||||
|
--- testing: 7 - 2147483648 --- |
||||||
|
int(-2147483641) |
||||||
|
--- testing: 7 - -2147483649 --- |
||||||
|
int(2147483656) |
||||||
|
--- testing: 7 - 4294967294 --- |
||||||
|
int(-4294967287) |
||||||
|
--- testing: 7 - 4294967295 --- |
||||||
|
int(-4294967288) |
||||||
|
--- testing: 7 - 4294967293 --- |
||||||
|
int(-4294967286) |
||||||
|
--- testing: 7 - 9223372036854775806 --- |
||||||
|
int(-9223372036854775799) |
||||||
|
--- testing: 7 - 9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: 7 - -9223372036854775807 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 7 - -9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9 - 9223372036854775807 --- |
||||||
|
int(-9223372036854775798) |
||||||
|
--- testing: 9 - -9223372036854775808 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9 - 2147483647 --- |
||||||
|
int(-2147483638) |
||||||
|
--- testing: 9 - -2147483648 --- |
||||||
|
int(2147483657) |
||||||
|
--- testing: 9 - 9223372034707292160 --- |
||||||
|
int(-9223372034707292151) |
||||||
|
--- testing: 9 - -9223372034707292160 --- |
||||||
|
int(9223372034707292169) |
||||||
|
--- testing: 9 - 2147483648 --- |
||||||
|
int(-2147483639) |
||||||
|
--- testing: 9 - -2147483649 --- |
||||||
|
int(2147483658) |
||||||
|
--- testing: 9 - 4294967294 --- |
||||||
|
int(-4294967285) |
||||||
|
--- testing: 9 - 4294967295 --- |
||||||
|
int(-4294967286) |
||||||
|
--- testing: 9 - 4294967293 --- |
||||||
|
int(-4294967284) |
||||||
|
--- testing: 9 - 9223372036854775806 --- |
||||||
|
int(-9223372036854775797) |
||||||
|
--- testing: 9 - 9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: 9 - -9223372036854775807 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 9 - -9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 65 - 9223372036854775807 --- |
||||||
|
int(-9223372036854775742) |
||||||
|
--- testing: 65 - -9223372036854775808 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 65 - 2147483647 --- |
||||||
|
int(-2147483582) |
||||||
|
--- testing: 65 - -2147483648 --- |
||||||
|
int(2147483713) |
||||||
|
--- testing: 65 - 9223372034707292160 --- |
||||||
|
int(-9223372034707292095) |
||||||
|
--- testing: 65 - -9223372034707292160 --- |
||||||
|
int(9223372034707292225) |
||||||
|
--- testing: 65 - 2147483648 --- |
||||||
|
int(-2147483583) |
||||||
|
--- testing: 65 - -2147483649 --- |
||||||
|
int(2147483714) |
||||||
|
--- testing: 65 - 4294967294 --- |
||||||
|
int(-4294967229) |
||||||
|
--- testing: 65 - 4294967295 --- |
||||||
|
int(-4294967230) |
||||||
|
--- testing: 65 - 4294967293 --- |
||||||
|
int(-4294967228) |
||||||
|
--- testing: 65 - 9223372036854775806 --- |
||||||
|
int(-9223372036854775741) |
||||||
|
--- testing: 65 - 9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: 65 - -9223372036854775807 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 65 - -9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: -44 - 9223372036854775807 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -44 - -9223372036854775808 --- |
||||||
|
int(9223372036854775764) |
||||||
|
--- testing: -44 - 2147483647 --- |
||||||
|
int(-2147483691) |
||||||
|
--- testing: -44 - -2147483648 --- |
||||||
|
int(2147483604) |
||||||
|
--- testing: -44 - 9223372034707292160 --- |
||||||
|
int(-9223372034707292204) |
||||||
|
--- testing: -44 - -9223372034707292160 --- |
||||||
|
int(9223372034707292116) |
||||||
|
--- testing: -44 - 2147483648 --- |
||||||
|
int(-2147483692) |
||||||
|
--- testing: -44 - -2147483649 --- |
||||||
|
int(2147483605) |
||||||
|
--- testing: -44 - 4294967294 --- |
||||||
|
int(-4294967338) |
||||||
|
--- testing: -44 - 4294967295 --- |
||||||
|
int(-4294967339) |
||||||
|
--- testing: -44 - 4294967293 --- |
||||||
|
int(-4294967337) |
||||||
|
--- testing: -44 - 9223372036854775806 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -44 - 9.2233720368548E+18 --- |
||||||
|
float(-9.223372036854776E+18) |
||||||
|
--- testing: -44 - -9223372036854775807 --- |
||||||
|
int(9223372036854775763) |
||||||
|
--- testing: -44 - -9.2233720368548E+18 --- |
||||||
|
float(9.223372036854776E+18) |
||||||
|
--- testing: 2147483647 - 9223372036854775807 --- |
||||||
|
int(-9223372034707292160) |
||||||
|
--- testing: 2147483647 - -9223372036854775808 --- |
||||||
|
float(9.22337203900226E+18) |
||||||
|
--- testing: 2147483647 - 2147483647 --- |
||||||
|
int(0) |
||||||
|
--- testing: 2147483647 - -2147483648 --- |
||||||
|
int(4294967295) |
||||||
|
--- testing: 2147483647 - 9223372034707292160 --- |
||||||
|
int(-9223372032559808513) |
||||||
|
--- testing: 2147483647 - -9223372034707292160 --- |
||||||
|
int(9223372036854775807) |
||||||
|
--- testing: 2147483647 - 2147483648 --- |
||||||
|
int(-1) |
||||||
|
--- testing: 2147483647 - -2147483649 --- |
||||||
|
int(4294967296) |
||||||
|
--- testing: 2147483647 - 4294967294 --- |
||||||
|
int(-2147483647) |
||||||
|
--- testing: 2147483647 - 4294967295 --- |
||||||
|
int(-2147483648) |
||||||
|
--- testing: 2147483647 - 4294967293 --- |
||||||
|
int(-2147483646) |
||||||
|
--- testing: 2147483647 - 9223372036854775806 --- |
||||||
|
int(-9223372034707292159) |
||||||
|
--- testing: 2147483647 - 9.2233720368548E+18 --- |
||||||
|
float(-9.223372034707292E+18) |
||||||
|
--- testing: 2147483647 - -9223372036854775807 --- |
||||||
|
float(9.22337203900226E+18) |
||||||
|
--- testing: 2147483647 - -9.2233720368548E+18 --- |
||||||
|
float(9.22337203900226E+18) |
||||||
|
--- testing: 9223372036854775807 - 9223372036854775807 --- |
||||||
|
int(0) |
||||||
|
--- testing: 9223372036854775807 - -9223372036854775808 --- |
||||||
|
float(1.8446744073709552E+19) |
||||||
|
--- testing: 9223372036854775807 - 2147483647 --- |
||||||
|
int(9223372034707292160) |
||||||
|
--- testing: 9223372036854775807 - -2147483648 --- |
||||||
|
float(9.22337203900226E+18) |
||||||
|
--- testing: 9223372036854775807 - 9223372034707292160 --- |
||||||
|
int(2147483647) |
||||||
|
--- testing: 9223372036854775807 - -9223372034707292160 --- |
||||||
|
float(1.8446744071562068E+19) |
||||||
|
--- testing: 9223372036854775807 - 2147483648 --- |
||||||
|
int(9223372034707292159) |
||||||
|
--- testing: 9223372036854775807 - -2147483649 --- |
||||||
|
float(9.22337203900226E+18) |
||||||
|
--- testing: 9223372036854775807 - 4294967294 --- |
||||||
|
int(9223372032559808513) |
||||||
|
--- testing: 9223372036854775807 - 4294967295 --- |
||||||
|
int(9223372032559808512) |
||||||
|
--- testing: 9223372036854775807 - 4294967293 --- |
||||||
|
int(9223372032559808514) |
||||||
|
--- testing: 9223372036854775807 - 9223372036854775806 --- |
||||||
|
int(1) |
||||||
|
--- testing: 9223372036854775807 - 9.2233720368548E+18 --- |
||||||
|
float(0) |
||||||
|
--- testing: 9223372036854775807 - -9223372036854775807 --- |
||||||
|
float(1.8446744073709552E+19) |
||||||
|
--- testing: 9223372036854775807 - -9.2233720368548E+18 --- |
||||||
|
float(1.8446744073709552E+19) |
||||||
@ -0,0 +1,419 @@ |
|||||||
|
--TEST-- |
||||||
|
Test - operator : various numbers as strings |
||||||
|
--SKIPIF-- |
||||||
|
<?php die("skip");?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$strVals = array( |
||||||
|
"0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", |
||||||
|
"a5.9" |
||||||
|
); |
||||||
|
|
||||||
|
error_reporting(E_ERROR); |
||||||
|
|
||||||
|
foreach ($strVals as $strVal) { |
||||||
|
foreach($strVals as $otherVal) { |
||||||
|
echo "--- testing: '$strVal' - '$otherVal' ---\n"; |
||||||
|
try { |
||||||
|
var_dump($strVal-$otherVal); |
||||||
|
} catch (\TypeError $e) { |
||||||
|
echo $e->getMessage() . \PHP_EOL; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
--- testing: '0' - '0' --- |
||||||
|
int(0) |
||||||
|
--- testing: '0' - '65' --- |
||||||
|
int(-65) |
||||||
|
--- testing: '0' - '-44' --- |
||||||
|
int(44) |
||||||
|
--- testing: '0' - '1.2' --- |
||||||
|
float(-1.2) |
||||||
|
--- testing: '0' - '-7.7' --- |
||||||
|
float(7.7) |
||||||
|
--- testing: '0' - 'abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '0' - '123abc' --- |
||||||
|
int(-123) |
||||||
|
--- testing: '0' - '123e5' --- |
||||||
|
float(-12300000) |
||||||
|
--- testing: '0' - '123e5xyz' --- |
||||||
|
float(-12300000) |
||||||
|
--- testing: '0' - ' 123abc' --- |
||||||
|
int(-123) |
||||||
|
--- testing: '0' - '123 abc' --- |
||||||
|
int(-123) |
||||||
|
--- testing: '0' - '123abc ' --- |
||||||
|
int(-123) |
||||||
|
--- testing: '0' - '3.4a' --- |
||||||
|
float(-3.4) |
||||||
|
--- testing: '0' - 'a5.9' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '65' - '0' --- |
||||||
|
int(65) |
||||||
|
--- testing: '65' - '65' --- |
||||||
|
int(0) |
||||||
|
--- testing: '65' - '-44' --- |
||||||
|
int(109) |
||||||
|
--- testing: '65' - '1.2' --- |
||||||
|
float(63.8) |
||||||
|
--- testing: '65' - '-7.7' --- |
||||||
|
float(72.7) |
||||||
|
--- testing: '65' - 'abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '65' - '123abc' --- |
||||||
|
int(-58) |
||||||
|
--- testing: '65' - '123e5' --- |
||||||
|
float(-12299935) |
||||||
|
--- testing: '65' - '123e5xyz' --- |
||||||
|
float(-12299935) |
||||||
|
--- testing: '65' - ' 123abc' --- |
||||||
|
int(-58) |
||||||
|
--- testing: '65' - '123 abc' --- |
||||||
|
int(-58) |
||||||
|
--- testing: '65' - '123abc ' --- |
||||||
|
int(-58) |
||||||
|
--- testing: '65' - '3.4a' --- |
||||||
|
float(61.6) |
||||||
|
--- testing: '65' - 'a5.9' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '-44' - '0' --- |
||||||
|
int(-44) |
||||||
|
--- testing: '-44' - '65' --- |
||||||
|
int(-109) |
||||||
|
--- testing: '-44' - '-44' --- |
||||||
|
int(0) |
||||||
|
--- testing: '-44' - '1.2' --- |
||||||
|
float(-45.2) |
||||||
|
--- testing: '-44' - '-7.7' --- |
||||||
|
float(-36.3) |
||||||
|
--- testing: '-44' - 'abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '-44' - '123abc' --- |
||||||
|
int(-167) |
||||||
|
--- testing: '-44' - '123e5' --- |
||||||
|
float(-12300044) |
||||||
|
--- testing: '-44' - '123e5xyz' --- |
||||||
|
float(-12300044) |
||||||
|
--- testing: '-44' - ' 123abc' --- |
||||||
|
int(-167) |
||||||
|
--- testing: '-44' - '123 abc' --- |
||||||
|
int(-167) |
||||||
|
--- testing: '-44' - '123abc ' --- |
||||||
|
int(-167) |
||||||
|
--- testing: '-44' - '3.4a' --- |
||||||
|
float(-47.4) |
||||||
|
--- testing: '-44' - 'a5.9' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '1.2' - '0' --- |
||||||
|
float(1.2) |
||||||
|
--- testing: '1.2' - '65' --- |
||||||
|
float(-63.8) |
||||||
|
--- testing: '1.2' - '-44' --- |
||||||
|
float(45.2) |
||||||
|
--- testing: '1.2' - '1.2' --- |
||||||
|
float(0) |
||||||
|
--- testing: '1.2' - '-7.7' --- |
||||||
|
float(8.9) |
||||||
|
--- testing: '1.2' - 'abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '1.2' - '123abc' --- |
||||||
|
float(-121.8) |
||||||
|
--- testing: '1.2' - '123e5' --- |
||||||
|
float(-12299998.8) |
||||||
|
--- testing: '1.2' - '123e5xyz' --- |
||||||
|
float(-12299998.8) |
||||||
|
--- testing: '1.2' - ' 123abc' --- |
||||||
|
float(-121.8) |
||||||
|
--- testing: '1.2' - '123 abc' --- |
||||||
|
float(-121.8) |
||||||
|
--- testing: '1.2' - '123abc ' --- |
||||||
|
float(-121.8) |
||||||
|
--- testing: '1.2' - '3.4a' --- |
||||||
|
float(-2.2) |
||||||
|
--- testing: '1.2' - 'a5.9' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '-7.7' - '0' --- |
||||||
|
float(-7.7) |
||||||
|
--- testing: '-7.7' - '65' --- |
||||||
|
float(-72.7) |
||||||
|
--- testing: '-7.7' - '-44' --- |
||||||
|
float(36.3) |
||||||
|
--- testing: '-7.7' - '1.2' --- |
||||||
|
float(-8.9) |
||||||
|
--- testing: '-7.7' - '-7.7' --- |
||||||
|
float(0) |
||||||
|
--- testing: '-7.7' - 'abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '-7.7' - '123abc' --- |
||||||
|
float(-130.7) |
||||||
|
--- testing: '-7.7' - '123e5' --- |
||||||
|
float(-12300007.7) |
||||||
|
--- testing: '-7.7' - '123e5xyz' --- |
||||||
|
float(-12300007.7) |
||||||
|
--- testing: '-7.7' - ' 123abc' --- |
||||||
|
float(-130.7) |
||||||
|
--- testing: '-7.7' - '123 abc' --- |
||||||
|
float(-130.7) |
||||||
|
--- testing: '-7.7' - '123abc ' --- |
||||||
|
float(-130.7) |
||||||
|
--- testing: '-7.7' - '3.4a' --- |
||||||
|
float(-11.1) |
||||||
|
--- testing: '-7.7' - 'a5.9' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'abc' - '0' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'abc' - '65' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'abc' - '-44' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'abc' - '1.2' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'abc' - '-7.7' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'abc' - 'abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'abc' - '123abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'abc' - '123e5' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'abc' - '123e5xyz' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'abc' - ' 123abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'abc' - '123 abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'abc' - '123abc ' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'abc' - '3.4a' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'abc' - 'a5.9' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '123abc' - '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123abc' - '65' --- |
||||||
|
int(58) |
||||||
|
--- testing: '123abc' - '-44' --- |
||||||
|
int(167) |
||||||
|
--- testing: '123abc' - '1.2' --- |
||||||
|
float(121.8) |
||||||
|
--- testing: '123abc' - '-7.7' --- |
||||||
|
float(130.7) |
||||||
|
--- testing: '123abc' - 'abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '123abc' - '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' - '123e5' --- |
||||||
|
float(-12299877) |
||||||
|
--- testing: '123abc' - '123e5xyz' --- |
||||||
|
float(-12299877) |
||||||
|
--- testing: '123abc' - ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' - '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' - '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc' - '3.4a' --- |
||||||
|
float(119.6) |
||||||
|
--- testing: '123abc' - 'a5.9' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '123e5' - '0' --- |
||||||
|
float(12300000) |
||||||
|
--- testing: '123e5' - '65' --- |
||||||
|
float(12299935) |
||||||
|
--- testing: '123e5' - '-44' --- |
||||||
|
float(12300044) |
||||||
|
--- testing: '123e5' - '1.2' --- |
||||||
|
float(12299998.8) |
||||||
|
--- testing: '123e5' - '-7.7' --- |
||||||
|
float(12300007.7) |
||||||
|
--- testing: '123e5' - 'abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '123e5' - '123abc' --- |
||||||
|
float(12299877) |
||||||
|
--- testing: '123e5' - '123e5' --- |
||||||
|
float(0) |
||||||
|
--- testing: '123e5' - '123e5xyz' --- |
||||||
|
float(0) |
||||||
|
--- testing: '123e5' - ' 123abc' --- |
||||||
|
float(12299877) |
||||||
|
--- testing: '123e5' - '123 abc' --- |
||||||
|
float(12299877) |
||||||
|
--- testing: '123e5' - '123abc ' --- |
||||||
|
float(12299877) |
||||||
|
--- testing: '123e5' - '3.4a' --- |
||||||
|
float(12299996.6) |
||||||
|
--- testing: '123e5' - 'a5.9' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '123e5xyz' - '0' --- |
||||||
|
float(12300000) |
||||||
|
--- testing: '123e5xyz' - '65' --- |
||||||
|
float(12299935) |
||||||
|
--- testing: '123e5xyz' - '-44' --- |
||||||
|
float(12300044) |
||||||
|
--- testing: '123e5xyz' - '1.2' --- |
||||||
|
float(12299998.8) |
||||||
|
--- testing: '123e5xyz' - '-7.7' --- |
||||||
|
float(12300007.7) |
||||||
|
--- testing: '123e5xyz' - 'abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '123e5xyz' - '123abc' --- |
||||||
|
float(12299877) |
||||||
|
--- testing: '123e5xyz' - '123e5' --- |
||||||
|
float(0) |
||||||
|
--- testing: '123e5xyz' - '123e5xyz' --- |
||||||
|
float(0) |
||||||
|
--- testing: '123e5xyz' - ' 123abc' --- |
||||||
|
float(12299877) |
||||||
|
--- testing: '123e5xyz' - '123 abc' --- |
||||||
|
float(12299877) |
||||||
|
--- testing: '123e5xyz' - '123abc ' --- |
||||||
|
float(12299877) |
||||||
|
--- testing: '123e5xyz' - '3.4a' --- |
||||||
|
float(12299996.6) |
||||||
|
--- testing: '123e5xyz' - 'a5.9' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: ' 123abc' - '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: ' 123abc' - '65' --- |
||||||
|
int(58) |
||||||
|
--- testing: ' 123abc' - '-44' --- |
||||||
|
int(167) |
||||||
|
--- testing: ' 123abc' - '1.2' --- |
||||||
|
float(121.8) |
||||||
|
--- testing: ' 123abc' - '-7.7' --- |
||||||
|
float(130.7) |
||||||
|
--- testing: ' 123abc' - 'abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: ' 123abc' - '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' - '123e5' --- |
||||||
|
float(-12299877) |
||||||
|
--- testing: ' 123abc' - '123e5xyz' --- |
||||||
|
float(-12299877) |
||||||
|
--- testing: ' 123abc' - ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' - '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' - '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: ' 123abc' - '3.4a' --- |
||||||
|
float(119.6) |
||||||
|
--- testing: ' 123abc' - 'a5.9' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '123 abc' - '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123 abc' - '65' --- |
||||||
|
int(58) |
||||||
|
--- testing: '123 abc' - '-44' --- |
||||||
|
int(167) |
||||||
|
--- testing: '123 abc' - '1.2' --- |
||||||
|
float(121.8) |
||||||
|
--- testing: '123 abc' - '-7.7' --- |
||||||
|
float(130.7) |
||||||
|
--- testing: '123 abc' - 'abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '123 abc' - '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' - '123e5' --- |
||||||
|
float(-12299877) |
||||||
|
--- testing: '123 abc' - '123e5xyz' --- |
||||||
|
float(-12299877) |
||||||
|
--- testing: '123 abc' - ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' - '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' - '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123 abc' - '3.4a' --- |
||||||
|
float(119.6) |
||||||
|
--- testing: '123 abc' - 'a5.9' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '123abc ' - '0' --- |
||||||
|
int(123) |
||||||
|
--- testing: '123abc ' - '65' --- |
||||||
|
int(58) |
||||||
|
--- testing: '123abc ' - '-44' --- |
||||||
|
int(167) |
||||||
|
--- testing: '123abc ' - '1.2' --- |
||||||
|
float(121.8) |
||||||
|
--- testing: '123abc ' - '-7.7' --- |
||||||
|
float(130.7) |
||||||
|
--- testing: '123abc ' - 'abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '123abc ' - '123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' - '123e5' --- |
||||||
|
float(-12299877) |
||||||
|
--- testing: '123abc ' - '123e5xyz' --- |
||||||
|
float(-12299877) |
||||||
|
--- testing: '123abc ' - ' 123abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' - '123 abc' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' - '123abc ' --- |
||||||
|
int(0) |
||||||
|
--- testing: '123abc ' - '3.4a' --- |
||||||
|
float(119.6) |
||||||
|
--- testing: '123abc ' - 'a5.9' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '3.4a' - '0' --- |
||||||
|
float(3.4) |
||||||
|
--- testing: '3.4a' - '65' --- |
||||||
|
float(-61.6) |
||||||
|
--- testing: '3.4a' - '-44' --- |
||||||
|
float(47.4) |
||||||
|
--- testing: '3.4a' - '1.2' --- |
||||||
|
float(2.2) |
||||||
|
--- testing: '3.4a' - '-7.7' --- |
||||||
|
float(11.1) |
||||||
|
--- testing: '3.4a' - 'abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: '3.4a' - '123abc' --- |
||||||
|
float(-119.6) |
||||||
|
--- testing: '3.4a' - '123e5' --- |
||||||
|
float(-12299996.6) |
||||||
|
--- testing: '3.4a' - '123e5xyz' --- |
||||||
|
float(-12299996.6) |
||||||
|
--- testing: '3.4a' - ' 123abc' --- |
||||||
|
float(-119.6) |
||||||
|
--- testing: '3.4a' - '123 abc' --- |
||||||
|
float(-119.6) |
||||||
|
--- testing: '3.4a' - '123abc ' --- |
||||||
|
float(-119.6) |
||||||
|
--- testing: '3.4a' - '3.4a' --- |
||||||
|
float(0) |
||||||
|
--- testing: '3.4a' - 'a5.9' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'a5.9' - '0' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'a5.9' - '65' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'a5.9' - '-44' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'a5.9' - '1.2' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'a5.9' - '-7.7' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'a5.9' - 'abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'a5.9' - '123abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'a5.9' - '123e5' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'a5.9' - '123e5xyz' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'a5.9' - ' 123abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'a5.9' - '123 abc' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'a5.9' - '123abc ' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'a5.9' - '3.4a' --- |
||||||
|
Unsupported operand types: string - string |
||||||
|
--- testing: 'a5.9' - 'a5.9' --- |
||||||
|
Unsupported operand types: string - string |
||||||
Loading…
Reference in new issue