mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fixed weird operators behavior. Division by zero now emits warning and returns +/-INF, modulo by zero and intdid() throws an exception, shifts by negative offset throw exceptions. Compile-time evaluation of division by zero is disabled.
This commit is contained in:
parent
caf9219dea
commit
cae0147ed3
19 changed files with 585 additions and 522 deletions
4
NEWS
4
NEWS
|
@ -8,6 +8,10 @@
|
|||
. Update the MIME type list from the one shipped by Apache HTTPD. (Adam)
|
||||
|
||||
- Core:
|
||||
. Fixed weird operators behavior. Division by zero now emits warning and
|
||||
returns +/-INF, modulo by zero and intdid() throws an exception, shifts
|
||||
by negative offset throw exceptions. Compile-time evaluation of division
|
||||
by zero is disabled. (Dmitry, Andrea, Nikita)
|
||||
. Fixed bug #69371 (Hash table collision leads to inaccessible array keys).
|
||||
(Laruence)
|
||||
. Fixed bug #68933 (Invalid read of size 8 in zend_std_read_property).
|
||||
|
|
|
@ -8,20 +8,32 @@ $n <<= $n;
|
|||
var_dump($n);
|
||||
|
||||
$n = "-1";
|
||||
$n <<= $n;
|
||||
var_dump($n);
|
||||
try {
|
||||
$n <<= $n;
|
||||
var_dump($n);
|
||||
} catch (Exception $e) {
|
||||
echo "\nException: " . $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
$n = "65";
|
||||
$n >>= $n;
|
||||
var_dump($n);
|
||||
|
||||
$n = "-1";
|
||||
$n >>= $n;
|
||||
var_dump($n);
|
||||
try {
|
||||
$n >>= $n;
|
||||
var_dump($n);
|
||||
} catch (Exception $e) {
|
||||
echo "\nException: " . $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
$n = "0";
|
||||
$n %= $n;
|
||||
var_dump($n);
|
||||
try{
|
||||
$n %= $n;
|
||||
var_dump($n);
|
||||
} catch (Exception $e) {
|
||||
echo "\nException: " . $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
$n = "-1";
|
||||
$n %= $n;
|
||||
|
@ -29,13 +41,10 @@ var_dump($n);
|
|||
--EXPECTF--
|
||||
int(0)
|
||||
|
||||
Warning: Bit shift by negative number in %s on line %d
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
int(0)
|
||||
|
||||
Warning: Bit shift by negative number in %s on line %d
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
|
||||
Warning: Division by zero in %s on line %d
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
int(0)
|
||||
|
|
|
@ -6,12 +6,15 @@ modulus by zero
|
|||
$a = array(1,2,3);
|
||||
$b = array();
|
||||
|
||||
$c = $a % $b;
|
||||
var_dump($c);
|
||||
try {
|
||||
$c = $a % $b;
|
||||
var_dump($c);
|
||||
} catch (Exception $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Division by zero in %s on line %d
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
Done
|
||||
|
|
|
@ -5538,12 +5538,30 @@ void zend_compile_binary_op(znode *result, zend_ast *ast) /* {{{ */
|
|||
zend_compile_expr(&right_node, right_ast);
|
||||
|
||||
if (left_node.op_type == IS_CONST && right_node.op_type == IS_CONST) {
|
||||
result->op_type = IS_CONST;
|
||||
zend_ct_eval_binary_op(&result->u.constant, opcode,
|
||||
&left_node.u.constant, &right_node.u.constant);
|
||||
zval_ptr_dtor(&left_node.u.constant);
|
||||
zval_ptr_dtor(&right_node.u.constant);
|
||||
return;
|
||||
do {
|
||||
/* don't evaluate divsion by zero at compile-time */
|
||||
if (opcode == ZEND_DIV) {
|
||||
zval *op2 = &right_node.u.constant;
|
||||
|
||||
convert_scalar_to_number(op2);
|
||||
if (Z_TYPE_P(op2) == IS_LONG) {
|
||||
if (Z_LVAL_P(op2) == 0) {
|
||||
break;
|
||||
}
|
||||
} else if (Z_TYPE_P(op2) == IS_DOUBLE) {
|
||||
if (Z_DVAL_P(op2) == 0.0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
result->op_type = IS_CONST;
|
||||
zend_ct_eval_binary_op(&result->u.constant, opcode,
|
||||
&left_node.u.constant, &right_node.u.constant);
|
||||
zval_ptr_dtor(&left_node.u.constant);
|
||||
zval_ptr_dtor(&right_node.u.constant);
|
||||
return;
|
||||
} while (0);
|
||||
}
|
||||
|
||||
do {
|
||||
|
@ -6937,6 +6955,22 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
|
|||
return;
|
||||
}
|
||||
|
||||
/* don't evaluate divsion by zero at compile-time */
|
||||
if (ast->attr == ZEND_DIV) {
|
||||
zval *op2 = zend_ast_get_zval(ast->child[1]);
|
||||
|
||||
convert_scalar_to_number(op2);
|
||||
if (Z_TYPE_P(op2) == IS_LONG) {
|
||||
if (Z_LVAL_P(op2) == 0) {
|
||||
return;
|
||||
}
|
||||
} else if (Z_TYPE_P(op2) == IS_DOUBLE) {
|
||||
if (Z_DVAL_P(op2) == 0.0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
zend_ct_eval_binary_op(&result, ast->attr,
|
||||
zend_ast_get_zval(ast->child[0]), zend_ast_get_zval(ast->child[1]));
|
||||
break;
|
||||
|
|
|
@ -1064,6 +1064,22 @@ ZEND_API int ZEND_FASTCALL pow_function(zval *result, zval *op1, zval *op2) /* {
|
|||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_always_inline void make_inf(zval *result, int neg) /* {{{ */
|
||||
{
|
||||
#if HAVE_HUGE_VAL_INF
|
||||
ZVAL_DOUBLE(result, neg ? -HUGE_VAL : HUGE_VAL);
|
||||
#elif defined(__i386__) || defined(_X86_) || defined(ALPHA) || defined(_ALPHA) || defined(__alpha)
|
||||
result->value.ww.w1 = neg ? 0xfff00000 : 0x7ff00000;
|
||||
result->value.ww.w2 = 0
|
||||
Z_TYPE_INFO_P(result) = IS_DOUBLE;
|
||||
#elif HAVE_ATOF_ACCEPTS_INF
|
||||
ZVAL_DOUBLE(neg ? aatof("-INF") : tof("INF"));
|
||||
#else
|
||||
ZVAL_DOUBLE(result, neg ? (-1.0/0.0) : (1.0/0.0));
|
||||
#endif
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int ZEND_FASTCALL div_function(zval *result, zval *op1, zval *op2) /* {{{ */
|
||||
{
|
||||
zval op1_copy, op2_copy;
|
||||
|
@ -1074,8 +1090,8 @@ ZEND_API int ZEND_FASTCALL div_function(zval *result, zval *op1, zval *op2) /* {
|
|||
case TYPE_PAIR(IS_LONG, IS_LONG):
|
||||
if (Z_LVAL_P(op2) == 0) {
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_FALSE(result);
|
||||
return FAILURE; /* division by zero */
|
||||
make_inf(result, Z_LVAL_P(op1) < 0);
|
||||
return SUCCESS;
|
||||
} else if (Z_LVAL_P(op2) == -1 && Z_LVAL_P(op1) == ZEND_LONG_MIN) {
|
||||
/* Prevent overflow error/crash */
|
||||
ZVAL_DOUBLE(result, (double) ZEND_LONG_MIN / -1);
|
||||
|
@ -1091,8 +1107,8 @@ ZEND_API int ZEND_FASTCALL div_function(zval *result, zval *op1, zval *op2) /* {
|
|||
case TYPE_PAIR(IS_DOUBLE, IS_LONG):
|
||||
if (Z_LVAL_P(op2) == 0) {
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_FALSE(result);
|
||||
return FAILURE; /* division by zero */
|
||||
make_inf(result, Z_DVAL_P(op1) < 0.0);
|
||||
return SUCCESS;
|
||||
}
|
||||
ZVAL_DOUBLE(result, Z_DVAL_P(op1) / (double)Z_LVAL_P(op2));
|
||||
return SUCCESS;
|
||||
|
@ -1100,8 +1116,8 @@ ZEND_API int ZEND_FASTCALL div_function(zval *result, zval *op1, zval *op2) /* {
|
|||
case TYPE_PAIR(IS_LONG, IS_DOUBLE):
|
||||
if (Z_DVAL_P(op2) == 0) {
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_FALSE(result);
|
||||
return FAILURE; /* division by zero */
|
||||
make_inf(result, Z_LVAL_P(op1) < 0);
|
||||
return SUCCESS;
|
||||
}
|
||||
ZVAL_DOUBLE(result, (double)Z_LVAL_P(op1) / Z_DVAL_P(op2));
|
||||
return SUCCESS;
|
||||
|
@ -1109,8 +1125,8 @@ ZEND_API int ZEND_FASTCALL div_function(zval *result, zval *op1, zval *op2) /* {
|
|||
case TYPE_PAIR(IS_DOUBLE, IS_DOUBLE):
|
||||
if (Z_DVAL_P(op2) == 0) {
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_FALSE(result);
|
||||
return FAILURE; /* division by zero */
|
||||
make_inf(result, Z_LVAL_P(op1) < 0.0);
|
||||
return SUCCESS;
|
||||
}
|
||||
ZVAL_DOUBLE(result, Z_DVAL_P(op1) / Z_DVAL_P(op2));
|
||||
return SUCCESS;
|
||||
|
@ -1146,9 +1162,13 @@ ZEND_API int ZEND_FASTCALL mod_function(zval *result, zval *op1, zval *op2) /* {
|
|||
}
|
||||
|
||||
if (op2_lval == 0) {
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_FALSE(result);
|
||||
return FAILURE; /* modulus by zero */
|
||||
/* modulus by zero */
|
||||
if (EG(current_execute_data) && !CG(in_compilation)) {
|
||||
zend_throw_exception_ex(NULL, 0, "Division by zero");
|
||||
} else {
|
||||
zend_error_noreturn(E_ERROR, "Division by zero");
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (op2_lval == -1) {
|
||||
|
@ -1459,8 +1479,11 @@ ZEND_API int ZEND_FASTCALL shift_left_function(zval *result, zval *op1, zval *op
|
|||
ZVAL_LONG(result, 0);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
zend_error(E_WARNING, "Bit shift by negative number");
|
||||
ZVAL_FALSE(result);
|
||||
if (EG(current_execute_data) && !CG(in_compilation)) {
|
||||
zend_throw_exception_ex(NULL, 0, "Bit shift by negative number");
|
||||
} else {
|
||||
zend_error_noreturn(E_ERROR, "Bit shift by negative number");
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
@ -1486,8 +1509,11 @@ ZEND_API int ZEND_FASTCALL shift_right_function(zval *result, zval *op1, zval *o
|
|||
ZVAL_LONG(result, (op1_lval < 0) ? -1 : 0);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
zend_error(E_WARNING, "Bit shift by negative number");
|
||||
ZVAL_FALSE(result);
|
||||
if (EG(current_execute_data) && !CG(in_compilation)) {
|
||||
zend_throw_exception_ex(NULL, 0, "Bit shift by negative number");
|
||||
} else {
|
||||
zend_error_noreturn(E_ERROR, "Bit shift by negative number");
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -775,52 +775,6 @@ static zend_always_inline void fast_long_sub_function(zval *result, zval *op1, z
|
|||
|
||||
static zend_always_inline int fast_div_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
#if 0
|
||||
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && 0) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_BOOL(result, 0);
|
||||
return FAILURE;
|
||||
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1 && Z_LVAL_P(op1) == ZEND_LONG_MIN)) {
|
||||
/* Prevent overflow error/crash */
|
||||
ZVAL_DOUBLE(result, (double) ZEND_LONG_MIN / -1);
|
||||
} else if (EXPECTED(Z_LVAL_P(op1) % Z_LVAL_P(op2) == 0)) {
|
||||
/* integer */
|
||||
ZVAL_LONG(result, Z_LVAL_P(op1) / Z_LVAL_P(op2));
|
||||
} else {
|
||||
ZVAL_DOUBLE(result, ((double) Z_LVAL_P(op1)) / ((double)Z_LVAL_P(op2)));
|
||||
}
|
||||
return SUCCESS;
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
|
||||
if (UNEXPECTED(Z_DVAL_P(op2) == 0)) {
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_BOOL(result, 0);
|
||||
return FAILURE;
|
||||
}
|
||||
ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) / Z_DVAL_P(op2));
|
||||
return SUCCESS;
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE) && 0) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
|
||||
if (UNEXPECTED(Z_DVAL_P(op2) == 0)) {
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_BOOL(result, 0);
|
||||
return FAILURE;
|
||||
}
|
||||
ZVAL_DOUBLE(result, Z_DVAL_P(op1) / Z_DVAL_P(op2));
|
||||
return SUCCESS;
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_BOOL(result, 0);
|
||||
return FAILURE;
|
||||
}
|
||||
ZVAL_DOUBLE(result, Z_DVAL_P(op1) / ((double)Z_LVAL_P(op2)));
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return div_function(result, op1, op2);
|
||||
}
|
||||
|
||||
|
|
|
@ -187,10 +187,9 @@ ZEND_VM_HANDLER(5, ZEND_MOD, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
|
|||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
result = EX_VAR(opline->result.var);
|
||||
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
|
||||
// TODO: change into exception ???
|
||||
SAVE_OPLINE();
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_FALSE(result);
|
||||
zend_throw_exception_ex(NULL, 0, "Division by zero");
|
||||
HANDLE_EXCEPTION();
|
||||
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
|
||||
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
|
||||
ZVAL_LONG(result, 0);
|
||||
|
|
|
@ -4074,10 +4074,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CONST_CONST_HANDLER(Z
|
|||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
result = EX_VAR(opline->result.var);
|
||||
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
|
||||
// TODO: change into exception ???
|
||||
SAVE_OPLINE();
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_FALSE(result);
|
||||
zend_throw_exception_ex(NULL, 0, "Division by zero");
|
||||
HANDLE_EXCEPTION();
|
||||
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
|
||||
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
|
||||
ZVAL_LONG(result, 0);
|
||||
|
@ -7764,10 +7763,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CONST_CV_HANDLER(ZEND
|
|||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
result = EX_VAR(opline->result.var);
|
||||
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
|
||||
// TODO: change into exception ???
|
||||
SAVE_OPLINE();
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_FALSE(result);
|
||||
zend_throw_exception_ex(NULL, 0, "Division by zero");
|
||||
HANDLE_EXCEPTION();
|
||||
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
|
||||
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
|
||||
ZVAL_LONG(result, 0);
|
||||
|
@ -9383,10 +9381,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CONST_TMPVAR_HANDLER(
|
|||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
result = EX_VAR(opline->result.var);
|
||||
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
|
||||
// TODO: change into exception ???
|
||||
SAVE_OPLINE();
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_FALSE(result);
|
||||
zend_throw_exception_ex(NULL, 0, "Division by zero");
|
||||
HANDLE_EXCEPTION();
|
||||
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
|
||||
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
|
||||
ZVAL_LONG(result, 0);
|
||||
|
@ -28579,10 +28576,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CV_CONST_HANDLER(ZEND
|
|||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
result = EX_VAR(opline->result.var);
|
||||
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
|
||||
// TODO: change into exception ???
|
||||
SAVE_OPLINE();
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_FALSE(result);
|
||||
zend_throw_exception_ex(NULL, 0, "Division by zero");
|
||||
HANDLE_EXCEPTION();
|
||||
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
|
||||
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
|
||||
ZVAL_LONG(result, 0);
|
||||
|
@ -33709,10 +33705,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CV_CV_HANDLER(ZEND_OP
|
|||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
result = EX_VAR(opline->result.var);
|
||||
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
|
||||
// TODO: change into exception ???
|
||||
SAVE_OPLINE();
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_FALSE(result);
|
||||
zend_throw_exception_ex(NULL, 0, "Division by zero");
|
||||
HANDLE_EXCEPTION();
|
||||
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
|
||||
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
|
||||
ZVAL_LONG(result, 0);
|
||||
|
@ -36356,10 +36351,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CV_TMPVAR_HANDLER(ZEN
|
|||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
result = EX_VAR(opline->result.var);
|
||||
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
|
||||
// TODO: change into exception ???
|
||||
SAVE_OPLINE();
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_FALSE(result);
|
||||
zend_throw_exception_ex(NULL, 0, "Division by zero");
|
||||
HANDLE_EXCEPTION();
|
||||
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
|
||||
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
|
||||
ZVAL_LONG(result, 0);
|
||||
|
@ -39312,10 +39306,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_TMPVAR_CONST_HANDLER(
|
|||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
result = EX_VAR(opline->result.var);
|
||||
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
|
||||
// TODO: change into exception ???
|
||||
SAVE_OPLINE();
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_FALSE(result);
|
||||
zend_throw_exception_ex(NULL, 0, "Division by zero");
|
||||
HANDLE_EXCEPTION();
|
||||
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
|
||||
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
|
||||
ZVAL_LONG(result, 0);
|
||||
|
@ -41553,10 +41546,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_TMPVAR_CV_HANDLER(ZEN
|
|||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
result = EX_VAR(opline->result.var);
|
||||
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
|
||||
// TODO: change into exception ???
|
||||
SAVE_OPLINE();
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_FALSE(result);
|
||||
zend_throw_exception_ex(NULL, 0, "Division by zero");
|
||||
HANDLE_EXCEPTION();
|
||||
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
|
||||
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
|
||||
ZVAL_LONG(result, 0);
|
||||
|
@ -42571,10 +42563,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_TMPVAR_TMPVAR_HANDLER
|
|||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
result = EX_VAR(opline->result.var);
|
||||
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
|
||||
// TODO: change into exception ???
|
||||
SAVE_OPLINE();
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
ZVAL_FALSE(result);
|
||||
zend_throw_exception_ex(NULL, 0, "Division by zero");
|
||||
HANDLE_EXCEPTION();
|
||||
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
|
||||
/* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
|
||||
ZVAL_LONG(result, 0);
|
||||
|
|
|
@ -1452,8 +1452,8 @@ PHP_FUNCTION(intdiv)
|
|||
}
|
||||
|
||||
if (divisor == 0) {
|
||||
php_error_docref(NULL, E_WARNING, "Division by zero");
|
||||
RETURN_BOOL(0);
|
||||
zend_throw_exception_ex(NULL, 0, "Division by zero");
|
||||
return;
|
||||
} else if (divisor == -1 && numerator == ZEND_LONG_MIN) {
|
||||
/* Prevent overflow error/crash
|
||||
We don't return a float here as that violates function contract */
|
||||
|
|
|
@ -9,7 +9,11 @@ var_dump(intdiv(-3, -2));
|
|||
var_dump(intdiv(PHP_INT_MAX, PHP_INT_MAX));
|
||||
var_dump(intdiv(-PHP_INT_MAX - 1, -PHP_INT_MAX - 1));
|
||||
var_dump(intdiv(-PHP_INT_MAX - 1, -1));
|
||||
var_dump(intdiv(1, 0));
|
||||
try {
|
||||
var_dump(intdiv(1, 0));
|
||||
} catch (Exception $e) {
|
||||
echo "\nException: " . $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
@ -21,5 +25,4 @@ int(1)
|
|||
int(1)
|
||||
int(0)
|
||||
|
||||
Warning: intdiv(): Division by zero in %s on line 9
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
|
|
|
@ -24,15 +24,23 @@ error_reporting(E_ERROR);
|
|||
|
||||
foreach ($longVals as $longVal) {
|
||||
foreach($otherVals as $otherVal) {
|
||||
echo "--- testing: $longVal << $otherVal ---\n";
|
||||
var_dump($longVal<<$otherVal);
|
||||
echo "--- testing: $longVal << $otherVal ---\n";
|
||||
try {
|
||||
var_dump($longVal<<$otherVal);
|
||||
} catch (Exception $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($otherVals as $otherVal) {
|
||||
foreach($longVals as $longVal) {
|
||||
echo "--- testing: $otherVal << $longVal ---\n";
|
||||
var_dump($otherVal<<$longVal);
|
||||
echo "--- testing: $otherVal << $longVal ---\n";
|
||||
try {
|
||||
var_dump($otherVal<<$longVal);
|
||||
} catch (Exception $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,7 +52,7 @@ int(9223372036854775807)
|
|||
--- testing: 9223372036854775807 << 1 ---
|
||||
int(-2)
|
||||
--- testing: 9223372036854775807 << -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775807 << 7 ---
|
||||
int(-128)
|
||||
--- testing: 9223372036854775807 << 9 ---
|
||||
|
@ -52,7 +60,7 @@ int(-512)
|
|||
--- testing: 9223372036854775807 << 65 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775807 << -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775807 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775807 << 9223372036854775807 ---
|
||||
|
@ -62,7 +70,7 @@ int(-9223372036854775808)
|
|||
--- testing: -9223372036854775808 << 1 ---
|
||||
int(0)
|
||||
--- testing: -9223372036854775808 << -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -9223372036854775808 << 7 ---
|
||||
int(0)
|
||||
--- testing: -9223372036854775808 << 9 ---
|
||||
|
@ -70,7 +78,7 @@ int(0)
|
|||
--- testing: -9223372036854775808 << 65 ---
|
||||
int(0)
|
||||
--- testing: -9223372036854775808 << -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -9223372036854775808 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: -9223372036854775808 << 9223372036854775807 ---
|
||||
|
@ -80,7 +88,7 @@ int(2147483647)
|
|||
--- testing: 2147483647 << 1 ---
|
||||
int(4294967294)
|
||||
--- testing: 2147483647 << -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483647 << 7 ---
|
||||
int(274877906816)
|
||||
--- testing: 2147483647 << 9 ---
|
||||
|
@ -88,7 +96,7 @@ int(1099511627264)
|
|||
--- testing: 2147483647 << 65 ---
|
||||
int(0)
|
||||
--- testing: 2147483647 << -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483647 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 2147483647 << 9223372036854775807 ---
|
||||
|
@ -98,7 +106,7 @@ int(-2147483648)
|
|||
--- testing: -2147483648 << 1 ---
|
||||
int(-4294967296)
|
||||
--- testing: -2147483648 << -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -2147483648 << 7 ---
|
||||
int(-274877906944)
|
||||
--- testing: -2147483648 << 9 ---
|
||||
|
@ -106,7 +114,7 @@ int(-1099511627776)
|
|||
--- testing: -2147483648 << 65 ---
|
||||
int(0)
|
||||
--- testing: -2147483648 << -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -2147483648 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: -2147483648 << 9223372036854775807 ---
|
||||
|
@ -116,7 +124,7 @@ int(9223372034707292160)
|
|||
--- testing: 9223372034707292160 << 1 ---
|
||||
int(-4294967296)
|
||||
--- testing: 9223372034707292160 << -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372034707292160 << 7 ---
|
||||
int(-274877906944)
|
||||
--- testing: 9223372034707292160 << 9 ---
|
||||
|
@ -124,7 +132,7 @@ int(-1099511627776)
|
|||
--- testing: 9223372034707292160 << 65 ---
|
||||
int(0)
|
||||
--- testing: 9223372034707292160 << -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372034707292160 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 9223372034707292160 << 9223372036854775807 ---
|
||||
|
@ -134,7 +142,7 @@ int(-9223372034707292160)
|
|||
--- testing: -9223372034707292160 << 1 ---
|
||||
int(4294967296)
|
||||
--- testing: -9223372034707292160 << -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -9223372034707292160 << 7 ---
|
||||
int(274877906944)
|
||||
--- testing: -9223372034707292160 << 9 ---
|
||||
|
@ -142,7 +150,7 @@ int(1099511627776)
|
|||
--- testing: -9223372034707292160 << 65 ---
|
||||
int(0)
|
||||
--- testing: -9223372034707292160 << -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -9223372034707292160 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: -9223372034707292160 << 9223372036854775807 ---
|
||||
|
@ -152,7 +160,7 @@ int(2147483648)
|
|||
--- testing: 2147483648 << 1 ---
|
||||
int(4294967296)
|
||||
--- testing: 2147483648 << -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483648 << 7 ---
|
||||
int(274877906944)
|
||||
--- testing: 2147483648 << 9 ---
|
||||
|
@ -160,7 +168,7 @@ int(1099511627776)
|
|||
--- testing: 2147483648 << 65 ---
|
||||
int(0)
|
||||
--- testing: 2147483648 << -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483648 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 2147483648 << 9223372036854775807 ---
|
||||
|
@ -170,7 +178,7 @@ int(-2147483649)
|
|||
--- testing: -2147483649 << 1 ---
|
||||
int(-4294967298)
|
||||
--- testing: -2147483649 << -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -2147483649 << 7 ---
|
||||
int(-274877907072)
|
||||
--- testing: -2147483649 << 9 ---
|
||||
|
@ -178,7 +186,7 @@ int(-1099511628288)
|
|||
--- testing: -2147483649 << 65 ---
|
||||
int(0)
|
||||
--- testing: -2147483649 << -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -2147483649 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: -2147483649 << 9223372036854775807 ---
|
||||
|
@ -188,7 +196,7 @@ int(4294967294)
|
|||
--- testing: 4294967294 << 1 ---
|
||||
int(8589934588)
|
||||
--- testing: 4294967294 << -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 4294967294 << 7 ---
|
||||
int(549755813632)
|
||||
--- testing: 4294967294 << 9 ---
|
||||
|
@ -196,7 +204,7 @@ int(2199023254528)
|
|||
--- testing: 4294967294 << 65 ---
|
||||
int(0)
|
||||
--- testing: 4294967294 << -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 4294967294 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 4294967294 << 9223372036854775807 ---
|
||||
|
@ -206,7 +214,7 @@ int(4294967295)
|
|||
--- testing: 4294967295 << 1 ---
|
||||
int(8589934590)
|
||||
--- testing: 4294967295 << -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 4294967295 << 7 ---
|
||||
int(549755813760)
|
||||
--- testing: 4294967295 << 9 ---
|
||||
|
@ -214,7 +222,7 @@ int(2199023255040)
|
|||
--- testing: 4294967295 << 65 ---
|
||||
int(0)
|
||||
--- testing: 4294967295 << -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 4294967295 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 4294967295 << 9223372036854775807 ---
|
||||
|
@ -224,7 +232,7 @@ int(4294967293)
|
|||
--- testing: 4294967293 << 1 ---
|
||||
int(8589934586)
|
||||
--- testing: 4294967293 << -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 4294967293 << 7 ---
|
||||
int(549755813504)
|
||||
--- testing: 4294967293 << 9 ---
|
||||
|
@ -232,7 +240,7 @@ int(2199023254016)
|
|||
--- testing: 4294967293 << 65 ---
|
||||
int(0)
|
||||
--- testing: 4294967293 << -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 4294967293 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 4294967293 << 9223372036854775807 ---
|
||||
|
@ -242,7 +250,7 @@ int(9223372036854775806)
|
|||
--- testing: 9223372036854775806 << 1 ---
|
||||
int(-4)
|
||||
--- testing: 9223372036854775806 << -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775806 << 7 ---
|
||||
int(-256)
|
||||
--- testing: 9223372036854775806 << 9 ---
|
||||
|
@ -250,7 +258,7 @@ int(-1024)
|
|||
--- testing: 9223372036854775806 << 65 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775806 << -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775806 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775806 << 9223372036854775807 ---
|
||||
|
@ -260,7 +268,7 @@ int(-9223372036854775808)
|
|||
--- testing: 9.2233720368548E+18 << 1 ---
|
||||
int(0)
|
||||
--- testing: 9.2233720368548E+18 << -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9.2233720368548E+18 << 7 ---
|
||||
int(0)
|
||||
--- testing: 9.2233720368548E+18 << 9 ---
|
||||
|
@ -268,7 +276,7 @@ int(0)
|
|||
--- testing: 9.2233720368548E+18 << 65 ---
|
||||
int(0)
|
||||
--- testing: 9.2233720368548E+18 << -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9.2233720368548E+18 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 9.2233720368548E+18 << 9223372036854775807 ---
|
||||
|
@ -278,7 +286,7 @@ int(-9223372036854775807)
|
|||
--- testing: -9223372036854775807 << 1 ---
|
||||
int(2)
|
||||
--- testing: -9223372036854775807 << -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -9223372036854775807 << 7 ---
|
||||
int(128)
|
||||
--- testing: -9223372036854775807 << 9 ---
|
||||
|
@ -286,7 +294,7 @@ int(512)
|
|||
--- testing: -9223372036854775807 << 65 ---
|
||||
int(0)
|
||||
--- testing: -9223372036854775807 << -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -9223372036854775807 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: -9223372036854775807 << 9223372036854775807 ---
|
||||
|
@ -296,7 +304,7 @@ int(-9223372036854775808)
|
|||
--- testing: -9.2233720368548E+18 << 1 ---
|
||||
int(0)
|
||||
--- testing: -9.2233720368548E+18 << -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -9.2233720368548E+18 << 7 ---
|
||||
int(0)
|
||||
--- testing: -9.2233720368548E+18 << 9 ---
|
||||
|
@ -304,7 +312,7 @@ int(0)
|
|||
--- testing: -9.2233720368548E+18 << 65 ---
|
||||
int(0)
|
||||
--- testing: -9.2233720368548E+18 << -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -9.2233720368548E+18 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: -9.2233720368548E+18 << 9223372036854775807 ---
|
||||
|
@ -312,19 +320,19 @@ int(0)
|
|||
--- testing: 0 << 9223372036854775807 ---
|
||||
int(0)
|
||||
--- testing: 0 << -9223372036854775808 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 0 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 0 << -2147483648 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 0 << 9223372034707292160 ---
|
||||
int(0)
|
||||
--- testing: 0 << -9223372034707292160 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 0 << 2147483648 ---
|
||||
int(0)
|
||||
--- testing: 0 << -2147483649 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 0 << 4294967294 ---
|
||||
int(0)
|
||||
--- testing: 0 << 4294967295 ---
|
||||
|
@ -334,27 +342,27 @@ int(0)
|
|||
--- testing: 0 << 9223372036854775806 ---
|
||||
int(0)
|
||||
--- testing: 0 << 9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 0 << -9223372036854775807 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 0 << -9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 1 << 9223372036854775807 ---
|
||||
int(0)
|
||||
--- testing: 1 << -9223372036854775808 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 1 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 1 << -2147483648 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 1 << 9223372034707292160 ---
|
||||
int(0)
|
||||
--- testing: 1 << -9223372034707292160 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 1 << 2147483648 ---
|
||||
int(0)
|
||||
--- testing: 1 << -2147483649 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 1 << 4294967294 ---
|
||||
int(0)
|
||||
--- testing: 1 << 4294967295 ---
|
||||
|
@ -364,27 +372,27 @@ int(0)
|
|||
--- testing: 1 << 9223372036854775806 ---
|
||||
int(0)
|
||||
--- testing: 1 << 9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 1 << -9223372036854775807 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 1 << -9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -1 << 9223372036854775807 ---
|
||||
int(0)
|
||||
--- testing: -1 << -9223372036854775808 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -1 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: -1 << -2147483648 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -1 << 9223372034707292160 ---
|
||||
int(0)
|
||||
--- testing: -1 << -9223372034707292160 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -1 << 2147483648 ---
|
||||
int(0)
|
||||
--- testing: -1 << -2147483649 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -1 << 4294967294 ---
|
||||
int(0)
|
||||
--- testing: -1 << 4294967295 ---
|
||||
|
@ -394,27 +402,27 @@ int(0)
|
|||
--- testing: -1 << 9223372036854775806 ---
|
||||
int(0)
|
||||
--- testing: -1 << 9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -1 << -9223372036854775807 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -1 << -9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 7 << 9223372036854775807 ---
|
||||
int(0)
|
||||
--- testing: 7 << -9223372036854775808 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 7 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 7 << -2147483648 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 7 << 9223372034707292160 ---
|
||||
int(0)
|
||||
--- testing: 7 << -9223372034707292160 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 7 << 2147483648 ---
|
||||
int(0)
|
||||
--- testing: 7 << -2147483649 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 7 << 4294967294 ---
|
||||
int(0)
|
||||
--- testing: 7 << 4294967295 ---
|
||||
|
@ -424,27 +432,27 @@ int(0)
|
|||
--- testing: 7 << 9223372036854775806 ---
|
||||
int(0)
|
||||
--- testing: 7 << 9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 7 << -9223372036854775807 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 7 << -9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9 << 9223372036854775807 ---
|
||||
int(0)
|
||||
--- testing: 9 << -9223372036854775808 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 9 << -2147483648 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9 << 9223372034707292160 ---
|
||||
int(0)
|
||||
--- testing: 9 << -9223372034707292160 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9 << 2147483648 ---
|
||||
int(0)
|
||||
--- testing: 9 << -2147483649 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9 << 4294967294 ---
|
||||
int(0)
|
||||
--- testing: 9 << 4294967295 ---
|
||||
|
@ -454,27 +462,27 @@ int(0)
|
|||
--- testing: 9 << 9223372036854775806 ---
|
||||
int(0)
|
||||
--- testing: 9 << 9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9 << -9223372036854775807 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9 << -9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 65 << 9223372036854775807 ---
|
||||
int(0)
|
||||
--- testing: 65 << -9223372036854775808 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 65 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 65 << -2147483648 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 65 << 9223372034707292160 ---
|
||||
int(0)
|
||||
--- testing: 65 << -9223372034707292160 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 65 << 2147483648 ---
|
||||
int(0)
|
||||
--- testing: 65 << -2147483649 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 65 << 4294967294 ---
|
||||
int(0)
|
||||
--- testing: 65 << 4294967295 ---
|
||||
|
@ -484,27 +492,27 @@ int(0)
|
|||
--- testing: 65 << 9223372036854775806 ---
|
||||
int(0)
|
||||
--- testing: 65 << 9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 65 << -9223372036854775807 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 65 << -9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -44 << 9223372036854775807 ---
|
||||
int(0)
|
||||
--- testing: -44 << -9223372036854775808 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -44 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: -44 << -2147483648 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -44 << 9223372034707292160 ---
|
||||
int(0)
|
||||
--- testing: -44 << -9223372034707292160 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -44 << 2147483648 ---
|
||||
int(0)
|
||||
--- testing: -44 << -2147483649 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -44 << 4294967294 ---
|
||||
int(0)
|
||||
--- testing: -44 << 4294967295 ---
|
||||
|
@ -514,27 +522,27 @@ int(0)
|
|||
--- testing: -44 << 9223372036854775806 ---
|
||||
int(0)
|
||||
--- testing: -44 << 9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -44 << -9223372036854775807 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -44 << -9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483647 << 9223372036854775807 ---
|
||||
int(0)
|
||||
--- testing: 2147483647 << -9223372036854775808 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483647 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 2147483647 << -2147483648 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483647 << 9223372034707292160 ---
|
||||
int(0)
|
||||
--- testing: 2147483647 << -9223372034707292160 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483647 << 2147483648 ---
|
||||
int(0)
|
||||
--- testing: 2147483647 << -2147483649 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483647 << 4294967294 ---
|
||||
int(0)
|
||||
--- testing: 2147483647 << 4294967295 ---
|
||||
|
@ -544,27 +552,27 @@ int(0)
|
|||
--- testing: 2147483647 << 9223372036854775806 ---
|
||||
int(0)
|
||||
--- testing: 2147483647 << 9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483647 << -9223372036854775807 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483647 << -9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775807 << 9223372036854775807 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775807 << -9223372036854775808 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775807 << 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775807 << -2147483648 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775807 << 9223372034707292160 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775807 << -9223372034707292160 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775807 << 2147483648 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775807 << -2147483649 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775807 << 4294967294 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775807 << 4294967295 ---
|
||||
|
@ -574,9 +582,9 @@ int(0)
|
|||
--- testing: 9223372036854775807 << 9223372036854775806 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775807 << 9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775807 << -9223372036854775807 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775807 << -9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
===DONE===
|
||||
|
|
|
@ -16,8 +16,12 @@ error_reporting(E_ERROR);
|
|||
|
||||
foreach ($strVals as $strVal) {
|
||||
foreach($strVals as $otherVal) {
|
||||
echo "--- testing: '$strVal' << '$otherVal' ---\n";
|
||||
var_dump(strVal<<$otherVal);
|
||||
echo "--- testing: '$strVal' << '$otherVal' ---\n";
|
||||
try {
|
||||
var_dump(strVal<<$otherVal);
|
||||
} catch (Exception $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,11 +33,11 @@ int(0)
|
|||
--- testing: '0' << '65' ---
|
||||
int(0)
|
||||
--- testing: '0' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '0' << '1.2' ---
|
||||
int(0)
|
||||
--- testing: '0' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '0' << 'abc' ---
|
||||
int(0)
|
||||
--- testing: '0' << '123abc' ---
|
||||
|
@ -57,11 +61,11 @@ int(0)
|
|||
--- testing: '65' << '65' ---
|
||||
int(0)
|
||||
--- testing: '65' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '65' << '1.2' ---
|
||||
int(0)
|
||||
--- testing: '65' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '65' << 'abc' ---
|
||||
int(0)
|
||||
--- testing: '65' << '123abc' ---
|
||||
|
@ -85,11 +89,11 @@ int(0)
|
|||
--- testing: '-44' << '65' ---
|
||||
int(0)
|
||||
--- testing: '-44' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '-44' << '1.2' ---
|
||||
int(0)
|
||||
--- testing: '-44' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '-44' << 'abc' ---
|
||||
int(0)
|
||||
--- testing: '-44' << '123abc' ---
|
||||
|
@ -113,11 +117,11 @@ int(0)
|
|||
--- testing: '1.2' << '65' ---
|
||||
int(0)
|
||||
--- testing: '1.2' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '1.2' << '1.2' ---
|
||||
int(0)
|
||||
--- testing: '1.2' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '1.2' << 'abc' ---
|
||||
int(0)
|
||||
--- testing: '1.2' << '123abc' ---
|
||||
|
@ -141,11 +145,11 @@ int(0)
|
|||
--- testing: '-7.7' << '65' ---
|
||||
int(0)
|
||||
--- testing: '-7.7' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '-7.7' << '1.2' ---
|
||||
int(0)
|
||||
--- testing: '-7.7' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '-7.7' << 'abc' ---
|
||||
int(0)
|
||||
--- testing: '-7.7' << '123abc' ---
|
||||
|
@ -169,11 +173,11 @@ int(0)
|
|||
--- testing: 'abc' << '65' ---
|
||||
int(0)
|
||||
--- testing: 'abc' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 'abc' << '1.2' ---
|
||||
int(0)
|
||||
--- testing: 'abc' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 'abc' << 'abc' ---
|
||||
int(0)
|
||||
--- testing: 'abc' << '123abc' ---
|
||||
|
@ -197,11 +201,11 @@ int(0)
|
|||
--- testing: '123abc' << '65' ---
|
||||
int(0)
|
||||
--- testing: '123abc' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123abc' << '1.2' ---
|
||||
int(0)
|
||||
--- testing: '123abc' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123abc' << 'abc' ---
|
||||
int(0)
|
||||
--- testing: '123abc' << '123abc' ---
|
||||
|
@ -225,11 +229,11 @@ int(0)
|
|||
--- testing: '123e5' << '65' ---
|
||||
int(0)
|
||||
--- testing: '123e5' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123e5' << '1.2' ---
|
||||
int(0)
|
||||
--- testing: '123e5' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123e5' << 'abc' ---
|
||||
int(0)
|
||||
--- testing: '123e5' << '123abc' ---
|
||||
|
@ -253,11 +257,11 @@ int(0)
|
|||
--- testing: '123e5xyz' << '65' ---
|
||||
int(0)
|
||||
--- testing: '123e5xyz' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123e5xyz' << '1.2' ---
|
||||
int(0)
|
||||
--- testing: '123e5xyz' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123e5xyz' << 'abc' ---
|
||||
int(0)
|
||||
--- testing: '123e5xyz' << '123abc' ---
|
||||
|
@ -281,11 +285,11 @@ int(0)
|
|||
--- testing: ' 123abc' << '65' ---
|
||||
int(0)
|
||||
--- testing: ' 123abc' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: ' 123abc' << '1.2' ---
|
||||
int(0)
|
||||
--- testing: ' 123abc' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: ' 123abc' << 'abc' ---
|
||||
int(0)
|
||||
--- testing: ' 123abc' << '123abc' ---
|
||||
|
@ -309,11 +313,11 @@ int(0)
|
|||
--- testing: '123 abc' << '65' ---
|
||||
int(0)
|
||||
--- testing: '123 abc' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123 abc' << '1.2' ---
|
||||
int(0)
|
||||
--- testing: '123 abc' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123 abc' << 'abc' ---
|
||||
int(0)
|
||||
--- testing: '123 abc' << '123abc' ---
|
||||
|
@ -337,11 +341,11 @@ int(0)
|
|||
--- testing: '123abc ' << '65' ---
|
||||
int(0)
|
||||
--- testing: '123abc ' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123abc ' << '1.2' ---
|
||||
int(0)
|
||||
--- testing: '123abc ' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123abc ' << 'abc' ---
|
||||
int(0)
|
||||
--- testing: '123abc ' << '123abc' ---
|
||||
|
@ -365,11 +369,11 @@ int(0)
|
|||
--- testing: '3.4a' << '65' ---
|
||||
int(0)
|
||||
--- testing: '3.4a' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '3.4a' << '1.2' ---
|
||||
int(0)
|
||||
--- testing: '3.4a' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '3.4a' << 'abc' ---
|
||||
int(0)
|
||||
--- testing: '3.4a' << '123abc' ---
|
||||
|
@ -393,11 +397,11 @@ int(0)
|
|||
--- testing: 'a5.9' << '65' ---
|
||||
int(0)
|
||||
--- testing: 'a5.9' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 'a5.9' << '1.2' ---
|
||||
int(0)
|
||||
--- testing: 'a5.9' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 'a5.9' << 'abc' ---
|
||||
int(0)
|
||||
--- testing: 'a5.9' << '123abc' ---
|
||||
|
|
|
@ -16,8 +16,12 @@ error_reporting(E_ERROR);
|
|||
|
||||
foreach ($strVals as $strVal) {
|
||||
foreach($strVals as $otherVal) {
|
||||
echo "--- testing: '$strVal' << '$otherVal' ---\n";
|
||||
var_dump($strVal<<$otherVal);
|
||||
echo "--- testing: '$strVal' << '$otherVal' ---\n";
|
||||
try {
|
||||
var_dump($strVal<<$otherVal);
|
||||
} catch (Exception $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,11 +34,11 @@ int(0)
|
|||
--- testing: '0' << '65' ---
|
||||
int(0)
|
||||
--- testing: '0' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '0' << '1.2' ---
|
||||
int(0)
|
||||
--- testing: '0' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '0' << 'abc' ---
|
||||
int(0)
|
||||
--- testing: '0' << '123abc' ---
|
||||
|
@ -58,11 +62,11 @@ int(65)
|
|||
--- testing: '65' << '65' ---
|
||||
int(0)
|
||||
--- testing: '65' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '65' << '1.2' ---
|
||||
int(130)
|
||||
--- testing: '65' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '65' << 'abc' ---
|
||||
int(65)
|
||||
--- testing: '65' << '123abc' ---
|
||||
|
@ -86,11 +90,11 @@ int(-44)
|
|||
--- testing: '-44' << '65' ---
|
||||
int(0)
|
||||
--- testing: '-44' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '-44' << '1.2' ---
|
||||
int(-88)
|
||||
--- testing: '-44' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '-44' << 'abc' ---
|
||||
int(-44)
|
||||
--- testing: '-44' << '123abc' ---
|
||||
|
@ -114,11 +118,11 @@ int(1)
|
|||
--- testing: '1.2' << '65' ---
|
||||
int(0)
|
||||
--- testing: '1.2' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '1.2' << '1.2' ---
|
||||
int(2)
|
||||
--- testing: '1.2' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '1.2' << 'abc' ---
|
||||
int(1)
|
||||
--- testing: '1.2' << '123abc' ---
|
||||
|
@ -142,11 +146,11 @@ int(-7)
|
|||
--- testing: '-7.7' << '65' ---
|
||||
int(0)
|
||||
--- testing: '-7.7' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '-7.7' << '1.2' ---
|
||||
int(-14)
|
||||
--- testing: '-7.7' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '-7.7' << 'abc' ---
|
||||
int(-7)
|
||||
--- testing: '-7.7' << '123abc' ---
|
||||
|
@ -170,11 +174,11 @@ int(0)
|
|||
--- testing: 'abc' << '65' ---
|
||||
int(0)
|
||||
--- testing: 'abc' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 'abc' << '1.2' ---
|
||||
int(0)
|
||||
--- testing: 'abc' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 'abc' << 'abc' ---
|
||||
int(0)
|
||||
--- testing: 'abc' << '123abc' ---
|
||||
|
@ -198,11 +202,11 @@ int(123)
|
|||
--- testing: '123abc' << '65' ---
|
||||
int(0)
|
||||
--- testing: '123abc' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123abc' << '1.2' ---
|
||||
int(246)
|
||||
--- testing: '123abc' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123abc' << 'abc' ---
|
||||
int(123)
|
||||
--- testing: '123abc' << '123abc' ---
|
||||
|
@ -226,11 +230,11 @@ int(123)
|
|||
--- testing: '123e5' << '65' ---
|
||||
int(0)
|
||||
--- testing: '123e5' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123e5' << '1.2' ---
|
||||
int(246)
|
||||
--- testing: '123e5' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123e5' << 'abc' ---
|
||||
int(123)
|
||||
--- testing: '123e5' << '123abc' ---
|
||||
|
@ -254,11 +258,11 @@ int(123)
|
|||
--- testing: '123e5xyz' << '65' ---
|
||||
int(0)
|
||||
--- testing: '123e5xyz' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123e5xyz' << '1.2' ---
|
||||
int(246)
|
||||
--- testing: '123e5xyz' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123e5xyz' << 'abc' ---
|
||||
int(123)
|
||||
--- testing: '123e5xyz' << '123abc' ---
|
||||
|
@ -282,11 +286,11 @@ int(123)
|
|||
--- testing: ' 123abc' << '65' ---
|
||||
int(0)
|
||||
--- testing: ' 123abc' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: ' 123abc' << '1.2' ---
|
||||
int(246)
|
||||
--- testing: ' 123abc' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: ' 123abc' << 'abc' ---
|
||||
int(123)
|
||||
--- testing: ' 123abc' << '123abc' ---
|
||||
|
@ -310,11 +314,11 @@ int(123)
|
|||
--- testing: '123 abc' << '65' ---
|
||||
int(0)
|
||||
--- testing: '123 abc' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123 abc' << '1.2' ---
|
||||
int(246)
|
||||
--- testing: '123 abc' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123 abc' << 'abc' ---
|
||||
int(123)
|
||||
--- testing: '123 abc' << '123abc' ---
|
||||
|
@ -338,11 +342,11 @@ int(123)
|
|||
--- testing: '123abc ' << '65' ---
|
||||
int(0)
|
||||
--- testing: '123abc ' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123abc ' << '1.2' ---
|
||||
int(246)
|
||||
--- testing: '123abc ' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123abc ' << 'abc' ---
|
||||
int(123)
|
||||
--- testing: '123abc ' << '123abc' ---
|
||||
|
@ -366,11 +370,11 @@ int(3)
|
|||
--- testing: '3.4a' << '65' ---
|
||||
int(0)
|
||||
--- testing: '3.4a' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '3.4a' << '1.2' ---
|
||||
int(6)
|
||||
--- testing: '3.4a' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '3.4a' << 'abc' ---
|
||||
int(3)
|
||||
--- testing: '3.4a' << '123abc' ---
|
||||
|
@ -394,11 +398,11 @@ int(0)
|
|||
--- testing: 'a5.9' << '65' ---
|
||||
int(0)
|
||||
--- testing: 'a5.9' << '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 'a5.9' << '1.2' ---
|
||||
int(0)
|
||||
--- testing: 'a5.9' << '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 'a5.9' << 'abc' ---
|
||||
int(0)
|
||||
--- testing: 'a5.9' << '123abc' ---
|
||||
|
|
|
@ -24,15 +24,23 @@ error_reporting(E_ERROR);
|
|||
|
||||
foreach ($longVals as $longVal) {
|
||||
foreach($otherVals as $otherVal) {
|
||||
echo "--- testing: $longVal >> $otherVal ---\n";
|
||||
var_dump($longVal>>$otherVal);
|
||||
echo "--- testing: $longVal >> $otherVal ---\n";
|
||||
try {
|
||||
var_dump($longVal>>$otherVal);
|
||||
} catch (Exception $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($otherVals as $otherVal) {
|
||||
foreach($longVals as $longVal) {
|
||||
echo "--- testing: $otherVal >> $longVal ---\n";
|
||||
var_dump($otherVal>>$longVal);
|
||||
echo "--- testing: $otherVal >> $longVal ---\n";
|
||||
try {
|
||||
var_dump($otherVal>>$longVal);
|
||||
} catch (Exception $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,7 +52,7 @@ int(9223372036854775807)
|
|||
--- testing: 9223372036854775807 >> 1 ---
|
||||
int(4611686018427387903)
|
||||
--- testing: 9223372036854775807 >> -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775807 >> 7 ---
|
||||
int(72057594037927935)
|
||||
--- testing: 9223372036854775807 >> 9 ---
|
||||
|
@ -52,7 +60,7 @@ int(18014398509481983)
|
|||
--- testing: 9223372036854775807 >> 65 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775807 >> -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775807 >> 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775807 >> 9223372036854775807 ---
|
||||
|
@ -62,7 +70,7 @@ int(-9223372036854775808)
|
|||
--- testing: -9223372036854775808 >> 1 ---
|
||||
int(-4611686018427387904)
|
||||
--- testing: -9223372036854775808 >> -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -9223372036854775808 >> 7 ---
|
||||
int(-72057594037927936)
|
||||
--- testing: -9223372036854775808 >> 9 ---
|
||||
|
@ -70,7 +78,7 @@ int(-18014398509481984)
|
|||
--- testing: -9223372036854775808 >> 65 ---
|
||||
int(-1)
|
||||
--- testing: -9223372036854775808 >> -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -9223372036854775808 >> 2147483647 ---
|
||||
int(-1)
|
||||
--- testing: -9223372036854775808 >> 9223372036854775807 ---
|
||||
|
@ -80,7 +88,7 @@ int(2147483647)
|
|||
--- testing: 2147483647 >> 1 ---
|
||||
int(1073741823)
|
||||
--- testing: 2147483647 >> -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483647 >> 7 ---
|
||||
int(16777215)
|
||||
--- testing: 2147483647 >> 9 ---
|
||||
|
@ -88,7 +96,7 @@ int(4194303)
|
|||
--- testing: 2147483647 >> 65 ---
|
||||
int(0)
|
||||
--- testing: 2147483647 >> -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483647 >> 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 2147483647 >> 9223372036854775807 ---
|
||||
|
@ -98,7 +106,7 @@ int(-2147483648)
|
|||
--- testing: -2147483648 >> 1 ---
|
||||
int(-1073741824)
|
||||
--- testing: -2147483648 >> -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -2147483648 >> 7 ---
|
||||
int(-16777216)
|
||||
--- testing: -2147483648 >> 9 ---
|
||||
|
@ -106,7 +114,7 @@ int(-4194304)
|
|||
--- testing: -2147483648 >> 65 ---
|
||||
int(-1)
|
||||
--- testing: -2147483648 >> -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -2147483648 >> 2147483647 ---
|
||||
int(-1)
|
||||
--- testing: -2147483648 >> 9223372036854775807 ---
|
||||
|
@ -116,7 +124,7 @@ int(9223372034707292160)
|
|||
--- testing: 9223372034707292160 >> 1 ---
|
||||
int(4611686017353646080)
|
||||
--- testing: 9223372034707292160 >> -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372034707292160 >> 7 ---
|
||||
int(72057594021150720)
|
||||
--- testing: 9223372034707292160 >> 9 ---
|
||||
|
@ -124,7 +132,7 @@ int(18014398505287680)
|
|||
--- testing: 9223372034707292160 >> 65 ---
|
||||
int(0)
|
||||
--- testing: 9223372034707292160 >> -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372034707292160 >> 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 9223372034707292160 >> 9223372036854775807 ---
|
||||
|
@ -134,7 +142,7 @@ int(-9223372034707292160)
|
|||
--- testing: -9223372034707292160 >> 1 ---
|
||||
int(-4611686017353646080)
|
||||
--- testing: -9223372034707292160 >> -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -9223372034707292160 >> 7 ---
|
||||
int(-72057594021150720)
|
||||
--- testing: -9223372034707292160 >> 9 ---
|
||||
|
@ -142,7 +150,7 @@ int(-18014398505287680)
|
|||
--- testing: -9223372034707292160 >> 65 ---
|
||||
int(-1)
|
||||
--- testing: -9223372034707292160 >> -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -9223372034707292160 >> 2147483647 ---
|
||||
int(-1)
|
||||
--- testing: -9223372034707292160 >> 9223372036854775807 ---
|
||||
|
@ -152,7 +160,7 @@ int(2147483648)
|
|||
--- testing: 2147483648 >> 1 ---
|
||||
int(1073741824)
|
||||
--- testing: 2147483648 >> -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483648 >> 7 ---
|
||||
int(16777216)
|
||||
--- testing: 2147483648 >> 9 ---
|
||||
|
@ -160,7 +168,7 @@ int(4194304)
|
|||
--- testing: 2147483648 >> 65 ---
|
||||
int(0)
|
||||
--- testing: 2147483648 >> -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483648 >> 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 2147483648 >> 9223372036854775807 ---
|
||||
|
@ -170,7 +178,7 @@ int(-2147483649)
|
|||
--- testing: -2147483649 >> 1 ---
|
||||
int(-1073741825)
|
||||
--- testing: -2147483649 >> -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -2147483649 >> 7 ---
|
||||
int(-16777217)
|
||||
--- testing: -2147483649 >> 9 ---
|
||||
|
@ -178,7 +186,7 @@ int(-4194305)
|
|||
--- testing: -2147483649 >> 65 ---
|
||||
int(-1)
|
||||
--- testing: -2147483649 >> -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -2147483649 >> 2147483647 ---
|
||||
int(-1)
|
||||
--- testing: -2147483649 >> 9223372036854775807 ---
|
||||
|
@ -188,7 +196,7 @@ int(4294967294)
|
|||
--- testing: 4294967294 >> 1 ---
|
||||
int(2147483647)
|
||||
--- testing: 4294967294 >> -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 4294967294 >> 7 ---
|
||||
int(33554431)
|
||||
--- testing: 4294967294 >> 9 ---
|
||||
|
@ -196,7 +204,7 @@ int(8388607)
|
|||
--- testing: 4294967294 >> 65 ---
|
||||
int(0)
|
||||
--- testing: 4294967294 >> -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 4294967294 >> 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 4294967294 >> 9223372036854775807 ---
|
||||
|
@ -206,7 +214,7 @@ int(4294967295)
|
|||
--- testing: 4294967295 >> 1 ---
|
||||
int(2147483647)
|
||||
--- testing: 4294967295 >> -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 4294967295 >> 7 ---
|
||||
int(33554431)
|
||||
--- testing: 4294967295 >> 9 ---
|
||||
|
@ -214,7 +222,7 @@ int(8388607)
|
|||
--- testing: 4294967295 >> 65 ---
|
||||
int(0)
|
||||
--- testing: 4294967295 >> -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 4294967295 >> 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 4294967295 >> 9223372036854775807 ---
|
||||
|
@ -224,7 +232,7 @@ int(4294967293)
|
|||
--- testing: 4294967293 >> 1 ---
|
||||
int(2147483646)
|
||||
--- testing: 4294967293 >> -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 4294967293 >> 7 ---
|
||||
int(33554431)
|
||||
--- testing: 4294967293 >> 9 ---
|
||||
|
@ -232,7 +240,7 @@ int(8388607)
|
|||
--- testing: 4294967293 >> 65 ---
|
||||
int(0)
|
||||
--- testing: 4294967293 >> -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 4294967293 >> 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 4294967293 >> 9223372036854775807 ---
|
||||
|
@ -242,7 +250,7 @@ int(9223372036854775806)
|
|||
--- testing: 9223372036854775806 >> 1 ---
|
||||
int(4611686018427387903)
|
||||
--- testing: 9223372036854775806 >> -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775806 >> 7 ---
|
||||
int(72057594037927935)
|
||||
--- testing: 9223372036854775806 >> 9 ---
|
||||
|
@ -250,7 +258,7 @@ int(18014398509481983)
|
|||
--- testing: 9223372036854775806 >> 65 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775806 >> -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775806 >> 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775806 >> 9223372036854775807 ---
|
||||
|
@ -260,7 +268,7 @@ int(-9223372036854775808)
|
|||
--- testing: 9.2233720368548E+18 >> 1 ---
|
||||
int(-4611686018427387904)
|
||||
--- testing: 9.2233720368548E+18 >> -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9.2233720368548E+18 >> 7 ---
|
||||
int(-72057594037927936)
|
||||
--- testing: 9.2233720368548E+18 >> 9 ---
|
||||
|
@ -268,7 +276,7 @@ int(-18014398509481984)
|
|||
--- testing: 9.2233720368548E+18 >> 65 ---
|
||||
int(-1)
|
||||
--- testing: 9.2233720368548E+18 >> -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9.2233720368548E+18 >> 2147483647 ---
|
||||
int(-1)
|
||||
--- testing: 9.2233720368548E+18 >> 9223372036854775807 ---
|
||||
|
@ -278,7 +286,7 @@ int(-9223372036854775807)
|
|||
--- testing: -9223372036854775807 >> 1 ---
|
||||
int(-4611686018427387904)
|
||||
--- testing: -9223372036854775807 >> -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -9223372036854775807 >> 7 ---
|
||||
int(-72057594037927936)
|
||||
--- testing: -9223372036854775807 >> 9 ---
|
||||
|
@ -286,7 +294,7 @@ int(-18014398509481984)
|
|||
--- testing: -9223372036854775807 >> 65 ---
|
||||
int(-1)
|
||||
--- testing: -9223372036854775807 >> -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -9223372036854775807 >> 2147483647 ---
|
||||
int(-1)
|
||||
--- testing: -9223372036854775807 >> 9223372036854775807 ---
|
||||
|
@ -296,7 +304,7 @@ int(-9223372036854775808)
|
|||
--- testing: -9.2233720368548E+18 >> 1 ---
|
||||
int(-4611686018427387904)
|
||||
--- testing: -9.2233720368548E+18 >> -1 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -9.2233720368548E+18 >> 7 ---
|
||||
int(-72057594037927936)
|
||||
--- testing: -9.2233720368548E+18 >> 9 ---
|
||||
|
@ -304,7 +312,7 @@ int(-18014398509481984)
|
|||
--- testing: -9.2233720368548E+18 >> 65 ---
|
||||
int(-1)
|
||||
--- testing: -9.2233720368548E+18 >> -44 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -9.2233720368548E+18 >> 2147483647 ---
|
||||
int(-1)
|
||||
--- testing: -9.2233720368548E+18 >> 9223372036854775807 ---
|
||||
|
@ -312,19 +320,19 @@ int(-1)
|
|||
--- testing: 0 >> 9223372036854775807 ---
|
||||
int(0)
|
||||
--- testing: 0 >> -9223372036854775808 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 0 >> 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 0 >> -2147483648 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 0 >> 9223372034707292160 ---
|
||||
int(0)
|
||||
--- testing: 0 >> -9223372034707292160 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 0 >> 2147483648 ---
|
||||
int(0)
|
||||
--- testing: 0 >> -2147483649 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 0 >> 4294967294 ---
|
||||
int(0)
|
||||
--- testing: 0 >> 4294967295 ---
|
||||
|
@ -334,27 +342,27 @@ int(0)
|
|||
--- testing: 0 >> 9223372036854775806 ---
|
||||
int(0)
|
||||
--- testing: 0 >> 9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 0 >> -9223372036854775807 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 0 >> -9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 1 >> 9223372036854775807 ---
|
||||
int(0)
|
||||
--- testing: 1 >> -9223372036854775808 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 1 >> 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 1 >> -2147483648 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 1 >> 9223372034707292160 ---
|
||||
int(0)
|
||||
--- testing: 1 >> -9223372034707292160 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 1 >> 2147483648 ---
|
||||
int(0)
|
||||
--- testing: 1 >> -2147483649 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 1 >> 4294967294 ---
|
||||
int(0)
|
||||
--- testing: 1 >> 4294967295 ---
|
||||
|
@ -364,27 +372,27 @@ int(0)
|
|||
--- testing: 1 >> 9223372036854775806 ---
|
||||
int(0)
|
||||
--- testing: 1 >> 9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 1 >> -9223372036854775807 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 1 >> -9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -1 >> 9223372036854775807 ---
|
||||
int(-1)
|
||||
--- testing: -1 >> -9223372036854775808 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -1 >> 2147483647 ---
|
||||
int(-1)
|
||||
--- testing: -1 >> -2147483648 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -1 >> 9223372034707292160 ---
|
||||
int(-1)
|
||||
--- testing: -1 >> -9223372034707292160 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -1 >> 2147483648 ---
|
||||
int(-1)
|
||||
--- testing: -1 >> -2147483649 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -1 >> 4294967294 ---
|
||||
int(-1)
|
||||
--- testing: -1 >> 4294967295 ---
|
||||
|
@ -394,27 +402,27 @@ int(-1)
|
|||
--- testing: -1 >> 9223372036854775806 ---
|
||||
int(-1)
|
||||
--- testing: -1 >> 9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -1 >> -9223372036854775807 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -1 >> -9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 7 >> 9223372036854775807 ---
|
||||
int(0)
|
||||
--- testing: 7 >> -9223372036854775808 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 7 >> 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 7 >> -2147483648 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 7 >> 9223372034707292160 ---
|
||||
int(0)
|
||||
--- testing: 7 >> -9223372034707292160 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 7 >> 2147483648 ---
|
||||
int(0)
|
||||
--- testing: 7 >> -2147483649 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 7 >> 4294967294 ---
|
||||
int(0)
|
||||
--- testing: 7 >> 4294967295 ---
|
||||
|
@ -424,27 +432,27 @@ int(0)
|
|||
--- testing: 7 >> 9223372036854775806 ---
|
||||
int(0)
|
||||
--- testing: 7 >> 9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 7 >> -9223372036854775807 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 7 >> -9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9 >> 9223372036854775807 ---
|
||||
int(0)
|
||||
--- testing: 9 >> -9223372036854775808 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9 >> 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 9 >> -2147483648 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9 >> 9223372034707292160 ---
|
||||
int(0)
|
||||
--- testing: 9 >> -9223372034707292160 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9 >> 2147483648 ---
|
||||
int(0)
|
||||
--- testing: 9 >> -2147483649 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9 >> 4294967294 ---
|
||||
int(0)
|
||||
--- testing: 9 >> 4294967295 ---
|
||||
|
@ -454,27 +462,27 @@ int(0)
|
|||
--- testing: 9 >> 9223372036854775806 ---
|
||||
int(0)
|
||||
--- testing: 9 >> 9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9 >> -9223372036854775807 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9 >> -9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 65 >> 9223372036854775807 ---
|
||||
int(0)
|
||||
--- testing: 65 >> -9223372036854775808 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 65 >> 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 65 >> -2147483648 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 65 >> 9223372034707292160 ---
|
||||
int(0)
|
||||
--- testing: 65 >> -9223372034707292160 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 65 >> 2147483648 ---
|
||||
int(0)
|
||||
--- testing: 65 >> -2147483649 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 65 >> 4294967294 ---
|
||||
int(0)
|
||||
--- testing: 65 >> 4294967295 ---
|
||||
|
@ -484,27 +492,27 @@ int(0)
|
|||
--- testing: 65 >> 9223372036854775806 ---
|
||||
int(0)
|
||||
--- testing: 65 >> 9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 65 >> -9223372036854775807 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 65 >> -9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -44 >> 9223372036854775807 ---
|
||||
int(-1)
|
||||
--- testing: -44 >> -9223372036854775808 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -44 >> 2147483647 ---
|
||||
int(-1)
|
||||
--- testing: -44 >> -2147483648 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -44 >> 9223372034707292160 ---
|
||||
int(-1)
|
||||
--- testing: -44 >> -9223372034707292160 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -44 >> 2147483648 ---
|
||||
int(-1)
|
||||
--- testing: -44 >> -2147483649 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -44 >> 4294967294 ---
|
||||
int(-1)
|
||||
--- testing: -44 >> 4294967295 ---
|
||||
|
@ -514,27 +522,27 @@ int(-1)
|
|||
--- testing: -44 >> 9223372036854775806 ---
|
||||
int(-1)
|
||||
--- testing: -44 >> 9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -44 >> -9223372036854775807 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: -44 >> -9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483647 >> 9223372036854775807 ---
|
||||
int(0)
|
||||
--- testing: 2147483647 >> -9223372036854775808 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483647 >> 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 2147483647 >> -2147483648 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483647 >> 9223372034707292160 ---
|
||||
int(0)
|
||||
--- testing: 2147483647 >> -9223372034707292160 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483647 >> 2147483648 ---
|
||||
int(0)
|
||||
--- testing: 2147483647 >> -2147483649 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483647 >> 4294967294 ---
|
||||
int(0)
|
||||
--- testing: 2147483647 >> 4294967295 ---
|
||||
|
@ -544,27 +552,27 @@ int(0)
|
|||
--- testing: 2147483647 >> 9223372036854775806 ---
|
||||
int(0)
|
||||
--- testing: 2147483647 >> 9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483647 >> -9223372036854775807 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 2147483647 >> -9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775807 >> 9223372036854775807 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775807 >> -9223372036854775808 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775807 >> 2147483647 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775807 >> -2147483648 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775807 >> 9223372034707292160 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775807 >> -9223372034707292160 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775807 >> 2147483648 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775807 >> -2147483649 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775807 >> 4294967294 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775807 >> 4294967295 ---
|
||||
|
@ -574,9 +582,9 @@ int(0)
|
|||
--- testing: 9223372036854775807 >> 9223372036854775806 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775807 >> 9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775807 >> -9223372036854775807 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 9223372036854775807 >> -9.2233720368548E+18 ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
===DONE===
|
||||
|
|
|
@ -12,8 +12,12 @@ error_reporting(E_ERROR);
|
|||
|
||||
foreach ($strVals as $strVal) {
|
||||
foreach($strVals as $otherVal) {
|
||||
echo "--- testing: '$strVal' >> '$otherVal' ---\n";
|
||||
var_dump($strVal>>$otherVal);
|
||||
echo "--- testing: '$strVal' >> '$otherVal' ---\n";
|
||||
try {
|
||||
var_dump($strVal>>$otherVal);
|
||||
} catch (Exception $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,11 +30,11 @@ int(0)
|
|||
--- testing: '0' >> '65' ---
|
||||
int(0)
|
||||
--- testing: '0' >> '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '0' >> '1.2' ---
|
||||
int(0)
|
||||
--- testing: '0' >> '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '0' >> 'abc' ---
|
||||
int(0)
|
||||
--- testing: '0' >> '123abc' ---
|
||||
|
@ -54,11 +58,11 @@ int(65)
|
|||
--- testing: '65' >> '65' ---
|
||||
int(0)
|
||||
--- testing: '65' >> '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '65' >> '1.2' ---
|
||||
int(32)
|
||||
--- testing: '65' >> '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '65' >> 'abc' ---
|
||||
int(65)
|
||||
--- testing: '65' >> '123abc' ---
|
||||
|
@ -82,11 +86,11 @@ int(-44)
|
|||
--- testing: '-44' >> '65' ---
|
||||
int(-1)
|
||||
--- testing: '-44' >> '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '-44' >> '1.2' ---
|
||||
int(-22)
|
||||
--- testing: '-44' >> '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '-44' >> 'abc' ---
|
||||
int(-44)
|
||||
--- testing: '-44' >> '123abc' ---
|
||||
|
@ -110,11 +114,11 @@ int(1)
|
|||
--- testing: '1.2' >> '65' ---
|
||||
int(0)
|
||||
--- testing: '1.2' >> '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '1.2' >> '1.2' ---
|
||||
int(0)
|
||||
--- testing: '1.2' >> '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '1.2' >> 'abc' ---
|
||||
int(1)
|
||||
--- testing: '1.2' >> '123abc' ---
|
||||
|
@ -138,11 +142,11 @@ int(-7)
|
|||
--- testing: '-7.7' >> '65' ---
|
||||
int(-1)
|
||||
--- testing: '-7.7' >> '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '-7.7' >> '1.2' ---
|
||||
int(-4)
|
||||
--- testing: '-7.7' >> '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '-7.7' >> 'abc' ---
|
||||
int(-7)
|
||||
--- testing: '-7.7' >> '123abc' ---
|
||||
|
@ -166,11 +170,11 @@ int(0)
|
|||
--- testing: 'abc' >> '65' ---
|
||||
int(0)
|
||||
--- testing: 'abc' >> '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 'abc' >> '1.2' ---
|
||||
int(0)
|
||||
--- testing: 'abc' >> '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 'abc' >> 'abc' ---
|
||||
int(0)
|
||||
--- testing: 'abc' >> '123abc' ---
|
||||
|
@ -194,11 +198,11 @@ int(123)
|
|||
--- testing: '123abc' >> '65' ---
|
||||
int(0)
|
||||
--- testing: '123abc' >> '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123abc' >> '1.2' ---
|
||||
int(61)
|
||||
--- testing: '123abc' >> '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123abc' >> 'abc' ---
|
||||
int(123)
|
||||
--- testing: '123abc' >> '123abc' ---
|
||||
|
@ -222,11 +226,11 @@ int(123)
|
|||
--- testing: '123e5' >> '65' ---
|
||||
int(0)
|
||||
--- testing: '123e5' >> '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123e5' >> '1.2' ---
|
||||
int(61)
|
||||
--- testing: '123e5' >> '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123e5' >> 'abc' ---
|
||||
int(123)
|
||||
--- testing: '123e5' >> '123abc' ---
|
||||
|
@ -250,11 +254,11 @@ int(123)
|
|||
--- testing: '123e5xyz' >> '65' ---
|
||||
int(0)
|
||||
--- testing: '123e5xyz' >> '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123e5xyz' >> '1.2' ---
|
||||
int(61)
|
||||
--- testing: '123e5xyz' >> '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123e5xyz' >> 'abc' ---
|
||||
int(123)
|
||||
--- testing: '123e5xyz' >> '123abc' ---
|
||||
|
@ -278,11 +282,11 @@ int(123)
|
|||
--- testing: ' 123abc' >> '65' ---
|
||||
int(0)
|
||||
--- testing: ' 123abc' >> '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: ' 123abc' >> '1.2' ---
|
||||
int(61)
|
||||
--- testing: ' 123abc' >> '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: ' 123abc' >> 'abc' ---
|
||||
int(123)
|
||||
--- testing: ' 123abc' >> '123abc' ---
|
||||
|
@ -306,11 +310,11 @@ int(123)
|
|||
--- testing: '123 abc' >> '65' ---
|
||||
int(0)
|
||||
--- testing: '123 abc' >> '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123 abc' >> '1.2' ---
|
||||
int(61)
|
||||
--- testing: '123 abc' >> '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123 abc' >> 'abc' ---
|
||||
int(123)
|
||||
--- testing: '123 abc' >> '123abc' ---
|
||||
|
@ -334,11 +338,11 @@ int(123)
|
|||
--- testing: '123abc ' >> '65' ---
|
||||
int(0)
|
||||
--- testing: '123abc ' >> '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123abc ' >> '1.2' ---
|
||||
int(61)
|
||||
--- testing: '123abc ' >> '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '123abc ' >> 'abc' ---
|
||||
int(123)
|
||||
--- testing: '123abc ' >> '123abc' ---
|
||||
|
@ -362,11 +366,11 @@ int(3)
|
|||
--- testing: '3.4a' >> '65' ---
|
||||
int(0)
|
||||
--- testing: '3.4a' >> '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '3.4a' >> '1.2' ---
|
||||
int(1)
|
||||
--- testing: '3.4a' >> '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: '3.4a' >> 'abc' ---
|
||||
int(3)
|
||||
--- testing: '3.4a' >> '123abc' ---
|
||||
|
@ -390,11 +394,11 @@ int(0)
|
|||
--- testing: 'a5.9' >> '65' ---
|
||||
int(0)
|
||||
--- testing: 'a5.9' >> '-44' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 'a5.9' >> '1.2' ---
|
||||
int(0)
|
||||
--- testing: 'a5.9' >> '-7.7' ---
|
||||
bool(false)
|
||||
Exception: Bit shift by negative number
|
||||
--- testing: 'a5.9' >> 'abc' ---
|
||||
int(0)
|
||||
--- testing: 'a5.9' >> '123abc' ---
|
||||
|
|
|
@ -40,7 +40,7 @@ foreach ($otherVals as $otherVal) {
|
|||
===DONE===
|
||||
--EXPECT--
|
||||
--- testing: 9223372036854775807 / 0 ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: 9223372036854775807 / 1 ---
|
||||
int(9223372036854775807)
|
||||
--- testing: 9223372036854775807 / -1 ---
|
||||
|
@ -58,7 +58,7 @@ float(4294967298)
|
|||
--- testing: 9223372036854775807 / 9223372036854775807 ---
|
||||
int(1)
|
||||
--- testing: -9223372036854775808 / 0 ---
|
||||
bool(false)
|
||||
float(-INF)
|
||||
--- testing: -9223372036854775808 / 1 ---
|
||||
int(-9223372036854775808)
|
||||
--- testing: -9223372036854775808 / -1 ---
|
||||
|
@ -76,7 +76,7 @@ float(-4294967298)
|
|||
--- testing: -9223372036854775808 / 9223372036854775807 ---
|
||||
float(-1)
|
||||
--- testing: 2147483647 / 0 ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: 2147483647 / 1 ---
|
||||
int(2147483647)
|
||||
--- testing: 2147483647 / -1 ---
|
||||
|
@ -94,7 +94,7 @@ int(1)
|
|||
--- testing: 2147483647 / 9223372036854775807 ---
|
||||
float(2.3283064354545E-10)
|
||||
--- testing: -2147483648 / 0 ---
|
||||
bool(false)
|
||||
float(-INF)
|
||||
--- testing: -2147483648 / 1 ---
|
||||
int(-2147483648)
|
||||
--- testing: -2147483648 / -1 ---
|
||||
|
@ -112,7 +112,7 @@ float(-1.0000000004657)
|
|||
--- testing: -2147483648 / 9223372036854775807 ---
|
||||
float(-2.3283064365387E-10)
|
||||
--- testing: 9223372034707292160 / 0 ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: 9223372034707292160 / 1 ---
|
||||
int(9223372034707292160)
|
||||
--- testing: 9223372034707292160 / -1 ---
|
||||
|
@ -130,7 +130,7 @@ float(4294967297)
|
|||
--- testing: 9223372034707292160 / 9223372036854775807 ---
|
||||
float(0.99999999976717)
|
||||
--- testing: -9223372034707292160 / 0 ---
|
||||
bool(false)
|
||||
float(-INF)
|
||||
--- testing: -9223372034707292160 / 1 ---
|
||||
int(-9223372034707292160)
|
||||
--- testing: -9223372034707292160 / -1 ---
|
||||
|
@ -148,7 +148,7 @@ float(-4294967297)
|
|||
--- testing: -9223372034707292160 / 9223372036854775807 ---
|
||||
float(-0.99999999976717)
|
||||
--- testing: 2147483648 / 0 ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: 2147483648 / 1 ---
|
||||
int(2147483648)
|
||||
--- testing: 2147483648 / -1 ---
|
||||
|
@ -166,7 +166,7 @@ float(1.0000000004657)
|
|||
--- testing: 2147483648 / 9223372036854775807 ---
|
||||
float(2.3283064365387E-10)
|
||||
--- testing: -2147483649 / 0 ---
|
||||
bool(false)
|
||||
float(-INF)
|
||||
--- testing: -2147483649 / 1 ---
|
||||
int(-2147483649)
|
||||
--- testing: -2147483649 / -1 ---
|
||||
|
@ -184,7 +184,7 @@ float(-1.0000000009313)
|
|||
--- testing: -2147483649 / 9223372036854775807 ---
|
||||
float(-2.3283064376229E-10)
|
||||
--- testing: 4294967294 / 0 ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: 4294967294 / 1 ---
|
||||
int(4294967294)
|
||||
--- testing: 4294967294 / -1 ---
|
||||
|
@ -202,7 +202,7 @@ int(2)
|
|||
--- testing: 4294967294 / 9223372036854775807 ---
|
||||
float(4.656612870909E-10)
|
||||
--- testing: 4294967295 / 0 ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: 4294967295 / 1 ---
|
||||
int(4294967295)
|
||||
--- testing: 4294967295 / -1 ---
|
||||
|
@ -220,7 +220,7 @@ float(2.0000000004657)
|
|||
--- testing: 4294967295 / 9223372036854775807 ---
|
||||
float(4.6566128719932E-10)
|
||||
--- testing: 4294967293 / 0 ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: 4294967293 / 1 ---
|
||||
int(4294967293)
|
||||
--- testing: 4294967293 / -1 ---
|
||||
|
@ -238,7 +238,7 @@ float(1.9999999995343)
|
|||
--- testing: 4294967293 / 9223372036854775807 ---
|
||||
float(4.6566128698248E-10)
|
||||
--- testing: 9223372036854775806 / 0 ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: 9223372036854775806 / 1 ---
|
||||
int(9223372036854775806)
|
||||
--- testing: 9223372036854775806 / -1 ---
|
||||
|
@ -256,7 +256,7 @@ int(4294967298)
|
|||
--- testing: 9223372036854775806 / 9223372036854775807 ---
|
||||
float(1)
|
||||
--- testing: 9.2233720368548E+18 / 0 ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: 9.2233720368548E+18 / 1 ---
|
||||
float(9.2233720368548E+18)
|
||||
--- testing: 9.2233720368548E+18 / -1 ---
|
||||
|
@ -274,7 +274,7 @@ float(4294967298)
|
|||
--- testing: 9.2233720368548E+18 / 9223372036854775807 ---
|
||||
float(1)
|
||||
--- testing: -9223372036854775807 / 0 ---
|
||||
bool(false)
|
||||
float(-INF)
|
||||
--- testing: -9223372036854775807 / 1 ---
|
||||
int(-9223372036854775807)
|
||||
--- testing: -9223372036854775807 / -1 ---
|
||||
|
@ -292,7 +292,7 @@ float(-4294967298)
|
|||
--- testing: -9223372036854775807 / 9223372036854775807 ---
|
||||
int(-1)
|
||||
--- testing: -9.2233720368548E+18 / 0 ---
|
||||
bool(false)
|
||||
float(-INF)
|
||||
--- testing: -9.2233720368548E+18 / 1 ---
|
||||
float(-9.2233720368548E+18)
|
||||
--- testing: -9.2233720368548E+18 / -1 ---
|
||||
|
|
|
@ -22,7 +22,7 @@ foreach ($strVals as $strVal) {
|
|||
===DONE===
|
||||
--EXPECT--
|
||||
--- testing: '0' / '0' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '0' / '65' ---
|
||||
int(0)
|
||||
--- testing: '0' / '-44' ---
|
||||
|
@ -32,7 +32,7 @@ float(0)
|
|||
--- testing: '0' / '-7.7' ---
|
||||
float(-0)
|
||||
--- testing: '0' / 'abc' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '0' / '123abc' ---
|
||||
int(0)
|
||||
--- testing: '0' / '123e5' ---
|
||||
|
@ -48,9 +48,9 @@ int(0)
|
|||
--- testing: '0' / '3.4a' ---
|
||||
float(0)
|
||||
--- testing: '0' / 'a5.9' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '65' / '0' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '65' / '65' ---
|
||||
int(1)
|
||||
--- testing: '65' / '-44' ---
|
||||
|
@ -60,7 +60,7 @@ float(54.166666666667)
|
|||
--- testing: '65' / '-7.7' ---
|
||||
float(-8.4415584415584)
|
||||
--- testing: '65' / 'abc' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '65' / '123abc' ---
|
||||
float(0.52845528455285)
|
||||
--- testing: '65' / '123e5' ---
|
||||
|
@ -76,9 +76,9 @@ float(0.52845528455285)
|
|||
--- testing: '65' / '3.4a' ---
|
||||
float(19.117647058824)
|
||||
--- testing: '65' / 'a5.9' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '-44' / '0' ---
|
||||
bool(false)
|
||||
float(-INF)
|
||||
--- testing: '-44' / '65' ---
|
||||
float(-0.67692307692308)
|
||||
--- testing: '-44' / '-44' ---
|
||||
|
@ -88,7 +88,7 @@ float(-36.666666666667)
|
|||
--- testing: '-44' / '-7.7' ---
|
||||
float(5.7142857142857)
|
||||
--- testing: '-44' / 'abc' ---
|
||||
bool(false)
|
||||
float(-INF)
|
||||
--- testing: '-44' / '123abc' ---
|
||||
float(-0.35772357723577)
|
||||
--- testing: '-44' / '123e5' ---
|
||||
|
@ -104,9 +104,9 @@ float(-0.35772357723577)
|
|||
--- testing: '-44' / '3.4a' ---
|
||||
float(-12.941176470588)
|
||||
--- testing: '-44' / 'a5.9' ---
|
||||
bool(false)
|
||||
float(-INF)
|
||||
--- testing: '1.2' / '0' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '1.2' / '65' ---
|
||||
float(0.018461538461538)
|
||||
--- testing: '1.2' / '-44' ---
|
||||
|
@ -116,7 +116,7 @@ float(1)
|
|||
--- testing: '1.2' / '-7.7' ---
|
||||
float(-0.15584415584416)
|
||||
--- testing: '1.2' / 'abc' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '1.2' / '123abc' ---
|
||||
float(0.0097560975609756)
|
||||
--- testing: '1.2' / '123e5' ---
|
||||
|
@ -132,9 +132,9 @@ float(0.0097560975609756)
|
|||
--- testing: '1.2' / '3.4a' ---
|
||||
float(0.35294117647059)
|
||||
--- testing: '1.2' / 'a5.9' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '-7.7' / '0' ---
|
||||
bool(false)
|
||||
float(-INF)
|
||||
--- testing: '-7.7' / '65' ---
|
||||
float(-0.11846153846154)
|
||||
--- testing: '-7.7' / '-44' ---
|
||||
|
@ -144,7 +144,7 @@ float(-6.4166666666667)
|
|||
--- testing: '-7.7' / '-7.7' ---
|
||||
float(1)
|
||||
--- testing: '-7.7' / 'abc' ---
|
||||
bool(false)
|
||||
float(-INF)
|
||||
--- testing: '-7.7' / '123abc' ---
|
||||
float(-0.06260162601626)
|
||||
--- testing: '-7.7' / '123e5' ---
|
||||
|
@ -160,9 +160,9 @@ float(-0.06260162601626)
|
|||
--- testing: '-7.7' / '3.4a' ---
|
||||
float(-2.2647058823529)
|
||||
--- testing: '-7.7' / 'a5.9' ---
|
||||
bool(false)
|
||||
float(-INF)
|
||||
--- testing: 'abc' / '0' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: 'abc' / '65' ---
|
||||
int(0)
|
||||
--- testing: 'abc' / '-44' ---
|
||||
|
@ -172,7 +172,7 @@ float(0)
|
|||
--- testing: 'abc' / '-7.7' ---
|
||||
float(-0)
|
||||
--- testing: 'abc' / 'abc' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: 'abc' / '123abc' ---
|
||||
int(0)
|
||||
--- testing: 'abc' / '123e5' ---
|
||||
|
@ -188,9 +188,9 @@ int(0)
|
|||
--- testing: 'abc' / '3.4a' ---
|
||||
float(0)
|
||||
--- testing: 'abc' / 'a5.9' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '123abc' / '0' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '123abc' / '65' ---
|
||||
float(1.8923076923077)
|
||||
--- testing: '123abc' / '-44' ---
|
||||
|
@ -200,7 +200,7 @@ float(102.5)
|
|||
--- testing: '123abc' / '-7.7' ---
|
||||
float(-15.974025974026)
|
||||
--- testing: '123abc' / 'abc' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '123abc' / '123abc' ---
|
||||
int(1)
|
||||
--- testing: '123abc' / '123e5' ---
|
||||
|
@ -216,9 +216,9 @@ int(1)
|
|||
--- testing: '123abc' / '3.4a' ---
|
||||
float(36.176470588235)
|
||||
--- testing: '123abc' / 'a5.9' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '123e5' / '0' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '123e5' / '65' ---
|
||||
float(189230.76923077)
|
||||
--- testing: '123e5' / '-44' ---
|
||||
|
@ -228,7 +228,7 @@ float(10250000)
|
|||
--- testing: '123e5' / '-7.7' ---
|
||||
float(-1597402.5974026)
|
||||
--- testing: '123e5' / 'abc' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '123e5' / '123abc' ---
|
||||
float(100000)
|
||||
--- testing: '123e5' / '123e5' ---
|
||||
|
@ -244,9 +244,9 @@ float(100000)
|
|||
--- testing: '123e5' / '3.4a' ---
|
||||
float(3617647.0588235)
|
||||
--- testing: '123e5' / 'a5.9' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '123e5xyz' / '0' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '123e5xyz' / '65' ---
|
||||
float(189230.76923077)
|
||||
--- testing: '123e5xyz' / '-44' ---
|
||||
|
@ -256,7 +256,7 @@ float(10250000)
|
|||
--- testing: '123e5xyz' / '-7.7' ---
|
||||
float(-1597402.5974026)
|
||||
--- testing: '123e5xyz' / 'abc' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '123e5xyz' / '123abc' ---
|
||||
float(100000)
|
||||
--- testing: '123e5xyz' / '123e5' ---
|
||||
|
@ -272,9 +272,9 @@ float(100000)
|
|||
--- testing: '123e5xyz' / '3.4a' ---
|
||||
float(3617647.0588235)
|
||||
--- testing: '123e5xyz' / 'a5.9' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: ' 123abc' / '0' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: ' 123abc' / '65' ---
|
||||
float(1.8923076923077)
|
||||
--- testing: ' 123abc' / '-44' ---
|
||||
|
@ -284,7 +284,7 @@ float(102.5)
|
|||
--- testing: ' 123abc' / '-7.7' ---
|
||||
float(-15.974025974026)
|
||||
--- testing: ' 123abc' / 'abc' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: ' 123abc' / '123abc' ---
|
||||
int(1)
|
||||
--- testing: ' 123abc' / '123e5' ---
|
||||
|
@ -300,9 +300,9 @@ int(1)
|
|||
--- testing: ' 123abc' / '3.4a' ---
|
||||
float(36.176470588235)
|
||||
--- testing: ' 123abc' / 'a5.9' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '123 abc' / '0' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '123 abc' / '65' ---
|
||||
float(1.8923076923077)
|
||||
--- testing: '123 abc' / '-44' ---
|
||||
|
@ -312,7 +312,7 @@ float(102.5)
|
|||
--- testing: '123 abc' / '-7.7' ---
|
||||
float(-15.974025974026)
|
||||
--- testing: '123 abc' / 'abc' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '123 abc' / '123abc' ---
|
||||
int(1)
|
||||
--- testing: '123 abc' / '123e5' ---
|
||||
|
@ -328,9 +328,9 @@ int(1)
|
|||
--- testing: '123 abc' / '3.4a' ---
|
||||
float(36.176470588235)
|
||||
--- testing: '123 abc' / 'a5.9' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '123abc ' / '0' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '123abc ' / '65' ---
|
||||
float(1.8923076923077)
|
||||
--- testing: '123abc ' / '-44' ---
|
||||
|
@ -340,7 +340,7 @@ float(102.5)
|
|||
--- testing: '123abc ' / '-7.7' ---
|
||||
float(-15.974025974026)
|
||||
--- testing: '123abc ' / 'abc' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '123abc ' / '123abc' ---
|
||||
int(1)
|
||||
--- testing: '123abc ' / '123e5' ---
|
||||
|
@ -356,9 +356,9 @@ int(1)
|
|||
--- testing: '123abc ' / '3.4a' ---
|
||||
float(36.176470588235)
|
||||
--- testing: '123abc ' / 'a5.9' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '3.4a' / '0' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '3.4a' / '65' ---
|
||||
float(0.052307692307692)
|
||||
--- testing: '3.4a' / '-44' ---
|
||||
|
@ -368,7 +368,7 @@ float(2.8333333333333)
|
|||
--- testing: '3.4a' / '-7.7' ---
|
||||
float(-0.44155844155844)
|
||||
--- testing: '3.4a' / 'abc' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: '3.4a' / '123abc' ---
|
||||
float(0.027642276422764)
|
||||
--- testing: '3.4a' / '123e5' ---
|
||||
|
@ -384,9 +384,9 @@ float(0.027642276422764)
|
|||
--- testing: '3.4a' / '3.4a' ---
|
||||
float(1)
|
||||
--- testing: '3.4a' / 'a5.9' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: 'a5.9' / '0' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: 'a5.9' / '65' ---
|
||||
int(0)
|
||||
--- testing: 'a5.9' / '-44' ---
|
||||
|
@ -396,7 +396,7 @@ float(0)
|
|||
--- testing: 'a5.9' / '-7.7' ---
|
||||
float(-0)
|
||||
--- testing: 'a5.9' / 'abc' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
--- testing: 'a5.9' / '123abc' ---
|
||||
int(0)
|
||||
--- testing: 'a5.9' / '123e5' ---
|
||||
|
@ -412,5 +412,5 @@ int(0)
|
|||
--- testing: 'a5.9' / '3.4a' ---
|
||||
float(0)
|
||||
--- testing: 'a5.9' / 'a5.9' ---
|
||||
bool(false)
|
||||
float(INF)
|
||||
===DONE===
|
||||
|
|
|
@ -24,15 +24,23 @@ error_reporting(E_ERROR);
|
|||
|
||||
foreach ($longVals as $longVal) {
|
||||
foreach($otherVals as $otherVal) {
|
||||
echo "--- testing: $longVal % $otherVal ---\n";
|
||||
var_dump($longVal%$otherVal);
|
||||
echo "--- testing: $longVal % $otherVal ---\n";
|
||||
try {
|
||||
var_dump($longVal%$otherVal);
|
||||
} catch (Exception $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($otherVals as $otherVal) {
|
||||
foreach($longVals as $longVal) {
|
||||
echo "--- testing: $otherVal % $longVal ---\n";
|
||||
var_dump($otherVal%$longVal);
|
||||
echo "--- testing: $otherVal % $longVal ---\n";
|
||||
try {
|
||||
var_dump($otherVal%$longVal);
|
||||
} catch (Exception $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,7 +48,7 @@ foreach ($otherVals as $otherVal) {
|
|||
===DONE===
|
||||
--EXPECT--
|
||||
--- testing: 9223372036854775807 % 0 ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: 9223372036854775807 % 1 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775807 % -1 ---
|
||||
|
@ -58,7 +66,7 @@ int(1)
|
|||
--- testing: 9223372036854775807 % 9223372036854775807 ---
|
||||
int(0)
|
||||
--- testing: -9223372036854775808 % 0 ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: -9223372036854775808 % 1 ---
|
||||
int(0)
|
||||
--- testing: -9223372036854775808 % -1 ---
|
||||
|
@ -76,7 +84,7 @@ int(-2)
|
|||
--- testing: -9223372036854775808 % 9223372036854775807 ---
|
||||
int(-1)
|
||||
--- testing: 2147483647 % 0 ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: 2147483647 % 1 ---
|
||||
int(0)
|
||||
--- testing: 2147483647 % -1 ---
|
||||
|
@ -94,7 +102,7 @@ int(0)
|
|||
--- testing: 2147483647 % 9223372036854775807 ---
|
||||
int(2147483647)
|
||||
--- testing: -2147483648 % 0 ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: -2147483648 % 1 ---
|
||||
int(0)
|
||||
--- testing: -2147483648 % -1 ---
|
||||
|
@ -112,7 +120,7 @@ int(-1)
|
|||
--- testing: -2147483648 % 9223372036854775807 ---
|
||||
int(-2147483648)
|
||||
--- testing: 9223372034707292160 % 0 ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: 9223372034707292160 % 1 ---
|
||||
int(0)
|
||||
--- testing: 9223372034707292160 % -1 ---
|
||||
|
@ -130,7 +138,7 @@ int(1)
|
|||
--- testing: 9223372034707292160 % 9223372036854775807 ---
|
||||
int(9223372034707292160)
|
||||
--- testing: -9223372034707292160 % 0 ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: -9223372034707292160 % 1 ---
|
||||
int(0)
|
||||
--- testing: -9223372034707292160 % -1 ---
|
||||
|
@ -148,7 +156,7 @@ int(-1)
|
|||
--- testing: -9223372034707292160 % 9223372036854775807 ---
|
||||
int(-9223372034707292160)
|
||||
--- testing: 2147483648 % 0 ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: 2147483648 % 1 ---
|
||||
int(0)
|
||||
--- testing: 2147483648 % -1 ---
|
||||
|
@ -166,7 +174,7 @@ int(1)
|
|||
--- testing: 2147483648 % 9223372036854775807 ---
|
||||
int(2147483648)
|
||||
--- testing: -2147483649 % 0 ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: -2147483649 % 1 ---
|
||||
int(0)
|
||||
--- testing: -2147483649 % -1 ---
|
||||
|
@ -184,7 +192,7 @@ int(-2)
|
|||
--- testing: -2147483649 % 9223372036854775807 ---
|
||||
int(-2147483649)
|
||||
--- testing: 4294967294 % 0 ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: 4294967294 % 1 ---
|
||||
int(0)
|
||||
--- testing: 4294967294 % -1 ---
|
||||
|
@ -202,7 +210,7 @@ int(0)
|
|||
--- testing: 4294967294 % 9223372036854775807 ---
|
||||
int(4294967294)
|
||||
--- testing: 4294967295 % 0 ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: 4294967295 % 1 ---
|
||||
int(0)
|
||||
--- testing: 4294967295 % -1 ---
|
||||
|
@ -220,7 +228,7 @@ int(1)
|
|||
--- testing: 4294967295 % 9223372036854775807 ---
|
||||
int(4294967295)
|
||||
--- testing: 4294967293 % 0 ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: 4294967293 % 1 ---
|
||||
int(0)
|
||||
--- testing: 4294967293 % -1 ---
|
||||
|
@ -238,7 +246,7 @@ int(2147483646)
|
|||
--- testing: 4294967293 % 9223372036854775807 ---
|
||||
int(4294967293)
|
||||
--- testing: 9223372036854775806 % 0 ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: 9223372036854775806 % 1 ---
|
||||
int(0)
|
||||
--- testing: 9223372036854775806 % -1 ---
|
||||
|
@ -256,7 +264,7 @@ int(0)
|
|||
--- testing: 9223372036854775806 % 9223372036854775807 ---
|
||||
int(9223372036854775806)
|
||||
--- testing: 9.2233720368548E+18 % 0 ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: 9.2233720368548E+18 % 1 ---
|
||||
int(0)
|
||||
--- testing: 9.2233720368548E+18 % -1 ---
|
||||
|
@ -274,7 +282,7 @@ int(-2)
|
|||
--- testing: 9.2233720368548E+18 % 9223372036854775807 ---
|
||||
int(-1)
|
||||
--- testing: -9223372036854775807 % 0 ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: -9223372036854775807 % 1 ---
|
||||
int(0)
|
||||
--- testing: -9223372036854775807 % -1 ---
|
||||
|
@ -292,7 +300,7 @@ int(-1)
|
|||
--- testing: -9223372036854775807 % 9223372036854775807 ---
|
||||
int(0)
|
||||
--- testing: -9.2233720368548E+18 % 0 ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: -9.2233720368548E+18 % 1 ---
|
||||
int(0)
|
||||
--- testing: -9.2233720368548E+18 % -1 ---
|
||||
|
|
|
@ -12,8 +12,12 @@ error_reporting(E_ERROR);
|
|||
|
||||
foreach ($strVals as $strVal) {
|
||||
foreach($strVals as $otherVal) {
|
||||
echo "--- testing: '$strVal' % '$otherVal' ---\n";
|
||||
var_dump($strVal%$otherVal);
|
||||
echo "--- testing: '$strVal' % '$otherVal' ---\n";
|
||||
try {
|
||||
var_dump($strVal%$otherVal);
|
||||
} catch (Exception $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,7 +26,7 @@ foreach ($strVals as $strVal) {
|
|||
===DONE===
|
||||
--EXPECT--
|
||||
--- testing: '0' % '0' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '0' % '65' ---
|
||||
int(0)
|
||||
--- testing: '0' % '-44' ---
|
||||
|
@ -32,7 +36,7 @@ int(0)
|
|||
--- testing: '0' % '-7.7' ---
|
||||
int(0)
|
||||
--- testing: '0' % 'abc' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '0' % '123abc' ---
|
||||
int(0)
|
||||
--- testing: '0' % '123e5' ---
|
||||
|
@ -48,9 +52,9 @@ int(0)
|
|||
--- testing: '0' % '3.4a' ---
|
||||
int(0)
|
||||
--- testing: '0' % 'a5.9' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '65' % '0' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '65' % '65' ---
|
||||
int(0)
|
||||
--- testing: '65' % '-44' ---
|
||||
|
@ -60,7 +64,7 @@ int(0)
|
|||
--- testing: '65' % '-7.7' ---
|
||||
int(2)
|
||||
--- testing: '65' % 'abc' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '65' % '123abc' ---
|
||||
int(65)
|
||||
--- testing: '65' % '123e5' ---
|
||||
|
@ -76,9 +80,9 @@ int(65)
|
|||
--- testing: '65' % '3.4a' ---
|
||||
int(2)
|
||||
--- testing: '65' % 'a5.9' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '-44' % '0' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '-44' % '65' ---
|
||||
int(-44)
|
||||
--- testing: '-44' % '-44' ---
|
||||
|
@ -88,7 +92,7 @@ int(0)
|
|||
--- testing: '-44' % '-7.7' ---
|
||||
int(-2)
|
||||
--- testing: '-44' % 'abc' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '-44' % '123abc' ---
|
||||
int(-44)
|
||||
--- testing: '-44' % '123e5' ---
|
||||
|
@ -104,9 +108,9 @@ int(-44)
|
|||
--- testing: '-44' % '3.4a' ---
|
||||
int(-2)
|
||||
--- testing: '-44' % 'a5.9' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '1.2' % '0' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '1.2' % '65' ---
|
||||
int(1)
|
||||
--- testing: '1.2' % '-44' ---
|
||||
|
@ -116,7 +120,7 @@ int(0)
|
|||
--- testing: '1.2' % '-7.7' ---
|
||||
int(1)
|
||||
--- testing: '1.2' % 'abc' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '1.2' % '123abc' ---
|
||||
int(1)
|
||||
--- testing: '1.2' % '123e5' ---
|
||||
|
@ -132,9 +136,9 @@ int(1)
|
|||
--- testing: '1.2' % '3.4a' ---
|
||||
int(1)
|
||||
--- testing: '1.2' % 'a5.9' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '-7.7' % '0' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '-7.7' % '65' ---
|
||||
int(-7)
|
||||
--- testing: '-7.7' % '-44' ---
|
||||
|
@ -144,7 +148,7 @@ int(0)
|
|||
--- testing: '-7.7' % '-7.7' ---
|
||||
int(0)
|
||||
--- testing: '-7.7' % 'abc' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '-7.7' % '123abc' ---
|
||||
int(-7)
|
||||
--- testing: '-7.7' % '123e5' ---
|
||||
|
@ -160,9 +164,9 @@ int(-7)
|
|||
--- testing: '-7.7' % '3.4a' ---
|
||||
int(-1)
|
||||
--- testing: '-7.7' % 'a5.9' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: 'abc' % '0' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: 'abc' % '65' ---
|
||||
int(0)
|
||||
--- testing: 'abc' % '-44' ---
|
||||
|
@ -172,7 +176,7 @@ int(0)
|
|||
--- testing: 'abc' % '-7.7' ---
|
||||
int(0)
|
||||
--- testing: 'abc' % 'abc' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: 'abc' % '123abc' ---
|
||||
int(0)
|
||||
--- testing: 'abc' % '123e5' ---
|
||||
|
@ -188,9 +192,9 @@ int(0)
|
|||
--- testing: 'abc' % '3.4a' ---
|
||||
int(0)
|
||||
--- testing: 'abc' % 'a5.9' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '123abc' % '0' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '123abc' % '65' ---
|
||||
int(58)
|
||||
--- testing: '123abc' % '-44' ---
|
||||
|
@ -200,7 +204,7 @@ int(0)
|
|||
--- testing: '123abc' % '-7.7' ---
|
||||
int(4)
|
||||
--- testing: '123abc' % 'abc' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '123abc' % '123abc' ---
|
||||
int(0)
|
||||
--- testing: '123abc' % '123e5' ---
|
||||
|
@ -216,9 +220,9 @@ int(0)
|
|||
--- testing: '123abc' % '3.4a' ---
|
||||
int(0)
|
||||
--- testing: '123abc' % 'a5.9' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '123e5' % '0' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '123e5' % '65' ---
|
||||
int(58)
|
||||
--- testing: '123e5' % '-44' ---
|
||||
|
@ -228,7 +232,7 @@ int(0)
|
|||
--- testing: '123e5' % '-7.7' ---
|
||||
int(4)
|
||||
--- testing: '123e5' % 'abc' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '123e5' % '123abc' ---
|
||||
int(0)
|
||||
--- testing: '123e5' % '123e5' ---
|
||||
|
@ -244,9 +248,9 @@ int(0)
|
|||
--- testing: '123e5' % '3.4a' ---
|
||||
int(0)
|
||||
--- testing: '123e5' % 'a5.9' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '123e5xyz' % '0' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '123e5xyz' % '65' ---
|
||||
int(58)
|
||||
--- testing: '123e5xyz' % '-44' ---
|
||||
|
@ -256,7 +260,7 @@ int(0)
|
|||
--- testing: '123e5xyz' % '-7.7' ---
|
||||
int(4)
|
||||
--- testing: '123e5xyz' % 'abc' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '123e5xyz' % '123abc' ---
|
||||
int(0)
|
||||
--- testing: '123e5xyz' % '123e5' ---
|
||||
|
@ -272,9 +276,9 @@ int(0)
|
|||
--- testing: '123e5xyz' % '3.4a' ---
|
||||
int(0)
|
||||
--- testing: '123e5xyz' % 'a5.9' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: ' 123abc' % '0' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: ' 123abc' % '65' ---
|
||||
int(58)
|
||||
--- testing: ' 123abc' % '-44' ---
|
||||
|
@ -284,7 +288,7 @@ int(0)
|
|||
--- testing: ' 123abc' % '-7.7' ---
|
||||
int(4)
|
||||
--- testing: ' 123abc' % 'abc' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: ' 123abc' % '123abc' ---
|
||||
int(0)
|
||||
--- testing: ' 123abc' % '123e5' ---
|
||||
|
@ -300,9 +304,9 @@ int(0)
|
|||
--- testing: ' 123abc' % '3.4a' ---
|
||||
int(0)
|
||||
--- testing: ' 123abc' % 'a5.9' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '123 abc' % '0' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '123 abc' % '65' ---
|
||||
int(58)
|
||||
--- testing: '123 abc' % '-44' ---
|
||||
|
@ -312,7 +316,7 @@ int(0)
|
|||
--- testing: '123 abc' % '-7.7' ---
|
||||
int(4)
|
||||
--- testing: '123 abc' % 'abc' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '123 abc' % '123abc' ---
|
||||
int(0)
|
||||
--- testing: '123 abc' % '123e5' ---
|
||||
|
@ -328,9 +332,9 @@ int(0)
|
|||
--- testing: '123 abc' % '3.4a' ---
|
||||
int(0)
|
||||
--- testing: '123 abc' % 'a5.9' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '123abc ' % '0' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '123abc ' % '65' ---
|
||||
int(58)
|
||||
--- testing: '123abc ' % '-44' ---
|
||||
|
@ -340,7 +344,7 @@ int(0)
|
|||
--- testing: '123abc ' % '-7.7' ---
|
||||
int(4)
|
||||
--- testing: '123abc ' % 'abc' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '123abc ' % '123abc' ---
|
||||
int(0)
|
||||
--- testing: '123abc ' % '123e5' ---
|
||||
|
@ -356,9 +360,9 @@ int(0)
|
|||
--- testing: '123abc ' % '3.4a' ---
|
||||
int(0)
|
||||
--- testing: '123abc ' % 'a5.9' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '3.4a' % '0' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '3.4a' % '65' ---
|
||||
int(3)
|
||||
--- testing: '3.4a' % '-44' ---
|
||||
|
@ -368,7 +372,7 @@ int(0)
|
|||
--- testing: '3.4a' % '-7.7' ---
|
||||
int(3)
|
||||
--- testing: '3.4a' % 'abc' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: '3.4a' % '123abc' ---
|
||||
int(3)
|
||||
--- testing: '3.4a' % '123e5' ---
|
||||
|
@ -384,9 +388,9 @@ int(3)
|
|||
--- testing: '3.4a' % '3.4a' ---
|
||||
int(0)
|
||||
--- testing: '3.4a' % 'a5.9' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: 'a5.9' % '0' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: 'a5.9' % '65' ---
|
||||
int(0)
|
||||
--- testing: 'a5.9' % '-44' ---
|
||||
|
@ -396,7 +400,7 @@ int(0)
|
|||
--- testing: 'a5.9' % '-7.7' ---
|
||||
int(0)
|
||||
--- testing: 'a5.9' % 'abc' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
--- testing: 'a5.9' % '123abc' ---
|
||||
int(0)
|
||||
--- testing: 'a5.9' % '123e5' ---
|
||||
|
@ -412,5 +416,5 @@ int(0)
|
|||
--- testing: 'a5.9' % '3.4a' ---
|
||||
int(0)
|
||||
--- testing: 'a5.9' % 'a5.9' ---
|
||||
bool(false)
|
||||
Exception: Division by zero
|
||||
===DONE===
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue