From 765eb7586943ac28f5c775dc3df8471a4a52d421 Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Tue, 30 Dec 2025 12:13:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E7=AE=97=E6=93=8D=E4=BD=9C=E7=AC=A6?= =?UTF-8?q?=20=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/compiler.php | 4 +- bin/opcode.php | 12 + run-tests.php | 4 + src/Php/Translator.php | 84 ++- .../lang/operators/add_basiclong_64bit.phpt | 580 +++++++++++++++++ .../core/lang/operators/add_variationStr.phpt | 419 +++++++++++++ .../operators/bitwiseAnd_basiclong_64bit.phpt | 580 +++++++++++++++++ .../operators/bitwiseAnd_variationStr.phpt | 414 ++++++++++++ .../operators/bitwiseNot_basiclong_64bit.phpt | 58 ++ .../operators/bitwiseNot_variationStr.phpt | 46 ++ .../operators/bitwiseOr_basiclong_64bit.phpt | 580 +++++++++++++++++ .../operators/bitwiseOr_variationStr.phpt | 414 ++++++++++++ .../bitwiseShiftLeft_basiclong_64bit.phpt | 589 ++++++++++++++++++ .../bitwiseShiftLeft_variationStr.phpt | 419 +++++++++++++ .../bitwiseShiftLeft_variationStr2.phpt | 16 + .../bitwiseShiftLeft_variationStr_64bit.phpt | 423 +++++++++++++ .../bitwiseShiftRight_basiclong_64bit.phpt | 589 ++++++++++++++++++ .../bitwiseShiftRight_variationStr.phpt | 420 +++++++++++++ .../bitwiseShiftRight_variationStr2.phpt | 16 + .../operators/bitwiseXor_basiclong_64bit.phpt | 580 +++++++++++++++++ .../operators/bitwiseXor_variationStr.phpt | 414 ++++++++++++ tests/core/lang/operators/coalesce.phpt | 83 +++ .../operators/divide_basiclong_64bit.phpt | 585 +++++++++++++++++ .../lang/operators/divide_variationStr.phpt | 422 +++++++++++++ .../operators/modulus_basiclong_64bit.phpt | 589 ++++++++++++++++++ .../lang/operators/modulus_variationStr.phpt | 420 +++++++++++++ .../operators/multiply_basiclong_64bit.phpt | 580 +++++++++++++++++ .../lang/operators/multiply_variationStr.phpt | 419 +++++++++++++ .../lang/operators/nan-comparison-false.phpt | 29 + .../operators/negate_basiclong_64bit.phpt | 58 ++ .../lang/operators/negate_variationStr.phpt | 63 ++ .../lang/operators/operator_equals_basic.phpt | 63 ++ .../operators/operator_equals_variation.phpt | 61 ++ .../operator_equals_variation_64bit.phpt | 63 ++ .../lang/operators/operator_gt_basic.phpt | 63 ++ .../operators/operator_gt_or_equal_basic.phpt | 63 ++ .../operator_gt_or_equal_variation.phpt | 61 ++ .../operator_gt_or_equal_variation_64bit.phpt | 61 ++ .../lang/operators/operator_gt_variation.phpt | 56 ++ .../operator_gt_variation_64bit.phpt | 60 ++ .../operators/operator_identical_basic.phpt | 63 ++ .../operator_identical_recusion-01.phpt | 11 + .../operator_identical_variation.phpt | 61 ++ .../operator_identical_variation_64bit.phpt | 63 ++ .../lang/operators/operator_lt_basic.phpt | 60 ++ .../operators/operator_lt_or_equal_basic.phpt | 62 ++ .../operator_lt_or_equal_variation.phpt | 61 ++ .../operator_lt_or_equal_variation_64bit.phpt | 61 ++ .../lang/operators/operator_lt_variation.phpt | 54 ++ .../operator_lt_variation_64bit.phpt | 58 ++ .../operators/operator_notequals_basic.phpt | 63 ++ .../operator_notequals_variation.phpt | 61 ++ .../operator_notequals_variation_64bit.phpt | 63 ++ .../operator_notidentical_basic.phpt | 63 ++ .../operator_notidentical_variation.phpt | 62 ++ ...operator_notidentical_variation_64bit.phpt | 63 ++ .../operators/operator_spaceship_basic.phpt | 92 +++ .../operators/overloaded_property_ref.phpt | 23 + .../operators/postdec_basiclong_64bit.phpt | 59 ++ .../lang/operators/postdec_variationStr.phpt | 47 ++ .../operators/postinc_basiclong_64bit.phpt | 59 ++ .../lang/operators/postinc_variationStr.phpt | 47 ++ .../operators/predec_basiclong_64bit.phpt | 58 ++ .../lang/operators/predec_variationStr.phpt | 46 ++ .../operators/preinc_basiclong_64bit.phpt | 58 ++ .../lang/operators/preinc_variationStr.phpt | 65 ++ .../operators/subtract_basiclong_64bit.phpt | 580 +++++++++++++++++ .../lang/operators/subtract_variationStr.phpt | 419 +++++++++++++ 68 files changed, 12934 insertions(+), 8 deletions(-) create mode 100755 bin/opcode.php create mode 100644 tests/core/lang/operators/add_basiclong_64bit.phpt create mode 100644 tests/core/lang/operators/add_variationStr.phpt create mode 100644 tests/core/lang/operators/bitwiseAnd_basiclong_64bit.phpt create mode 100644 tests/core/lang/operators/bitwiseAnd_variationStr.phpt create mode 100644 tests/core/lang/operators/bitwiseNot_basiclong_64bit.phpt create mode 100644 tests/core/lang/operators/bitwiseNot_variationStr.phpt create mode 100644 tests/core/lang/operators/bitwiseOr_basiclong_64bit.phpt create mode 100644 tests/core/lang/operators/bitwiseOr_variationStr.phpt create mode 100644 tests/core/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt create mode 100644 tests/core/lang/operators/bitwiseShiftLeft_variationStr.phpt create mode 100644 tests/core/lang/operators/bitwiseShiftLeft_variationStr2.phpt create mode 100644 tests/core/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt create mode 100644 tests/core/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt create mode 100644 tests/core/lang/operators/bitwiseShiftRight_variationStr.phpt create mode 100644 tests/core/lang/operators/bitwiseShiftRight_variationStr2.phpt create mode 100644 tests/core/lang/operators/bitwiseXor_basiclong_64bit.phpt create mode 100644 tests/core/lang/operators/bitwiseXor_variationStr.phpt create mode 100644 tests/core/lang/operators/coalesce.phpt create mode 100644 tests/core/lang/operators/divide_basiclong_64bit.phpt create mode 100644 tests/core/lang/operators/divide_variationStr.phpt create mode 100644 tests/core/lang/operators/modulus_basiclong_64bit.phpt create mode 100644 tests/core/lang/operators/modulus_variationStr.phpt create mode 100644 tests/core/lang/operators/multiply_basiclong_64bit.phpt create mode 100644 tests/core/lang/operators/multiply_variationStr.phpt create mode 100644 tests/core/lang/operators/nan-comparison-false.phpt create mode 100644 tests/core/lang/operators/negate_basiclong_64bit.phpt create mode 100644 tests/core/lang/operators/negate_variationStr.phpt create mode 100644 tests/core/lang/operators/operator_equals_basic.phpt create mode 100644 tests/core/lang/operators/operator_equals_variation.phpt create mode 100644 tests/core/lang/operators/operator_equals_variation_64bit.phpt create mode 100644 tests/core/lang/operators/operator_gt_basic.phpt create mode 100644 tests/core/lang/operators/operator_gt_or_equal_basic.phpt create mode 100644 tests/core/lang/operators/operator_gt_or_equal_variation.phpt create mode 100644 tests/core/lang/operators/operator_gt_or_equal_variation_64bit.phpt create mode 100644 tests/core/lang/operators/operator_gt_variation.phpt create mode 100644 tests/core/lang/operators/operator_gt_variation_64bit.phpt create mode 100644 tests/core/lang/operators/operator_identical_basic.phpt create mode 100644 tests/core/lang/operators/operator_identical_recusion-01.phpt create mode 100644 tests/core/lang/operators/operator_identical_variation.phpt create mode 100644 tests/core/lang/operators/operator_identical_variation_64bit.phpt create mode 100644 tests/core/lang/operators/operator_lt_basic.phpt create mode 100644 tests/core/lang/operators/operator_lt_or_equal_basic.phpt create mode 100644 tests/core/lang/operators/operator_lt_or_equal_variation.phpt create mode 100644 tests/core/lang/operators/operator_lt_or_equal_variation_64bit.phpt create mode 100644 tests/core/lang/operators/operator_lt_variation.phpt create mode 100644 tests/core/lang/operators/operator_lt_variation_64bit.phpt create mode 100644 tests/core/lang/operators/operator_notequals_basic.phpt create mode 100644 tests/core/lang/operators/operator_notequals_variation.phpt create mode 100644 tests/core/lang/operators/operator_notequals_variation_64bit.phpt create mode 100644 tests/core/lang/operators/operator_notidentical_basic.phpt create mode 100644 tests/core/lang/operators/operator_notidentical_variation.phpt create mode 100644 tests/core/lang/operators/operator_notidentical_variation_64bit.phpt create mode 100644 tests/core/lang/operators/operator_spaceship_basic.phpt create mode 100644 tests/core/lang/operators/overloaded_property_ref.phpt create mode 100644 tests/core/lang/operators/postdec_basiclong_64bit.phpt create mode 100644 tests/core/lang/operators/postdec_variationStr.phpt create mode 100644 tests/core/lang/operators/postinc_basiclong_64bit.phpt create mode 100644 tests/core/lang/operators/postinc_variationStr.phpt create mode 100644 tests/core/lang/operators/predec_basiclong_64bit.phpt create mode 100644 tests/core/lang/operators/predec_variationStr.phpt create mode 100644 tests/core/lang/operators/preinc_basiclong_64bit.phpt create mode 100644 tests/core/lang/operators/preinc_variationStr.phpt create mode 100644 tests/core/lang/operators/subtract_basiclong_64bit.phpt create mode 100644 tests/core/lang/operators/subtract_variationStr.phpt diff --git a/bin/compiler.php b/bin/compiler.php index 9420de83..a0222beb 100755 --- a/bin/compiler.php +++ b/bin/compiler.php @@ -13,11 +13,11 @@ $translator = new Translator(ROOT_PATH); $translator->setIndent(' '); $code = $translator->convert($file); $info = pathinfo($file); -$cppFile = './tmp/' . $info['filename'] . '.cc'; +$cppFile = $info['dirname'] . '/' . $info['filename'] . '.cc'; $translator->save($code, $cppFile); $translator->compileFile($cppFile); -$objectFile = './tmp/' . $info['filename'] . '.cc.o'; +$objectFile = $info['dirname'] . '/' . $info['filename'] . '.cc.o'; if (!is_file($objectFile)) { throw new Exception("compile error"); } diff --git a/bin/opcode.php b/bin/opcode.php new file mode 100755 index 00000000..3910e434 --- /dev/null +++ b/bin/opcode.php @@ -0,0 +1,12 @@ +#!/usr/bin/env php +\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); \ No newline at end of file diff --git a/run-tests.php b/run-tests.php index 2d714ac6..8d082700 100755 --- a/run-tests.php +++ b/run-tests.php @@ -2624,6 +2624,10 @@ COMMAND $cmd if (!$cfg['keep']['php'] && !$leaked) { @unlink($test_file); @unlink($preload_filename); + // 刪除 AOT 编译器生成的 .cc 和 .o 文件 + $file = substr($test_file, 0, strlen($test_file) - 4); + @unlink($file . '.cc'); + @unlink($file . '.cc.o'); } @unlink($tmp_post); diff --git a/src/Php/Translator.php b/src/Php/Translator.php index 0826ea5d..a69f516f 100644 --- a/src/Php/Translator.php +++ b/src/Php/Translator.php @@ -40,6 +40,7 @@ class Translator extends \PhpAot\Core\Translator private array $headers = [ 'phpx.h', + 'phpx_func.h' ]; private array $internalFunctions = []; @@ -274,6 +275,8 @@ class Translator extends \PhpAot\Core\Translator private function parseStmts(array $stmts): string { $lines = []; + $scope = $this->scope; + foreach ($stmts as $v) { $class = $v->getType(); $this->beforeStmtLines = []; @@ -312,6 +315,9 @@ class Translator extends \PhpAot\Core\Translator case 'Stmt_Continue': $result = 'continue;'; break; + case 'Stmt_Nop': + $result = '// pass'; + break; case 'Stmt_Global': $result = $this->parseGlobal($v); break; @@ -330,6 +336,8 @@ class Translator extends \PhpAot\Core\Translator $lines[] = $result; } + // 恢复作用域,清除表达式解析中产生的局部变量 + $this->scope = $scope; $code = ''; foreach ($lines as $line) { $code .= $this->getIndent() . $line . PHP_EOL; @@ -355,6 +363,8 @@ class Translator extends \PhpAot\Core\Translator return $this->parseBinaryOpNotEqual($expr); case 'Expr_BinaryOp_Identical': return $this->parseBinaryOpIdentical($expr); + case 'Expr_BinaryOp_NotIdentical': + return $this->parseBinaryOpNotIdentical($expr); case 'Expr_BooleanNot': return $this->parseBooleanNot($expr); case 'Expr_BinaryOp_Plus': @@ -367,6 +377,8 @@ class Translator extends \PhpAot\Core\Translator return $this->parseBinaryOpSmallerOrEqual($expr); case 'Expr_BinaryOp_GreaterOrEqual': return $this->parseBinaryOpGreaterOrEqual($expr); + case 'Expr_BinaryOp_Spaceship': + return $this->parseBinaryOpSpaceship($expr); case 'Expr_PreInc': return $this->parsePreInc($expr); case 'Expr_PostInc': @@ -457,6 +469,8 @@ class Translator extends \PhpAot\Core\Translator return $this->parseConstFetch($expr); case 'Expr_UnaryMinus': return $this->parseUnaryMinus($expr); + case 'Expr_UnaryPlus': + return $this->parseUnaryPlus($expr); case 'InterpolatedStringPart': return $this->parseInterpolatedStringPart($expr); case 'Expr_Exit': @@ -522,7 +536,8 @@ class Translator extends \PhpAot\Core\Translator if (!$this->hasVar($var)) { $type = $this->detectExprType($right); $this->addVar($var, $type); - return $type . ' ' . $var . ' = ' . $expr; + // 右值变量可能是常量获取,虽然可以推断为数值类型,但实际返回依然为 Var ,需要强制转换 + return $type . ' ' . $var . ' = ' . $this->convertExprType($expr, $type, self::TYPE_VAR); } else { return $var . ' = ' . $this->convertExprType($expr, $this->detectExprType($left), $this->detectExprType($right)); } @@ -536,10 +551,38 @@ class Translator extends \PhpAot\Core\Translator return implode("\n" . $this->getIndent(), $lines); } + private function isFloatStr(string $str) + { + return filter_var($str, FILTER_VALIDATE_FLOAT); + } + + private function isIntStr(string $str) + { + return filter_var($str, FILTER_VALIDATE_INT); + } + + /** + * 尽可能转为数字,优先级 浮点 > 整数 > 字符串 + */ + private function parseNumericIdentifier($expr) + { + if ($expr->getType() === 'Scalar_String') { + if ($this->isFloatStr($expr->value)) { + return floatval($expr->value); + } else if ($this->isIntStr($expr->value)) { + return intval($expr->value); + } else if ($expr->value === '0') { + return 0; + } + } + return $this->parseIdentifier($expr); + } + private function parseBinaryOp($left, $right, $op): string { - $leftExpr = $this->parseIdentifier($left); - $rightExpr = $this->parseIdentifier($right); + // 运算逻辑,优先转为数字 + $leftExpr = $this->parseNumericIdentifier($left); + $rightExpr = $this->parseNumericIdentifier($right); $leftType = $this->detectExprType($left); $rightType = $this->detectExprType($right); @@ -648,6 +691,7 @@ class Translator extends \PhpAot\Core\Translator case 'Expr_ConstFetch': return $this->detectConstType($expr); case 'Scalar_String': + return self::TYPE_STR; default: break; } @@ -797,6 +841,7 @@ class Translator extends \PhpAot\Core\Translator $this->indentLevel--; $code .= $this->getIndent() . '}' . PHP_EOL; + return $code; } @@ -1093,6 +1138,18 @@ class Translator extends \PhpAot\Core\Translator return 'php::same(' . $left . ', ' . $right . ')'; } + private function parseBinaryOpSpaceship(mixed $expr): string + { + $left = $this->parseIdentifier($expr->left); + $right = $this->parseIdentifier($expr->right); + return 'php::compare(' . $left . ', ' . $right . ')'; + } + + private function parseBinaryOpNotIdentical(mixed $expr): string + { + return '!(' . $this->parseBinaryOpIdentical($expr) . ')'; + } + private function parseNew(Node $expr): string { $className = $this->parseIdentifier($expr->class); @@ -1164,13 +1221,17 @@ class Translator extends \PhpAot\Core\Translator return '(' . $code . ').toInt()'; } - private function parseConstFetch(Node $expr) + private function parseConstFetch(Node $expr): string { $name = $this->parseIdentifier($expr->name); if ($name === 'null') { return 'nullptr'; + } elseif ($name === 'true') { + return 'true'; + } elseif ($name === 'false') { + return 'false'; } - return $name; + return 'php::constant("' . $name . '")'; } private function parseUnaryMinus(Node $expr): string @@ -1179,6 +1240,11 @@ class Translator extends \PhpAot\Core\Translator return '-' . $code; } + private function parseUnaryPlus(mixed $expr) + { + return $this->parseExpr($expr->expr); + } + private function parseBinaryOpDiv(Node $expr): string { $left = $this->parseIdentifier($expr->left); @@ -1358,7 +1424,13 @@ class Translator extends \PhpAot\Core\Translator if ($name === 'true') { return self::TYPE_BOOL; } - return $name; + if ($name === 'false') { + return self::TYPE_BOOL; + } + if ($name === 'NAN' or $name === 'INF') { + return self::TYPE_FLOAT; + } + return self::TYPE_VAR; } private function parseSwitch(mixed $v): string diff --git a/tests/core/lang/operators/add_basiclong_64bit.phpt b/tests/core/lang/operators/add_basiclong_64bit.phpt new file mode 100644 index 00000000..b57bf930 --- /dev/null +++ b/tests/core/lang/operators/add_basiclong_64bit.phpt @@ -0,0 +1,580 @@ +--TEST-- +Test + operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +--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) diff --git a/tests/core/lang/operators/add_variationStr.phpt b/tests/core/lang/operators/add_variationStr.phpt new file mode 100644 index 00000000..04e29380 --- /dev/null +++ b/tests/core/lang/operators/add_variationStr.phpt @@ -0,0 +1,419 @@ +--TEST-- +Test + operator : various numbers as strings +--SKIPIF-- + +--FILE-- +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 diff --git a/tests/core/lang/operators/bitwiseAnd_basiclong_64bit.phpt b/tests/core/lang/operators/bitwiseAnd_basiclong_64bit.phpt new file mode 100644 index 00000000..887a002e --- /dev/null +++ b/tests/core/lang/operators/bitwiseAnd_basiclong_64bit.phpt @@ -0,0 +1,580 @@ +--TEST-- +Test & operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +--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) diff --git a/tests/core/lang/operators/bitwiseAnd_variationStr.phpt b/tests/core/lang/operators/bitwiseAnd_variationStr.phpt new file mode 100644 index 00000000..ed3d55f7 --- /dev/null +++ b/tests/core/lang/operators/bitwiseAnd_variationStr.phpt @@ -0,0 +1,414 @@ +--TEST-- +Test & operator : various numbers as strings +--FILE-- + +--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" diff --git a/tests/core/lang/operators/bitwiseNot_basiclong_64bit.phpt b/tests/core/lang/operators/bitwiseNot_basiclong_64bit.phpt new file mode 100644 index 00000000..5e921483 --- /dev/null +++ b/tests/core/lang/operators/bitwiseNot_basiclong_64bit.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test ~N operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +--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) diff --git a/tests/core/lang/operators/bitwiseNot_variationStr.phpt b/tests/core/lang/operators/bitwiseNot_variationStr.phpt new file mode 100644 index 00000000..53193901 --- /dev/null +++ b/tests/core/lang/operators/bitwiseNot_variationStr.phpt @@ -0,0 +1,46 @@ +--TEST-- +Test ~N operator : various numbers as strings +--FILE-- + +--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" diff --git a/tests/core/lang/operators/bitwiseOr_basiclong_64bit.phpt b/tests/core/lang/operators/bitwiseOr_basiclong_64bit.phpt new file mode 100644 index 00000000..a4f2d2f2 --- /dev/null +++ b/tests/core/lang/operators/bitwiseOr_basiclong_64bit.phpt @@ -0,0 +1,580 @@ +--TEST-- +Test | operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +--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) diff --git a/tests/core/lang/operators/bitwiseOr_variationStr.phpt b/tests/core/lang/operators/bitwiseOr_variationStr.phpt new file mode 100644 index 00000000..f11b8d8d --- /dev/null +++ b/tests/core/lang/operators/bitwiseOr_variationStr.phpt @@ -0,0 +1,414 @@ +--TEST-- +Test | operator : various numbers as strings +--FILE-- + +--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" diff --git a/tests/core/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt b/tests/core/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt new file mode 100644 index 00000000..9c1bd493 --- /dev/null +++ b/tests/core/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt @@ -0,0 +1,589 @@ +--TEST-- +Test << operator : 64bit long tests +--SKIPIF-- + + +--FILE-- +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 diff --git a/tests/core/lang/operators/bitwiseShiftLeft_variationStr.phpt b/tests/core/lang/operators/bitwiseShiftLeft_variationStr.phpt new file mode 100644 index 00000000..166d5d4e --- /dev/null +++ b/tests/core/lang/operators/bitwiseShiftLeft_variationStr.phpt @@ -0,0 +1,419 @@ +--TEST-- +Test << operator : various numbers as strings +--SKIPIF-- + +--FILE-- +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 diff --git a/tests/core/lang/operators/bitwiseShiftLeft_variationStr2.phpt b/tests/core/lang/operators/bitwiseShiftLeft_variationStr2.phpt new file mode 100644 index 00000000..904181e4 --- /dev/null +++ b/tests/core/lang/operators/bitwiseShiftLeft_variationStr2.phpt @@ -0,0 +1,16 @@ +--TEST-- +Test << operator : numbers as strings, simple +--FILE-- + +--EXPECT-- +int(12) +int(68) +int(224) diff --git a/tests/core/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt b/tests/core/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt new file mode 100644 index 00000000..07cfffb2 --- /dev/null +++ b/tests/core/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt @@ -0,0 +1,423 @@ +--TEST-- +Test << operator : various numbers as strings +--SKIPIF-- + + +--FILE-- +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 diff --git a/tests/core/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt b/tests/core/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt new file mode 100644 index 00000000..d6103917 --- /dev/null +++ b/tests/core/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt @@ -0,0 +1,589 @@ +--TEST-- +Test >> operator : 64bit long tests +--SKIPIF-- + + +--FILE-- +> $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 diff --git a/tests/core/lang/operators/bitwiseShiftRight_variationStr.phpt b/tests/core/lang/operators/bitwiseShiftRight_variationStr.phpt new file mode 100644 index 00000000..5c864c1b --- /dev/null +++ b/tests/core/lang/operators/bitwiseShiftRight_variationStr.phpt @@ -0,0 +1,420 @@ +--TEST-- +Test >> operator : various numbers as strings +--SKIPIF-- + +--FILE-- +> '$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 diff --git a/tests/core/lang/operators/bitwiseShiftRight_variationStr2.phpt b/tests/core/lang/operators/bitwiseShiftRight_variationStr2.phpt new file mode 100644 index 00000000..eaa905f2 --- /dev/null +++ b/tests/core/lang/operators/bitwiseShiftRight_variationStr2.phpt @@ -0,0 +1,16 @@ +--TEST-- +Test >> operator : numbers as strings, simple +--FILE-- +> "0"); +var_dump("34" >> "1"); +var_dump("56" >> "2"); + +?> +--EXPECT-- +int(12) +int(17) +int(14) diff --git a/tests/core/lang/operators/bitwiseXor_basiclong_64bit.phpt b/tests/core/lang/operators/bitwiseXor_basiclong_64bit.phpt new file mode 100644 index 00000000..b294741a --- /dev/null +++ b/tests/core/lang/operators/bitwiseXor_basiclong_64bit.phpt @@ -0,0 +1,580 @@ +--TEST-- +Test ^ operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +--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) diff --git a/tests/core/lang/operators/bitwiseXor_variationStr.phpt b/tests/core/lang/operators/bitwiseXor_variationStr.phpt new file mode 100644 index 00000000..5a74d124 --- /dev/null +++ b/tests/core/lang/operators/bitwiseXor_variationStr.phpt @@ -0,0 +1,414 @@ +--TEST-- +Test ^ operator : various numbers as strings +--FILE-- + +--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" diff --git a/tests/core/lang/operators/coalesce.phpt b/tests/core/lang/operators/coalesce.phpt new file mode 100644 index 00000000..4798f56a --- /dev/null +++ b/tests/core/lang/operators/coalesce.phpt @@ -0,0 +1,83 @@ +--TEST-- +Test ?? operator +--SKIPIF-- + +--FILE-- +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) diff --git a/tests/core/lang/operators/divide_basiclong_64bit.phpt b/tests/core/lang/operators/divide_basiclong_64bit.phpt new file mode 100644 index 00000000..65fcd7d4 --- /dev/null +++ b/tests/core/lang/operators/divide_basiclong_64bit.phpt @@ -0,0 +1,585 @@ +--TEST-- +Test / operator : 64bit long tests +--SKIPIF-- + + +--FILE-- +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) diff --git a/tests/core/lang/operators/divide_variationStr.phpt b/tests/core/lang/operators/divide_variationStr.phpt new file mode 100644 index 00000000..11b36a79 --- /dev/null +++ b/tests/core/lang/operators/divide_variationStr.phpt @@ -0,0 +1,422 @@ +--TEST-- +Test / operator : various numbers as strings +--SKIPIF-- + +--FILE-- +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 diff --git a/tests/core/lang/operators/modulus_basiclong_64bit.phpt b/tests/core/lang/operators/modulus_basiclong_64bit.phpt new file mode 100644 index 00000000..26fe2bdb --- /dev/null +++ b/tests/core/lang/operators/modulus_basiclong_64bit.phpt @@ -0,0 +1,589 @@ +--TEST-- +Test % operator : 64bit long tests +--SKIPIF-- + + +--FILE-- +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) diff --git a/tests/core/lang/operators/modulus_variationStr.phpt b/tests/core/lang/operators/modulus_variationStr.phpt new file mode 100644 index 00000000..1f79d90c --- /dev/null +++ b/tests/core/lang/operators/modulus_variationStr.phpt @@ -0,0 +1,420 @@ +--TEST-- +Test % operator : various numbers as strings +--SKIPIF-- + +--FILE-- +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 diff --git a/tests/core/lang/operators/multiply_basiclong_64bit.phpt b/tests/core/lang/operators/multiply_basiclong_64bit.phpt new file mode 100644 index 00000000..f8a11295 --- /dev/null +++ b/tests/core/lang/operators/multiply_basiclong_64bit.phpt @@ -0,0 +1,580 @@ +--TEST-- +Test * operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +--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) diff --git a/tests/core/lang/operators/multiply_variationStr.phpt b/tests/core/lang/operators/multiply_variationStr.phpt new file mode 100644 index 00000000..bd1c0bd4 --- /dev/null +++ b/tests/core/lang/operators/multiply_variationStr.phpt @@ -0,0 +1,419 @@ +--TEST-- +Test * operator : various numbers as strings +--SKIPIF-- + +--FILE-- +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 diff --git a/tests/core/lang/operators/nan-comparison-false.phpt b/tests/core/lang/operators/nan-comparison-false.phpt new file mode 100644 index 00000000..1bb1f7b2 --- /dev/null +++ b/tests/core/lang/operators/nan-comparison-false.phpt @@ -0,0 +1,29 @@ +--TEST-- +Comparisons with NAN should yield false, even at compile-time +--FILE-- + 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) diff --git a/tests/core/lang/operators/negate_basiclong_64bit.phpt b/tests/core/lang/operators/negate_basiclong_64bit.phpt new file mode 100644 index 00000000..fe690389 --- /dev/null +++ b/tests/core/lang/operators/negate_basiclong_64bit.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test -N operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +--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) diff --git a/tests/core/lang/operators/negate_variationStr.phpt b/tests/core/lang/operators/negate_variationStr.phpt new file mode 100644 index 00000000..6b219fb6 --- /dev/null +++ b/tests/core/lang/operators/negate_variationStr.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test -N operator : various numbers as strings +--SKIPIF-- + +--FILE-- +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 diff --git a/tests/core/lang/operators/operator_equals_basic.phpt b/tests/core/lang/operators/operator_equals_basic.phpt new file mode 100644 index 00000000..63ab1ac6 --- /dev/null +++ b/tests/core/lang/operators/operator_equals_basic.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test == operator : different types +--FILE-- + +--EXPECT-- +Test Passed diff --git a/tests/core/lang/operators/operator_equals_variation.phpt b/tests/core/lang/operators/operator_equals_variation.phpt new file mode 100644 index 00000000..65fe4a9a --- /dev/null +++ b/tests/core/lang/operators/operator_equals_variation.phpt @@ -0,0 +1,61 @@ +--TEST-- +Test == operator : max int 32bit range +--SKIPIF-- + +--FILE-- + +--EXPECT-- +Test Passed diff --git a/tests/core/lang/operators/operator_equals_variation_64bit.phpt b/tests/core/lang/operators/operator_equals_variation_64bit.phpt new file mode 100644 index 00000000..0d0298b6 --- /dev/null +++ b/tests/core/lang/operators/operator_equals_variation_64bit.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test == operator : max int 64bit range +--SKIPIF-- + +--FILE-- + +--EXPECT-- +Test Passed diff --git a/tests/core/lang/operators/operator_gt_basic.phpt b/tests/core/lang/operators/operator_gt_basic.phpt new file mode 100644 index 00000000..bb13bd95 --- /dev/null +++ b/tests/core/lang/operators/operator_gt_basic.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test > operator : different types +--FILE-- + 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 diff --git a/tests/core/lang/operators/operator_gt_or_equal_basic.phpt b/tests/core/lang/operators/operator_gt_or_equal_basic.phpt new file mode 100644 index 00000000..442e7216 --- /dev/null +++ b/tests/core/lang/operators/operator_gt_or_equal_basic.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test >= operator : different types +--FILE-- += $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 diff --git a/tests/core/lang/operators/operator_gt_or_equal_variation.phpt b/tests/core/lang/operators/operator_gt_or_equal_variation.phpt new file mode 100644 index 00000000..eb0bd91b --- /dev/null +++ b/tests/core/lang/operators/operator_gt_or_equal_variation.phpt @@ -0,0 +1,61 @@ +--TEST-- +Test >= operator : max int 32bit range +--SKIPIF-- + +--FILE-- += $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 diff --git a/tests/core/lang/operators/operator_gt_or_equal_variation_64bit.phpt b/tests/core/lang/operators/operator_gt_or_equal_variation_64bit.phpt new file mode 100644 index 00000000..cdeb72c3 --- /dev/null +++ b/tests/core/lang/operators/operator_gt_or_equal_variation_64bit.phpt @@ -0,0 +1,61 @@ +--TEST-- +Test >= operator : max int 64bit range +--SKIPIF-- + +--FILE-- += $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 diff --git a/tests/core/lang/operators/operator_gt_variation.phpt b/tests/core/lang/operators/operator_gt_variation.phpt new file mode 100644 index 00000000..9c85b184 --- /dev/null +++ b/tests/core/lang/operators/operator_gt_variation.phpt @@ -0,0 +1,56 @@ +--TEST-- +Test > operator : max int 32bit range +--FILE-- + $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 diff --git a/tests/core/lang/operators/operator_gt_variation_64bit.phpt b/tests/core/lang/operators/operator_gt_variation_64bit.phpt new file mode 100644 index 00000000..fb3947f3 --- /dev/null +++ b/tests/core/lang/operators/operator_gt_variation_64bit.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test > operator : max int 64bit range +--SKIPIF-- + +--FILE-- + $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 diff --git a/tests/core/lang/operators/operator_identical_basic.phpt b/tests/core/lang/operators/operator_identical_basic.phpt new file mode 100644 index 00000000..8f566523 --- /dev/null +++ b/tests/core/lang/operators/operator_identical_basic.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test === operator : different types +--FILE-- + +--EXPECT-- +Test Passed diff --git a/tests/core/lang/operators/operator_identical_recusion-01.phpt b/tests/core/lang/operators/operator_identical_recusion-01.phpt new file mode 100644 index 00000000..4828c2a3 --- /dev/null +++ b/tests/core/lang/operators/operator_identical_recusion-01.phpt @@ -0,0 +1,11 @@ +--TEST-- +Test === operator : False recursion detection +--FILE-- + +--EXPECT-- +bool(false) diff --git a/tests/core/lang/operators/operator_identical_variation.phpt b/tests/core/lang/operators/operator_identical_variation.phpt new file mode 100644 index 00000000..0bc3329f --- /dev/null +++ b/tests/core/lang/operators/operator_identical_variation.phpt @@ -0,0 +1,61 @@ +--TEST-- +Test === operator : max int 32bit range +--SKIPIF-- + +--FILE-- + +--EXPECT-- +Test Passed diff --git a/tests/core/lang/operators/operator_identical_variation_64bit.phpt b/tests/core/lang/operators/operator_identical_variation_64bit.phpt new file mode 100644 index 00000000..13dd3e84 --- /dev/null +++ b/tests/core/lang/operators/operator_identical_variation_64bit.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test === operator : max int 64bit range +--SKIPIF-- + +--FILE-- + +--EXPECT-- +Test Passed diff --git a/tests/core/lang/operators/operator_lt_basic.phpt b/tests/core/lang/operators/operator_lt_basic.phpt new file mode 100644 index 00000000..e3fedddf --- /dev/null +++ b/tests/core/lang/operators/operator_lt_basic.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test < operator : different types +--FILE-- += '$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 diff --git a/tests/core/lang/operators/operator_lt_or_equal_basic.phpt b/tests/core/lang/operators/operator_lt_or_equal_basic.phpt new file mode 100644 index 00000000..bc8b1f31 --- /dev/null +++ b/tests/core/lang/operators/operator_lt_or_equal_basic.phpt @@ -0,0 +1,62 @@ +--TEST-- +Test <= operator : different types +--FILE-- + '$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 diff --git a/tests/core/lang/operators/operator_lt_or_equal_variation.phpt b/tests/core/lang/operators/operator_lt_or_equal_variation.phpt new file mode 100644 index 00000000..27d45142 --- /dev/null +++ b/tests/core/lang/operators/operator_lt_or_equal_variation.phpt @@ -0,0 +1,61 @@ +--TEST-- +Test <= operator : max int 32bit range +--SKIPIF-- + +--FILE-- + '$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 diff --git a/tests/core/lang/operators/operator_lt_or_equal_variation_64bit.phpt b/tests/core/lang/operators/operator_lt_or_equal_variation_64bit.phpt new file mode 100644 index 00000000..8ca4e823 --- /dev/null +++ b/tests/core/lang/operators/operator_lt_or_equal_variation_64bit.phpt @@ -0,0 +1,61 @@ +--TEST-- +Test <= operator : max int 64bit range +--SKIPIF-- + +--FILE-- + '$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 diff --git a/tests/core/lang/operators/operator_lt_variation.phpt b/tests/core/lang/operators/operator_lt_variation.phpt new file mode 100644 index 00000000..a4886c25 --- /dev/null +++ b/tests/core/lang/operators/operator_lt_variation.phpt @@ -0,0 +1,54 @@ +--TEST-- +Test < operator : max int 32bit range +--FILE-- += '$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 diff --git a/tests/core/lang/operators/operator_lt_variation_64bit.phpt b/tests/core/lang/operators/operator_lt_variation_64bit.phpt new file mode 100644 index 00000000..84156669 --- /dev/null +++ b/tests/core/lang/operators/operator_lt_variation_64bit.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test < operator : max int 64bit range +--SKIPIF-- + +--FILE-- += '$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 diff --git a/tests/core/lang/operators/operator_notequals_basic.phpt b/tests/core/lang/operators/operator_notequals_basic.phpt new file mode 100644 index 00000000..156c60d6 --- /dev/null +++ b/tests/core/lang/operators/operator_notequals_basic.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test != operator : different types +--FILE-- + $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 diff --git a/tests/core/lang/operators/operator_notequals_variation.phpt b/tests/core/lang/operators/operator_notequals_variation.phpt new file mode 100644 index 00000000..a6eea670 --- /dev/null +++ b/tests/core/lang/operators/operator_notequals_variation.phpt @@ -0,0 +1,61 @@ +--TEST-- +Test != operator : max int 32bit range +--SKIPIF-- + +--FILE-- + +--EXPECT-- +Test Passed diff --git a/tests/core/lang/operators/operator_notequals_variation_64bit.phpt b/tests/core/lang/operators/operator_notequals_variation_64bit.phpt new file mode 100644 index 00000000..7a73521f --- /dev/null +++ b/tests/core/lang/operators/operator_notequals_variation_64bit.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test == operator : max int 64bit range +--SKIPIF-- + +--FILE-- + $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 diff --git a/tests/core/lang/operators/operator_notidentical_basic.phpt b/tests/core/lang/operators/operator_notidentical_basic.phpt new file mode 100644 index 00000000..79c4ad77 --- /dev/null +++ b/tests/core/lang/operators/operator_notidentical_basic.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test !== operator : different types +--FILE-- + +--EXPECT-- +Test Passed diff --git a/tests/core/lang/operators/operator_notidentical_variation.phpt b/tests/core/lang/operators/operator_notidentical_variation.phpt new file mode 100644 index 00000000..09d492be --- /dev/null +++ b/tests/core/lang/operators/operator_notidentical_variation.phpt @@ -0,0 +1,62 @@ +--TEST-- +Test !== operator : max int 32bit range +--SKIPIF-- + +--FILE-- + +--EXPECT-- +Test Passed diff --git a/tests/core/lang/operators/operator_notidentical_variation_64bit.phpt b/tests/core/lang/operators/operator_notidentical_variation_64bit.phpt new file mode 100644 index 00000000..03dfa1fc --- /dev/null +++ b/tests/core/lang/operators/operator_notidentical_variation_64bit.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test !== operator : max int 64bit range +--SKIPIF-- + +--FILE-- + +--EXPECT-- +Test Passed diff --git a/tests/core/lang/operators/operator_spaceship_basic.phpt b/tests/core/lang/operators/operator_spaceship_basic.phpt new file mode 100644 index 00000000..f74201bc --- /dev/null +++ b/tests/core/lang/operators/operator_spaceship_basic.phpt @@ -0,0 +1,92 @@ +--TEST-- +Test <=> operator : different types +--FILE-- + 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 diff --git a/tests/core/lang/operators/overloaded_property_ref.phpt b/tests/core/lang/operators/overloaded_property_ref.phpt new file mode 100644 index 00000000..bac31075 --- /dev/null +++ b/tests/core/lang/operators/overloaded_property_ref.phpt @@ -0,0 +1,23 @@ +--TEST-- +Operators on overloaded property reference +--SKIPIF-- + +--FILE-- +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) diff --git a/tests/core/lang/operators/postdec_basiclong_64bit.phpt b/tests/core/lang/operators/postdec_basiclong_64bit.phpt new file mode 100644 index 00000000..31ca746d --- /dev/null +++ b/tests/core/lang/operators/postdec_basiclong_64bit.phpt @@ -0,0 +1,59 @@ +--TEST-- +Test N-- operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +--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) diff --git a/tests/core/lang/operators/postdec_variationStr.phpt b/tests/core/lang/operators/postdec_variationStr.phpt new file mode 100644 index 00000000..fd710330 --- /dev/null +++ b/tests/core/lang/operators/postdec_variationStr.phpt @@ -0,0 +1,47 @@ +--TEST-- +Test N-- operator : various numbers as strings +--FILE-- + +--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" diff --git a/tests/core/lang/operators/postinc_basiclong_64bit.phpt b/tests/core/lang/operators/postinc_basiclong_64bit.phpt new file mode 100644 index 00000000..dbdb1850 --- /dev/null +++ b/tests/core/lang/operators/postinc_basiclong_64bit.phpt @@ -0,0 +1,59 @@ +--TEST-- +Test N++ operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +--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) diff --git a/tests/core/lang/operators/postinc_variationStr.phpt b/tests/core/lang/operators/postinc_variationStr.phpt new file mode 100644 index 00000000..4f4be3f3 --- /dev/null +++ b/tests/core/lang/operators/postinc_variationStr.phpt @@ -0,0 +1,47 @@ +--TEST-- +Test N++ operator : various numbers as strings +--FILE-- + +--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" diff --git a/tests/core/lang/operators/predec_basiclong_64bit.phpt b/tests/core/lang/operators/predec_basiclong_64bit.phpt new file mode 100644 index 00000000..72227ec6 --- /dev/null +++ b/tests/core/lang/operators/predec_basiclong_64bit.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test --N operator : 64bit long tests +--SKIPIF-- + +--FILE-- +$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) diff --git a/tests/core/lang/operators/predec_variationStr.phpt b/tests/core/lang/operators/predec_variationStr.phpt new file mode 100644 index 00000000..5122eb9e --- /dev/null +++ b/tests/core/lang/operators/predec_variationStr.phpt @@ -0,0 +1,46 @@ +--TEST-- +Test --N operator : various numbers as strings +--FILE-- + +--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" diff --git a/tests/core/lang/operators/preinc_basiclong_64bit.phpt b/tests/core/lang/operators/preinc_basiclong_64bit.phpt new file mode 100644 index 00000000..fb203777 --- /dev/null +++ b/tests/core/lang/operators/preinc_basiclong_64bit.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test ++N operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +--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) diff --git a/tests/core/lang/operators/preinc_variationStr.phpt b/tests/core/lang/operators/preinc_variationStr.phpt new file mode 100644 index 00000000..a6b34c5b --- /dev/null +++ b/tests/core/lang/operators/preinc_variationStr.phpt @@ -0,0 +1,65 @@ +--TEST-- +Test ++N operator : various numbers as strings +--FILE-- + +--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" diff --git a/tests/core/lang/operators/subtract_basiclong_64bit.phpt b/tests/core/lang/operators/subtract_basiclong_64bit.phpt new file mode 100644 index 00000000..ee4af120 --- /dev/null +++ b/tests/core/lang/operators/subtract_basiclong_64bit.phpt @@ -0,0 +1,580 @@ +--TEST-- +Test - operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +--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) diff --git a/tests/core/lang/operators/subtract_variationStr.phpt b/tests/core/lang/operators/subtract_variationStr.phpt new file mode 100644 index 00000000..dc1fddef --- /dev/null +++ b/tests/core/lang/operators/subtract_variationStr.phpt @@ -0,0 +1,419 @@ +--TEST-- +Test - operator : various numbers as strings +--SKIPIF-- + +--FILE-- +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