Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: php/php-src
base: master
...
head fork: DaveRandom/php-src
compare: string_bitwise_shifts
  • 1 commit
  • 6 files changed
  • 0 commit comments
  • 1 contributor
100 Zend/zend_operators.c
View
@@ -1360,9 +1360,55 @@ ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /
if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) {
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_SL);
+ zendi_convert_to_long(op2, op2_copy, result);
+
+ if (Z_TYPE_P(op1) == IS_STRING) {
+ int skip, copylen;
+ unsigned char offsetl;
+ char *output;
+
+ if (Z_LVAL_P(op2) < 0) {
+ zend_error(E_NOTICE, "Invalid right operand for left shift operation: %d", Z_LVAL_P(op2));
+ ZVAL_STRINGL(result, Z_STRVAL_P(op1), Z_STRLEN_P(op1), 1);
+ return SUCCESS;
+ }
+
+ skip = Z_LVAL_P(op2) / 8;
+ copylen = Z_STRLEN_P(op1) - skip;
+
+ output = emalloc((size_t) Z_STRLEN_P(op1) + 1);
+
+ if (copylen <= 0) {
+ memset(output, 0, Z_STRLEN_P(op1) + 1);
+ ZVAL_STRINGL(result, output, Z_STRLEN_P(op1), 0);
+ return SUCCESS;
+ }
+
+ offsetl = Z_LVAL_P(op2) % 8;
+ memset(output + copylen, 0, skip + 1);
+
+ if (offsetl == 8) {
+ memcpy(output, Z_STRVAL_P(op1) + skip, copylen);
+ } else {
+ int i;
+ unsigned char offsetr, mask;
+ char *input;
+
+ offsetr = 8 - offsetl;
+ mask = ~(0xff >> offsetl);
+ input = Z_STRVAL_P(op1);
+
+ for (i = 0; i < copylen; i++) {
+ output[i] = (input[i + skip] << offsetl) | ((input[i + skip + 1] & mask) >> offsetr);
+ }
+ }
+
+ ZVAL_STRINGL(result, output, Z_STRLEN_P(op1), 0);
+ return SUCCESS;
+ }
+
zendi_convert_to_long(op1, op1_copy, result);
op1_lval = Z_LVAL_P(op1);
- zendi_convert_to_long(op2, op2_copy, result);
} else {
op1_lval = Z_LVAL_P(op1);
}
@@ -1380,9 +1426,59 @@ ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) {
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_SR);
+ zendi_convert_to_long(op2, op2_copy, result);
+
+ if (Z_TYPE_P(op1) == IS_STRING) {
+ int skip, copylen;
+ unsigned char offsetr, signbits;
+ char *input, *output;
+
+ if (Z_LVAL_P(op2) < 0) {
+ zend_error(E_NOTICE, "Invalid right operand for right shift operation: %d", Z_LVAL_P(op2));
+ ZVAL_STRINGL(result, Z_STRVAL_P(op1), Z_STRLEN_P(op1), 1);
+ return SUCCESS;
+ }
+
+ skip = Z_LVAL_P(op2) / 8;
+ copylen = Z_STRLEN_P(op1) - skip;
+
+ input = Z_STRVAL_P(op1);
+ signbits = (input[0] & 0x80) == 0 ? 0 : 255;
+
+ output = emalloc((size_t) Z_STRLEN_P(op1) + 1);
+ if (copylen <= 0) {
+ memset(output, signbits, Z_STRLEN_P(op1) + 1);
+ ZVAL_STRINGL(result, output, Z_STRLEN_P(op1), 0);
+ return SUCCESS;
+ }
+
+ offsetr = Z_LVAL_P(op2) % 8;
+
+ output[Z_STRLEN_P(op1)] = 0;
+ memset(output, signbits, skip);
+
+ if (offsetr == 8) {
+ memcpy(output + skip, Z_STRVAL_P(op1), copylen);
+ } else {
+ int i, l;
+ unsigned char offsetl, mask;
+
+ offsetl = 8 - offsetr;
+ mask = ~(0xff >> offsetl);
+
+ output[skip] = (signbits & ~(0xff >> offsetl)) | (input[0] >> offsetr);
+
+ for (i = skip + 1, l = skip + copylen; i < l; i++) {
+ output[i] = (input[(i - skip) - 1] << offsetl) | ((input[i - skip] & mask) >> offsetr);
+ }
+ }
+
+ ZVAL_STRINGL(result, output, Z_STRLEN_P(op1), 0);
+ return SUCCESS;
+ }
+
zendi_convert_to_long(op1, op1_copy, result);
op1_lval = Z_LVAL_P(op1);
- zendi_convert_to_long(op2, op2_copy, result);
} else {
op1_lval = Z_LVAL_P(op1);
}
429 tests/lang/operators/bitwiseShiftLeft_variationStr.phpt
View
@@ -24,398 +24,453 @@ foreach ($strVals as $strVal) {
?>
===DONE===
---EXPECT--
+--EXPECTF--
--- testing: '0' << '0' ---
string(2) "30"
--- testing: '0' << '65' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' << '-44' ---
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
string(2) "30"
--- testing: '0' << '1.2' ---
-string(2) "30"
+string(2) "60"
--- testing: '0' << '-7.7' ---
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
string(2) "30"
--- testing: '0' << 'abc' ---
string(2) "30"
--- testing: '0' << '123abc' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' << '123e5' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' << '123e5xyz' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' << ' 123abc' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' << '123 abc' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' << '123abc ' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' << '3.4a' ---
-string(2) "30"
+string(2) "80"
--- testing: '0' << 'a5.9' ---
string(2) "30"
--- testing: '65' << '0' ---
string(4) "3635"
--- testing: '65' << '65' ---
-string(6) "313330"
+string(4) "0000"
--- testing: '65' << '-44' ---
-string(16) "3638313537343430"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(4) "3635"
--- testing: '65' << '1.2' ---
-string(6) "313330"
+string(4) "6c6a"
--- testing: '65' << '-7.7' ---
-string(22) "2d32313133393239323136"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(4) "3635"
--- testing: '65' << 'abc' ---
string(4) "3635"
--- testing: '65' << '123abc' ---
-string(18) "313334323137373238"
+string(4) "0000"
--- testing: '65' << '123e5' ---
-string(18) "313334323137373238"
+string(4) "0000"
--- testing: '65' << '123e5xyz' ---
-string(18) "313334323137373238"
+string(4) "0000"
--- testing: '65' << ' 123abc' ---
-string(18) "313334323137373238"
+string(4) "0000"
--- testing: '65' << '123 abc' ---
-string(18) "313334323137373238"
+string(4) "0000"
--- testing: '65' << '123abc ' ---
-string(18) "313334323137373238"
+string(4) "0000"
--- testing: '65' << '3.4a' ---
-string(6) "353230"
+string(4) "b1a8"
--- testing: '65' << 'a5.9' ---
string(4) "3635"
--- testing: '-44' << '0' ---
string(6) "2d3434"
--- testing: '-44' << '65' ---
-string(6) "2d3838"
+string(6) "000000"
--- testing: '-44' << '-44' ---
-string(18) "2d3436313337333434"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(6) "2d3434"
--- testing: '-44' << '1.2' ---
-string(6) "2d3838"
+string(6) "5a6868"
--- testing: '-44' << '-7.7' ---
-string(22) "2d31343736333935303038"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(6) "2d3434"
--- testing: '-44' << 'abc' ---
string(6) "2d3434"
--- testing: '-44' << '123abc' ---
-string(22) "2d31363130363132373336"
+string(6) "000000"
--- testing: '-44' << '123e5' ---
-string(22) "2d31363130363132373336"
+string(6) "000000"
--- testing: '-44' << '123e5xyz' ---
-string(22) "2d31363130363132373336"
+string(6) "000000"
--- testing: '-44' << ' 123abc' ---
-string(22) "2d31363130363132373336"
+string(6) "000000"
--- testing: '-44' << '123 abc' ---
-string(22) "2d31363130363132373336"
+string(6) "000000"
--- testing: '-44' << '123abc ' ---
-string(22) "2d31363130363132373336"
+string(6) "000000"
--- testing: '-44' << '3.4a' ---
-string(8) "2d333532"
+string(6) "69a1a0"
--- testing: '-44' << 'a5.9' ---
string(6) "2d3434"
--- testing: '1.2' << '0' ---
-string(2) "31"
+string(6) "312e32"
--- testing: '1.2' << '65' ---
-string(2) "32"
+string(6) "000000"
--- testing: '1.2' << '-44' ---
-string(14) "31303438353736"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(6) "312e32"
--- testing: '1.2' << '1.2' ---
-string(2) "32"
+string(6) "625c64"
--- testing: '1.2' << '-7.7' ---
-string(16) "3333353534343332"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(6) "312e32"
--- testing: '1.2' << 'abc' ---
-string(2) "31"
+string(6) "312e32"
--- testing: '1.2' << '123abc' ---
-string(18) "313334323137373238"
+string(6) "000000"
--- testing: '1.2' << '123e5' ---
-string(18) "313334323137373238"
+string(6) "000000"
--- testing: '1.2' << '123e5xyz' ---
-string(18) "313334323137373238"
+string(6) "000000"
--- testing: '1.2' << ' 123abc' ---
-string(18) "313334323137373238"
+string(6) "000000"
--- testing: '1.2' << '123 abc' ---
-string(18) "313334323137373238"
+string(6) "000000"
--- testing: '1.2' << '123abc ' ---
-string(18) "313334323137373238"
+string(6) "000000"
--- testing: '1.2' << '3.4a' ---
-string(2) "38"
+string(6) "897190"
--- testing: '1.2' << 'a5.9' ---
-string(2) "31"
+string(6) "312e32"
--- testing: '-7.7' << '0' ---
-string(4) "2d37"
+string(8) "2d372e37"
--- testing: '-7.7' << '65' ---
-string(6) "2d3134"
+string(8) "00000000"
--- testing: '-7.7' << '-44' ---
-string(16) "2d37333430303332"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(8) "2d372e37"
--- testing: '-7.7' << '1.2' ---
-string(6) "2d3134"
+string(8) "5a6e5c6e"
--- testing: '-7.7' << '-7.7' ---
-string(20) "2d323334383831303234"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(8) "2d372e37"
--- testing: '-7.7' << 'abc' ---
-string(4) "2d37"
+string(8) "2d372e37"
--- testing: '-7.7' << '123abc' ---
-string(20) "2d393339353234303936"
+string(8) "00000000"
--- testing: '-7.7' << '123e5' ---
-string(20) "2d393339353234303936"
+string(8) "00000000"
--- testing: '-7.7' << '123e5xyz' ---
-string(20) "2d393339353234303936"
+string(8) "00000000"
--- testing: '-7.7' << ' 123abc' ---
-string(20) "2d393339353234303936"
+string(8) "00000000"
--- testing: '-7.7' << '123 abc' ---
-string(20) "2d393339353234303936"
+string(8) "00000000"
--- testing: '-7.7' << '123abc ' ---
-string(20) "2d393339353234303936"
+string(8) "00000000"
--- testing: '-7.7' << '3.4a' ---
-string(6) "2d3536"
+string(8) "69b971b8"
--- testing: '-7.7' << 'a5.9' ---
-string(4) "2d37"
+string(8) "2d372e37"
--- testing: 'abc' << '0' ---
-string(2) "30"
+string(6) "616263"
--- testing: 'abc' << '65' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' << '-44' ---
-string(2) "30"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(6) "616263"
--- testing: 'abc' << '1.2' ---
-string(2) "30"
+string(6) "c2c4c6"
--- testing: 'abc' << '-7.7' ---
-string(2) "30"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(6) "616263"
--- testing: 'abc' << 'abc' ---
-string(2) "30"
+string(6) "616263"
--- testing: 'abc' << '123abc' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' << '123e5' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' << '123e5xyz' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' << ' 123abc' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' << '123 abc' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' << '123abc ' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' << '3.4a' ---
-string(2) "30"
+string(6) "0b1318"
--- testing: 'abc' << 'a5.9' ---
-string(2) "30"
+string(6) "616263"
--- testing: '123abc' << '0' ---
-string(6) "313233"
+string(12) "313233616263"
--- testing: '123abc' << '65' ---
-string(6) "323436"
+string(12) "000000000000"
--- testing: '123abc' << '-44' ---
-string(18) "313238393734383438"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(12) "313233616263"
--- testing: '123abc' << '1.2' ---
-string(6) "323436"
+string(12) "626466c2c4c6"
--- testing: '123abc' << '-7.7' ---
-string(20) "2d313637373732313630"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(12) "313233616263"
--- testing: '123abc' << 'abc' ---
-string(6) "313233"
+string(12) "313233616263"
--- testing: '123abc' << '123abc' ---
-string(20) "2d363731303838363430"
+string(12) "000000000000"
--- testing: '123abc' << '123e5' ---
-string(20) "2d363731303838363430"
+string(12) "000000000000"
--- testing: '123abc' << '123e5xyz' ---
-string(20) "2d363731303838363430"
+string(12) "000000000000"
--- testing: '123abc' << ' 123abc' ---
-string(20) "2d363731303838363430"
+string(12) "000000000000"
--- testing: '123abc' << '123 abc' ---
-string(20) "2d363731303838363430"
+string(12) "000000000000"
--- testing: '123abc' << '123abc ' ---
-string(20) "2d363731303838363430"
+string(12) "000000000000"
--- testing: '123abc' << '3.4a' ---
-string(6) "393834"
+string(12) "89919b0b1318"
--- testing: '123abc' << 'a5.9' ---
-string(6) "313233"
+string(12) "313233616263"
--- testing: '123e5' << '0' ---
-string(6) "313233"
+string(10) "3132336535"
--- testing: '123e5' << '65' ---
-string(6) "323436"
+string(10) "0000000000"
--- testing: '123e5' << '-44' ---
-string(18) "313238393734383438"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(10) "3132336535"
--- testing: '123e5' << '1.2' ---
-string(6) "323436"
+string(10) "626466ca6a"
--- testing: '123e5' << '-7.7' ---
-string(20) "2d313637373732313630"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(10) "3132336535"
--- testing: '123e5' << 'abc' ---
-string(6) "313233"
+string(10) "3132336535"
--- testing: '123e5' << '123abc' ---
-string(20) "2d363731303838363430"
+string(10) "0000000000"
--- testing: '123e5' << '123e5' ---
-string(20) "2d363731303838363430"
+string(10) "0000000000"
--- testing: '123e5' << '123e5xyz' ---
-string(20) "2d363731303838363430"
+string(10) "0000000000"
--- testing: '123e5' << ' 123abc' ---
-string(20) "2d363731303838363430"
+string(10) "0000000000"
--- testing: '123e5' << '123 abc' ---
-string(20) "2d363731303838363430"
+string(10) "0000000000"
--- testing: '123e5' << '123abc ' ---
-string(20) "2d363731303838363430"
+string(10) "0000000000"
--- testing: '123e5' << '3.4a' ---
-string(6) "393834"
+string(10) "89919b29a8"
--- testing: '123e5' << 'a5.9' ---
-string(6) "313233"
+string(10) "3132336535"
--- testing: '123e5xyz' << '0' ---
-string(6) "313233"
+string(16) "313233653578797a"
--- testing: '123e5xyz' << '65' ---
-string(6) "323436"
+string(16) "0000000000000000"
--- testing: '123e5xyz' << '-44' ---
-string(18) "313238393734383438"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(16) "313233653578797a"
--- testing: '123e5xyz' << '1.2' ---
-string(6) "323436"
+string(16) "626466ca6af0f2f4"
--- testing: '123e5xyz' << '-7.7' ---
-string(20) "2d313637373732313630"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(16) "313233653578797a"
--- testing: '123e5xyz' << 'abc' ---
-string(6) "313233"
+string(16) "313233653578797a"
--- testing: '123e5xyz' << '123abc' ---
-string(20) "2d363731303838363430"
+string(16) "0000000000000000"
--- testing: '123e5xyz' << '123e5' ---
-string(20) "2d363731303838363430"
+string(16) "0000000000000000"
--- testing: '123e5xyz' << '123e5xyz' ---
-string(20) "2d363731303838363430"
+string(16) "0000000000000000"
--- testing: '123e5xyz' << ' 123abc' ---
-string(20) "2d363731303838363430"
+string(16) "0000000000000000"
--- testing: '123e5xyz' << '123 abc' ---
-string(20) "2d363731303838363430"
+string(16) "0000000000000000"
--- testing: '123e5xyz' << '123abc ' ---
-string(20) "2d363731303838363430"
+string(16) "0000000000000000"
--- testing: '123e5xyz' << '3.4a' ---
-string(6) "393834"
+string(16) "89919b29abc3cbd0"
--- testing: '123e5xyz' << 'a5.9' ---
-string(6) "313233"
+string(16) "313233653578797a"
--- testing: ' 123abc' << '0' ---
-string(6) "313233"
+string(14) "20313233616263"
--- testing: ' 123abc' << '65' ---
-string(6) "323436"
+string(14) "00000000000000"
--- testing: ' 123abc' << '-44' ---
-string(18) "313238393734383438"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(14) "20313233616263"
--- testing: ' 123abc' << '1.2' ---
-string(6) "323436"
+string(14) "40626466c2c4c6"
--- testing: ' 123abc' << '-7.7' ---
-string(20) "2d313637373732313630"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(14) "20313233616263"
--- testing: ' 123abc' << 'abc' ---
-string(6) "313233"
+string(14) "20313233616263"
--- testing: ' 123abc' << '123abc' ---
-string(20) "2d363731303838363430"
+string(14) "00000000000000"
--- testing: ' 123abc' << '123e5' ---
-string(20) "2d363731303838363430"
+string(14) "00000000000000"
--- testing: ' 123abc' << '123e5xyz' ---
-string(20) "2d363731303838363430"
+string(14) "00000000000000"
--- testing: ' 123abc' << ' 123abc' ---
-string(20) "2d363731303838363430"
+string(14) "00000000000000"
--- testing: ' 123abc' << '123 abc' ---
-string(20) "2d363731303838363430"
+string(14) "00000000000000"
--- testing: ' 123abc' << '123abc ' ---
-string(20) "2d363731303838363430"
+string(14) "00000000000000"
--- testing: ' 123abc' << '3.4a' ---
-string(6) "393834"
+string(14) "0189919b0b1318"
--- testing: ' 123abc' << 'a5.9' ---
-string(6) "313233"
+string(14) "20313233616263"
--- testing: '123 abc' << '0' ---
-string(6) "313233"
+string(14) "31323320616263"
--- testing: '123 abc' << '65' ---
-string(6) "323436"
+string(14) "00000000000000"
--- testing: '123 abc' << '-44' ---
-string(18) "313238393734383438"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(14) "31323320616263"
--- testing: '123 abc' << '1.2' ---
-string(6) "323436"
+string(14) "62646640c2c4c6"
--- testing: '123 abc' << '-7.7' ---
-string(20) "2d313637373732313630"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(14) "31323320616263"
--- testing: '123 abc' << 'abc' ---
-string(6) "313233"
+string(14) "31323320616263"
--- testing: '123 abc' << '123abc' ---
-string(20) "2d363731303838363430"
+string(14) "00000000000000"
--- testing: '123 abc' << '123e5' ---
-string(20) "2d363731303838363430"
+string(14) "00000000000000"
--- testing: '123 abc' << '123e5xyz' ---
-string(20) "2d363731303838363430"
+string(14) "00000000000000"
--- testing: '123 abc' << ' 123abc' ---
-string(20) "2d363731303838363430"
+string(14) "00000000000000"
--- testing: '123 abc' << '123 abc' ---
-string(20) "2d363731303838363430"
+string(14) "00000000000000"
--- testing: '123 abc' << '123abc ' ---
-string(20) "2d363731303838363430"
+string(14) "00000000000000"
--- testing: '123 abc' << '3.4a' ---
-string(6) "393834"
+string(14) "899199030b1318"
--- testing: '123 abc' << 'a5.9' ---
-string(6) "313233"
+string(14) "31323320616263"
--- testing: '123abc ' << '0' ---
-string(6) "313233"
+string(14) "31323361626320"
--- testing: '123abc ' << '65' ---
-string(6) "323436"
+string(14) "00000000000000"
--- testing: '123abc ' << '-44' ---
-string(18) "313238393734383438"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(14) "31323361626320"
--- testing: '123abc ' << '1.2' ---
-string(6) "323436"
+string(14) "626466c2c4c640"
--- testing: '123abc ' << '-7.7' ---
-string(20) "2d313637373732313630"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(14) "31323361626320"
--- testing: '123abc ' << 'abc' ---
-string(6) "313233"
+string(14) "31323361626320"
--- testing: '123abc ' << '123abc' ---
-string(20) "2d363731303838363430"
+string(14) "00000000000000"
--- testing: '123abc ' << '123e5' ---
-string(20) "2d363731303838363430"
+string(14) "00000000000000"
--- testing: '123abc ' << '123e5xyz' ---
-string(20) "2d363731303838363430"
+string(14) "00000000000000"
--- testing: '123abc ' << ' 123abc' ---
-string(20) "2d363731303838363430"
+string(14) "00000000000000"
--- testing: '123abc ' << '123 abc' ---
-string(20) "2d363731303838363430"
+string(14) "00000000000000"
--- testing: '123abc ' << '123abc ' ---
-string(20) "2d363731303838363430"
+string(14) "00000000000000"
--- testing: '123abc ' << '3.4a' ---
-string(6) "393834"
+string(14) "89919b0b131900"
--- testing: '123abc ' << 'a5.9' ---
-string(6) "313233"
+string(14) "31323361626320"
--- testing: '3.4a' << '0' ---
-string(2) "33"
+string(8) "332e3461"
--- testing: '3.4a' << '65' ---
-string(2) "36"
+string(8) "00000000"
--- testing: '3.4a' << '-44' ---
-string(14) "33313435373238"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(8) "332e3461"
--- testing: '3.4a' << '1.2' ---
-string(2) "36"
+string(8) "665c68c2"
--- testing: '3.4a' << '-7.7' ---
-string(18) "313030363633323936"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(8) "332e3461"
--- testing: '3.4a' << 'abc' ---
-string(2) "33"
+string(8) "332e3461"
--- testing: '3.4a' << '123abc' ---
-string(18) "343032363533313834"
+string(8) "00000000"
--- testing: '3.4a' << '123e5' ---
-string(18) "343032363533313834"
+string(8) "00000000"
--- testing: '3.4a' << '123e5xyz' ---
-string(18) "343032363533313834"
+string(8) "00000000"
--- testing: '3.4a' << ' 123abc' ---
-string(18) "343032363533313834"
+string(8) "00000000"
--- testing: '3.4a' << '123 abc' ---
-string(18) "343032363533313834"
+string(8) "00000000"
--- testing: '3.4a' << '123abc ' ---
-string(18) "343032363533313834"
+string(8) "00000000"
--- testing: '3.4a' << '3.4a' ---
-string(4) "3234"
+string(8) "9971a308"
--- testing: '3.4a' << 'a5.9' ---
-string(2) "33"
+string(8) "332e3461"
--- testing: 'a5.9' << '0' ---
-string(2) "30"
+string(8) "61352e39"
--- testing: 'a5.9' << '65' ---
-string(2) "30"
+string(8) "00000000"
--- testing: 'a5.9' << '-44' ---
-string(2) "30"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(8) "61352e39"
--- testing: 'a5.9' << '1.2' ---
-string(2) "30"
+string(8) "c26a5c72"
--- testing: 'a5.9' << '-7.7' ---
-string(2) "30"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(8) "61352e39"
--- testing: 'a5.9' << 'abc' ---
-string(2) "30"
+string(8) "61352e39"
--- testing: 'a5.9' << '123abc' ---
-string(2) "30"
+string(8) "00000000"
--- testing: 'a5.9' << '123e5' ---
-string(2) "30"
+string(8) "00000000"
--- testing: 'a5.9' << '123e5xyz' ---
-string(2) "30"
+string(8) "00000000"
--- testing: 'a5.9' << ' 123abc' ---
-string(2) "30"
+string(8) "00000000"
--- testing: 'a5.9' << '123 abc' ---
-string(2) "30"
+string(8) "00000000"
--- testing: 'a5.9' << '123abc ' ---
-string(2) "30"
+string(8) "00000000"
--- testing: 'a5.9' << '3.4a' ---
-string(2) "30"
+string(8) "09a971c8"
--- testing: 'a5.9' << 'a5.9' ---
-string(2) "30"
+string(8) "61352e39"
===DONE===
-
14 tests/lang/operators/bitwiseShiftLeft_variationStr2.phpt
View
@@ -3,16 +3,14 @@ Test << operator : numbers as strings, simple
--FILE--
<?php
-error_reporting(E_ERROR);
-
-var_dump("12" << "0");
-var_dump("34" << "1");
-var_dump("56" << "2");
+var_dump("12" << 0);
+var_dump("34" << 1);
+var_dump(bin2hex("56" << 2));
?>
===DONE===
--EXPECT--
-int(12)
-int(68)
-int(224)
+string(2) "12"
+string(2) "fh"
+string(4) "d4d8"
===DONE===
428 tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt
View
@@ -24,397 +24,453 @@ foreach ($strVals as $strVal) {
?>
===DONE===
---EXPECT--
+--EXPECTF--
--- testing: '0' << '0' ---
string(2) "30"
--- testing: '0' << '65' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' << '-44' ---
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
string(2) "30"
--- testing: '0' << '1.2' ---
-string(2) "30"
+string(2) "60"
--- testing: '0' << '-7.7' ---
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
string(2) "30"
--- testing: '0' << 'abc' ---
string(2) "30"
--- testing: '0' << '123abc' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' << '123e5' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' << '123e5xyz' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' << ' 123abc' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' << '123 abc' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' << '123abc ' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' << '3.4a' ---
-string(2) "30"
+string(2) "80"
--- testing: '0' << 'a5.9' ---
string(2) "30"
--- testing: '65' << '0' ---
string(4) "3635"
--- testing: '65' << '65' ---
-string(6) "313330"
+string(4) "0000"
--- testing: '65' << '-44' ---
-string(16) "3638313537343430"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(4) "3635"
--- testing: '65' << '1.2' ---
-string(6) "313330"
+string(4) "6c6a"
--- testing: '65' << '-7.7' ---
-string(40) "2d39303739323536383438373738393139393336"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(4) "3635"
--- testing: '65' << 'abc' ---
string(4) "3635"
--- testing: '65' << '123abc' ---
-string(36) "353736343630373532333033343233343838"
+string(4) "0000"
--- testing: '65' << '123e5' ---
-string(36) "353736343630373532333033343233343838"
+string(4) "0000"
--- testing: '65' << '123e5xyz' ---
-string(36) "353736343630373532333033343233343838"
+string(4) "0000"
--- testing: '65' << ' 123abc' ---
-string(36) "353736343630373532333033343233343838"
+string(4) "0000"
--- testing: '65' << '123 abc' ---
-string(36) "353736343630373532333033343233343838"
+string(4) "0000"
--- testing: '65' << '123abc ' ---
-string(36) "353736343630373532333033343233343838"
+string(4) "0000"
--- testing: '65' << '3.4a' ---
-string(6) "353230"
+string(4) "b1a8"
--- testing: '65' << 'a5.9' ---
string(4) "3635"
--- testing: '-44' << '0' ---
string(6) "2d3434"
--- testing: '-44' << '65' ---
-string(6) "2d3838"
+string(6) "000000"
--- testing: '-44' << '-44' ---
-string(18) "2d3436313337333434"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(6) "2d3434"
--- testing: '-44' << '1.2' ---
-string(6) "2d3838"
+string(6) "5a6868"
--- testing: '-44' << '-7.7' ---
-string(40) "2d36333431303638323735333337363538333638"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(6) "2d3434"
--- testing: '-44' << 'abc' ---
string(6) "2d3434"
--- testing: '-44' << '123abc' ---
-string(40) "2d36393137353239303237363431303831383536"
+string(6) "000000"
--- testing: '-44' << '123e5' ---
-string(40) "2d36393137353239303237363431303831383536"
+string(6) "000000"
--- testing: '-44' << '123e5xyz' ---
-string(40) "2d36393137353239303237363431303831383536"
+string(6) "000000"
--- testing: '-44' << ' 123abc' ---
-string(40) "2d36393137353239303237363431303831383536"
+string(6) "000000"
--- testing: '-44' << '123 abc' ---
-string(40) "2d36393137353239303237363431303831383536"
+string(6) "000000"
--- testing: '-44' << '123abc ' ---
-string(40) "2d36393137353239303237363431303831383536"
+string(6) "000000"
--- testing: '-44' << '3.4a' ---
-string(8) "2d333532"
+string(6) "69a1a0"
--- testing: '-44' << 'a5.9' ---
string(6) "2d3434"
--- testing: '1.2' << '0' ---
-string(2) "31"
+string(6) "312e32"
--- testing: '1.2' << '65' ---
-string(2) "32"
+string(6) "000000"
--- testing: '1.2' << '-44' ---
-string(14) "31303438353736"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(6) "312e32"
--- testing: '1.2' << '1.2' ---
-string(2) "32"
+string(6) "625c64"
--- testing: '1.2' << '-7.7' ---
-string(36) "313434313135313838303735383535383732"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(6) "312e32"
--- testing: '1.2' << 'abc' ---
-string(2) "31"
+string(6) "312e32"
--- testing: '1.2' << '123abc' ---
-string(36) "353736343630373532333033343233343838"
+string(6) "000000"
--- testing: '1.2' << '123e5' ---
-string(36) "353736343630373532333033343233343838"
+string(6) "000000"
--- testing: '1.2' << '123e5xyz' ---
-string(36) "353736343630373532333033343233343838"
+string(6) "000000"
--- testing: '1.2' << ' 123abc' ---
-string(36) "353736343630373532333033343233343838"
+string(6) "000000"
--- testing: '1.2' << '123 abc' ---
-string(36) "353736343630373532333033343233343838"
+string(6) "000000"
--- testing: '1.2' << '123abc ' ---
-string(36) "353736343630373532333033343233343838"
+string(6) "000000"
--- testing: '1.2' << '3.4a' ---
-string(2) "38"
+string(6) "897190"
--- testing: '1.2' << 'a5.9' ---
-string(2) "31"
+string(6) "312e32"
--- testing: '-7.7' << '0' ---
-string(4) "2d37"
+string(8) "2d372e37"
--- testing: '-7.7' << '65' ---
-string(6) "2d3134"
+string(8) "00000000"
--- testing: '-7.7' << '-44' ---
-string(16) "2d37333430303332"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(8) "2d372e37"
--- testing: '-7.7' << '1.2' ---
-string(6) "2d3134"
+string(8) "5a6e5c6e"
--- testing: '-7.7' << '-7.7' ---
-string(40) "2d31303038383036333136353330393931313034"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(8) "2d372e37"
--- testing: '-7.7' << 'abc' ---
-string(4) "2d37"
+string(8) "2d372e37"
--- testing: '-7.7' << '123abc' ---
-string(40) "2d34303335323235323636313233393634343136"
+string(8) "00000000"
--- testing: '-7.7' << '123e5' ---
-string(40) "2d34303335323235323636313233393634343136"
+string(8) "00000000"
--- testing: '-7.7' << '123e5xyz' ---
-string(40) "2d34303335323235323636313233393634343136"
+string(8) "00000000"
--- testing: '-7.7' << ' 123abc' ---
-string(40) "2d34303335323235323636313233393634343136"
+string(8) "00000000"
--- testing: '-7.7' << '123 abc' ---
-string(40) "2d34303335323235323636313233393634343136"
+string(8) "00000000"
--- testing: '-7.7' << '123abc ' ---
-string(40) "2d34303335323235323636313233393634343136"
+string(8) "00000000"
--- testing: '-7.7' << '3.4a' ---
-string(6) "2d3536"
+string(8) "69b971b8"
--- testing: '-7.7' << 'a5.9' ---
-string(4) "2d37"
+string(8) "2d372e37"
--- testing: 'abc' << '0' ---
-string(2) "30"
+string(6) "616263"
--- testing: 'abc' << '65' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' << '-44' ---
-string(2) "30"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(6) "616263"
--- testing: 'abc' << '1.2' ---
-string(2) "30"
+string(6) "c2c4c6"
--- testing: 'abc' << '-7.7' ---
-string(2) "30"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(6) "616263"
--- testing: 'abc' << 'abc' ---
-string(2) "30"
+string(6) "616263"
--- testing: 'abc' << '123abc' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' << '123e5' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' << '123e5xyz' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' << ' 123abc' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' << '123 abc' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' << '123abc ' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' << '3.4a' ---
-string(2) "30"
+string(6) "0b1318"
--- testing: 'abc' << 'a5.9' ---
-string(2) "30"
+string(6) "616263"
--- testing: '123abc' << '0' ---
-string(6) "313233"
+string(12) "313233616263"
--- testing: '123abc' << '65' ---
-string(6) "323436"
+string(12) "000000000000"
--- testing: '123abc' << '-44' ---
-string(18) "313238393734383438"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(12) "313233616263"
--- testing: '123abc' << '1.2' ---
-string(6) "323436"
+string(12) "626466c2c4c6"
--- testing: '123abc' << '-7.7' ---
-string(38) "2d373230353735393430333739323739333630"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(12) "313233616263"
--- testing: '123abc' << 'abc' ---
-string(6) "313233"
+string(12) "313233616263"
--- testing: '123abc' << '123abc' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(12) "000000000000"
--- testing: '123abc' << '123e5' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(12) "000000000000"
--- testing: '123abc' << '123e5xyz' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(12) "000000000000"
--- testing: '123abc' << ' 123abc' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(12) "000000000000"
--- testing: '123abc' << '123 abc' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(12) "000000000000"
--- testing: '123abc' << '123abc ' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(12) "000000000000"
--- testing: '123abc' << '3.4a' ---
-string(6) "393834"
+string(12) "89919b0b1318"
--- testing: '123abc' << 'a5.9' ---
-string(6) "313233"
+string(12) "313233616263"
--- testing: '123e5' << '0' ---
-string(6) "313233"
+string(10) "3132336535"
--- testing: '123e5' << '65' ---
-string(6) "323436"
+string(10) "0000000000"
--- testing: '123e5' << '-44' ---
-string(18) "313238393734383438"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(10) "3132336535"
--- testing: '123e5' << '1.2' ---
-string(6) "323436"
+string(10) "626466ca6a"
--- testing: '123e5' << '-7.7' ---
-string(38) "2d373230353735393430333739323739333630"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(10) "3132336535"
--- testing: '123e5' << 'abc' ---
-string(6) "313233"
+string(10) "3132336535"
--- testing: '123e5' << '123abc' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(10) "0000000000"
--- testing: '123e5' << '123e5' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(10) "0000000000"
--- testing: '123e5' << '123e5xyz' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(10) "0000000000"
--- testing: '123e5' << ' 123abc' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(10) "0000000000"
--- testing: '123e5' << '123 abc' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(10) "0000000000"
--- testing: '123e5' << '123abc ' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(10) "0000000000"
--- testing: '123e5' << '3.4a' ---
-string(6) "393834"
+string(10) "89919b29a8"
--- testing: '123e5' << 'a5.9' ---
-string(6) "313233"
+string(10) "3132336535"
--- testing: '123e5xyz' << '0' ---
-string(6) "313233"
+string(16) "313233653578797a"
--- testing: '123e5xyz' << '65' ---
-string(6) "323436"
+string(16) "0000000000000000"
--- testing: '123e5xyz' << '-44' ---
-string(18) "313238393734383438"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(16) "313233653578797a"
--- testing: '123e5xyz' << '1.2' ---
-string(6) "323436"
+string(16) "626466ca6af0f2f4"
--- testing: '123e5xyz' << '-7.7' ---
-string(38) "2d373230353735393430333739323739333630"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(16) "313233653578797a"
--- testing: '123e5xyz' << 'abc' ---
-string(6) "313233"
+string(16) "313233653578797a"
--- testing: '123e5xyz' << '123abc' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(16) "0000000000000000"
--- testing: '123e5xyz' << '123e5' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(16) "0000000000000000"
--- testing: '123e5xyz' << '123e5xyz' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(16) "0000000000000000"
--- testing: '123e5xyz' << ' 123abc' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(16) "0000000000000000"
--- testing: '123e5xyz' << '123 abc' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(16) "0000000000000000"
--- testing: '123e5xyz' << '123abc ' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(16) "0000000000000000"
--- testing: '123e5xyz' << '3.4a' ---
-string(6) "393834"
+string(16) "89919b29abc3cbd0"
--- testing: '123e5xyz' << 'a5.9' ---
-string(6) "313233"
+string(16) "313233653578797a"
--- testing: ' 123abc' << '0' ---
-string(6) "313233"
+string(14) "20313233616263"
--- testing: ' 123abc' << '65' ---
-string(6) "323436"
+string(14) "00000000000000"
--- testing: ' 123abc' << '-44' ---
-string(18) "313238393734383438"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(14) "20313233616263"
--- testing: ' 123abc' << '1.2' ---
-string(6) "323436"
+string(14) "40626466c2c4c6"
--- testing: ' 123abc' << '-7.7' ---
-string(38) "2d373230353735393430333739323739333630"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(14) "20313233616263"
--- testing: ' 123abc' << 'abc' ---
-string(6) "313233"
+string(14) "20313233616263"
--- testing: ' 123abc' << '123abc' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(14) "00000000000000"
--- testing: ' 123abc' << '123e5' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(14) "00000000000000"
--- testing: ' 123abc' << '123e5xyz' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(14) "00000000000000"
--- testing: ' 123abc' << ' 123abc' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(14) "00000000000000"
--- testing: ' 123abc' << '123 abc' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(14) "00000000000000"
--- testing: ' 123abc' << '123abc ' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(14) "00000000000000"
--- testing: ' 123abc' << '3.4a' ---
-string(6) "393834"
+string(14) "0189919b0b1318"
--- testing: ' 123abc' << 'a5.9' ---
-string(6) "313233"
+string(14) "20313233616263"
--- testing: '123 abc' << '0' ---
-string(6) "313233"
+string(14) "31323320616263"
--- testing: '123 abc' << '65' ---
-string(6) "323436"
+string(14) "00000000000000"
--- testing: '123 abc' << '-44' ---
-string(18) "313238393734383438"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(14) "31323320616263"
--- testing: '123 abc' << '1.2' ---
-string(6) "323436"
+string(14) "62646640c2c4c6"
--- testing: '123 abc' << '-7.7' ---
-string(38) "2d373230353735393430333739323739333630"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(14) "31323320616263"
--- testing: '123 abc' << 'abc' ---
-string(6) "313233"
+string(14) "31323320616263"
--- testing: '123 abc' << '123abc' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(14) "00000000000000"
--- testing: '123 abc' << '123e5' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(14) "00000000000000"
--- testing: '123 abc' << '123e5xyz' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(14) "00000000000000"
--- testing: '123 abc' << ' 123abc' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(14) "00000000000000"
--- testing: '123 abc' << '123 abc' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(14) "00000000000000"
--- testing: '123 abc' << '123abc ' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(14) "00000000000000"
--- testing: '123 abc' << '3.4a' ---
-string(6) "393834"
+string(14) "899199030b1318"
--- testing: '123 abc' << 'a5.9' ---
-string(6) "313233"
+string(14) "31323320616263"
--- testing: '123abc ' << '0' ---
-string(6) "313233"
+string(14) "31323361626320"
--- testing: '123abc ' << '65' ---
-string(6) "323436"
+string(14) "00000000000000"
--- testing: '123abc ' << '-44' ---
-string(18) "313238393734383438"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(14) "31323361626320"
--- testing: '123abc ' << '1.2' ---
-string(6) "323436"
+string(14) "626466c2c4c640"
--- testing: '123abc ' << '-7.7' ---
-string(38) "2d373230353735393430333739323739333630"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(14) "31323361626320"
--- testing: '123abc ' << 'abc' ---
-string(6) "313233"
+string(14) "31323361626320"
--- testing: '123abc ' << '123abc' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(14) "00000000000000"
--- testing: '123abc ' << '123e5' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(14) "00000000000000"
--- testing: '123abc ' << '123e5xyz' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(14) "00000000000000"
--- testing: '123abc ' << ' 123abc' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(14) "00000000000000"
--- testing: '123abc ' << '123 abc' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(14) "00000000000000"
--- testing: '123abc ' << '123abc ' ---
-string(40) "2d32383832333033373631353137313137343430"
+string(14) "00000000000000"
--- testing: '123abc ' << '3.4a' ---
-string(6) "393834"
+string(14) "89919b0b131900"
--- testing: '123abc ' << 'a5.9' ---
-string(6) "313233"
+string(14) "31323361626320"
--- testing: '3.4a' << '0' ---
-string(2) "33"
+string(8) "332e3461"
--- testing: '3.4a' << '65' ---
-string(2) "36"
+string(8) "00000000"
--- testing: '3.4a' << '-44' ---
-string(14) "33313435373238"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(8) "332e3461"
--- testing: '3.4a' << '1.2' ---
-string(2) "36"
+string(8) "665c68c2"
--- testing: '3.4a' << '-7.7' ---
-string(36) "343332333435353634323237353637363136"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(8) "332e3461"
--- testing: '3.4a' << 'abc' ---
-string(2) "33"
+string(8) "332e3461"
--- testing: '3.4a' << '123abc' ---
-string(38) "31373239333832323536393130323730343634"
+string(8) "00000000"
--- testing: '3.4a' << '123e5' ---
-string(38) "31373239333832323536393130323730343634"
+string(8) "00000000"
--- testing: '3.4a' << '123e5xyz' ---
-string(38) "31373239333832323536393130323730343634"
+string(8) "00000000"
--- testing: '3.4a' << ' 123abc' ---
-string(38) "31373239333832323536393130323730343634"
+string(8) "00000000"
--- testing: '3.4a' << '123 abc' ---
-string(38) "31373239333832323536393130323730343634"
+string(8) "00000000"
--- testing: '3.4a' << '123abc ' ---
-string(38) "31373239333832323536393130323730343634"
+string(8) "00000000"
--- testing: '3.4a' << '3.4a' ---
-string(4) "3234"
+string(8) "9971a308"
--- testing: '3.4a' << 'a5.9' ---
-string(2) "33"
+string(8) "332e3461"
--- testing: 'a5.9' << '0' ---
-string(2) "30"
+string(8) "61352e39"
--- testing: 'a5.9' << '65' ---
-string(2) "30"
+string(8) "00000000"
--- testing: 'a5.9' << '-44' ---
-string(2) "30"
+
+Notice: Invalid right operand for left shift operation: -44 in %s on line %d
+string(8) "61352e39"
--- testing: 'a5.9' << '1.2' ---
-string(2) "30"
+string(8) "c26a5c72"
--- testing: 'a5.9' << '-7.7' ---
-string(2) "30"
+
+Notice: Invalid right operand for left shift operation: -7 in %s on line %d
+string(8) "61352e39"
--- testing: 'a5.9' << 'abc' ---
-string(2) "30"
+string(8) "61352e39"
--- testing: 'a5.9' << '123abc' ---
-string(2) "30"
+string(8) "00000000"
--- testing: 'a5.9' << '123e5' ---
-string(2) "30"
+string(8) "00000000"
--- testing: 'a5.9' << '123e5xyz' ---
-string(2) "30"
+string(8) "00000000"
--- testing: 'a5.9' << ' 123abc' ---
-string(2) "30"
+string(8) "00000000"
--- testing: 'a5.9' << '123 abc' ---
-string(2) "30"
+string(8) "00000000"
--- testing: 'a5.9' << '123abc ' ---
-string(2) "30"
+string(8) "00000000"
--- testing: 'a5.9' << '3.4a' ---
-string(2) "30"
+string(8) "09a971c8"
--- testing: 'a5.9' << 'a5.9' ---
-string(2) "30"
+string(8) "61352e39"
===DONE===
426 tests/lang/operators/bitwiseShiftRight_variationStr.phpt
View
@@ -28,393 +28,449 @@ foreach ($strVals as $strVal) {
--- testing: '0' >> '0' ---
string(2) "30"
--- testing: '0' >> '65' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' >> '-44' ---
+
+Notice: Invalid right operand for right shift operation: -44 in %s on line %d
string(2) "30"
--- testing: '0' >> '1.2' ---
-string(2) "30"
+string(2) "18"
--- testing: '0' >> '-7.7' ---
+
+Notice: Invalid right operand for right shift operation: -7 in %s on line %d
string(2) "30"
--- testing: '0' >> 'abc' ---
string(2) "30"
--- testing: '0' >> '123abc' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' >> '123e5' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' >> '123e5xyz' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' >> ' 123abc' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' >> '123 abc' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' >> '123abc ' ---
-string(2) "30"
+string(2) "00"
--- testing: '0' >> '3.4a' ---
-string(2) "30"
+string(2) "06"
--- testing: '0' >> 'a5.9' ---
string(2) "30"
--- testing: '65' >> '0' ---
string(4) "3635"
--- testing: '65' >> '65' ---
-string(4) "3332"
+string(4) "0000"
--- testing: '65' >> '-44' ---
-string(2) "30"
+
+Notice: Invalid right operand for right shift operation: -44 in %s on line %d
+string(4) "3635"
--- testing: '65' >> '1.2' ---
-string(4) "3332"
+string(4) "1b1a"
--- testing: '65' >> '-7.7' ---
-string(2) "30"
+
+Notice: Invalid right operand for right shift operation: -7 in %s on line %d
+string(4) "3635"
--- testing: '65' >> 'abc' ---
string(4) "3635"
--- testing: '65' >> '123abc' ---
-string(2) "30"
+string(4) "0000"
--- testing: '65' >> '123e5' ---
-string(2) "30"
+string(4) "0000"
--- testing: '65' >> '123e5xyz' ---
-string(2) "30"
+string(4) "0000"
--- testing: '65' >> ' 123abc' ---
-string(2) "30"
+string(4) "0000"
--- testing: '65' >> '123 abc' ---
-string(2) "30"
+string(4) "0000"
--- testing: '65' >> '123abc ' ---
-string(2) "30"
+string(4) "0000"
--- testing: '65' >> '3.4a' ---
-string(2) "38"
+string(4) "06c6"
--- testing: '65' >> 'a5.9' ---
string(4) "3635"
--- testing: '-44' >> '0' ---
string(6) "2d3434"
--- testing: '-44' >> '65' ---
-string(6) "2d3232"
+string(6) "000000"
--- testing: '-44' >> '-44' ---
-string(4) "2d31"
+
+Notice: Invalid right operand for right shift operation: -44 in %s on line %d
+string(6) "2d3434"
--- testing: '-44' >> '1.2' ---
-string(6) "2d3232"
+string(6) "169a1a"
--- testing: '-44' >> '-7.7' ---
-string(4) "2d31"
+
+Notice: Invalid right operand for right shift operation: -7 in %s on line %d
+string(6) "2d3434"
--- testing: '-44' >> 'abc' ---
string(6) "2d3434"
--- testing: '-44' >> '123abc' ---
-string(4) "2d31"
+string(6) "000000"
--- testing: '-44' >> '123e5' ---
-string(4) "2d31"
+string(6) "000000"
--- testing: '-44' >> '123e5xyz' ---
-string(4) "2d31"
+string(6) "000000"
--- testing: '-44' >> ' 123abc' ---
-string(4) "2d31"
+string(6) "000000"
--- testing: '-44' >> '123 abc' ---
-string(4) "2d31"
+string(6) "000000"
--- testing: '-44' >> '123abc ' ---
-string(4) "2d31"
+string(6) "000000"
--- testing: '-44' >> '3.4a' ---
-string(4) "2d36"
+string(6) "05a686"
--- testing: '-44' >> 'a5.9' ---
string(6) "2d3434"
--- testing: '1.2' >> '0' ---
-string(2) "31"
+string(6) "312e32"
--- testing: '1.2' >> '65' ---
-string(2) "30"
+string(6) "000000"
--- testing: '1.2' >> '-44' ---
-string(2) "30"
+
+Notice: Invalid right operand for right shift operation: -44 in %s on line %d
+string(6) "312e32"
--- testing: '1.2' >> '1.2' ---
-string(2) "30"
+string(6) "189719"
--- testing: '1.2' >> '-7.7' ---
-string(2) "30"
+
+Notice: Invalid right operand for right shift operation: -7 in %s on line %d
+string(6) "312e32"
--- testing: '1.2' >> 'abc' ---
-string(2) "31"
+string(6) "312e32"
--- testing: '1.2' >> '123abc' ---
-string(2) "30"
+string(6) "000000"
--- testing: '1.2' >> '123e5' ---
-string(2) "30"
+string(6) "000000"
--- testing: '1.2' >> '123e5xyz' ---
-string(2) "30"
+string(6) "000000"
--- testing: '1.2' >> ' 123abc' ---
-string(2) "30"
+string(6) "000000"
--- testing: '1.2' >> '123 abc' ---
-string(2) "30"
+string(6) "000000"
--- testing: '1.2' >> '123abc ' ---
-string(2) "30"
+string(6) "000000"
--- testing: '1.2' >> '3.4a' ---
-string(2) "30"
+string(6) "0625c6"
--- testing: '1.2' >> 'a5.9' ---
-string(2) "31"
+string(6) "312e32"
--- testing: '-7.7' >> '0' ---
-string(4) "2d37"
+string(8) "2d372e37"
--- testing: '-7.7' >> '65' ---
-string(4) "2d34"
+string(8) "00000000"
--- testing: '-7.7' >> '-44' ---
-string(4) "2d31"
+
+Notice: Invalid right operand for right shift operation: -44 in %s on line %d
+string(8) "2d372e37"
--- testing: '-7.7' >> '1.2' ---
-string(4) "2d34"
+string(8) "169b971b"
--- testing: '-7.7' >> '-7.7' ---
-string(4) "2d31"
+
+Notice: Invalid right operand for right shift operation: -7 in %s on line %d
+string(8) "2d372e37"
--- testing: '-7.7' >> 'abc' ---
-string(4) "2d37"
+string(8) "2d372e37"
--- testing: '-7.7' >> '123abc' ---
-string(4) "2d31"
+string(8) "00000000"
--- testing: '-7.7' >> '123e5' ---
-string(4) "2d31"
+string(8) "00000000"
--- testing: '-7.7' >> '123e5xyz' ---
-string(4) "2d31"
+string(8) "00000000"
--- testing: '-7.7' >> ' 123abc' ---
-string(4) "2d31"
+string(8) "00000000"
--- testing: '-7.7' >> '123 abc' ---
-string(4) "2d31"
+string(8) "00000000"
--- testing: '-7.7' >> '123abc ' ---
-string(4) "2d31"
+string(8) "00000000"
--- testing: '-7.7' >> '3.4a' ---
-string(4) "2d31"
+string(8) "05a6e5c6"
--- testing: '-7.7' >> 'a5.9' ---
-string(4) "2d37"
+string(8) "2d372e37"
--- testing: 'abc' >> '0' ---
-string(2) "30"
+string(6) "616263"
--- testing: 'abc' >> '65' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' >> '-44' ---
-string(2) "30"
+
+Notice: Invalid right operand for right shift operation: -44 in %s on line %d
+string(6) "616263"
--- testing: 'abc' >> '1.2' ---
-string(2) "30"
+string(6) "30b131"
--- testing: 'abc' >> '-7.7' ---
-string(2) "30"
+
+Notice: Invalid right operand for right shift operation: -7 in %s on line %d
+string(6) "616263"
--- testing: 'abc' >> 'abc' ---
-string(2) "30"
+string(6) "616263"
--- testing: 'abc' >> '123abc' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' >> '123e5' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' >> '123e5xyz' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' >> ' 123abc' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' >> '123 abc' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' >> '123abc ' ---
-string(2) "30"
+string(6) "000000"
--- testing: 'abc' >> '3.4a' ---
-string(2) "30"
+string(6) "0c2c4c"
--- testing: 'abc' >> 'a5.9' ---
-string(2) "30"
+string(6) "616263"
--- testing: '123abc' >> '0' ---
-string(6) "313233"
+string(12) "313233616263"
--- testing: '123abc' >> '65' ---
-string(4) "3631"
+string(12) "000000000000"
--- testing: '123abc' >> '-44' ---
-string(2) "30"
+
+Notice: Invalid right operand for right shift operation: -44 in %s on line %d
+string(12) "313233616263"
--- testing: '123abc' >> '1.2' ---
-string(4) "3631"
+string(12) "189919b0b131"
--- testing: '123abc' >> '-7.7' ---
-string(2) "30"
+
+Notice: Invalid right operand for right shift operation: -7 in %s on line %d
+string(12) "313233616263"
--- testing: '123abc' >> 'abc' ---
-string(6) "313233"
+string(12) "313233616263"
--- testing: '123abc' >> '123abc' ---
-string(2) "30"
+string(12) "000000000000"
--- testing: '123abc' >> '123e5' ---
-string(2) "30"
+string(12) "000000000000"
--- testing: '123abc' >> '123e5xyz' ---
-string(2) "30"
+string(12) "000000000000"
--- testing: '123abc' >> ' 123abc' ---
-string(2) "30"
+string(12) "000000000000"
--- testing: '123abc' >> '123 abc' ---
-string(2) "30"
+string(12) "000000000000"
--- testing: '123abc' >> '123abc ' ---
-string(2) "30"
+string(12) "000000000000"
--- testing: '123abc' >> '3.4a' ---
-string(4) "3135"
+string(12) "0626466c2c4c"
--- testing: '123abc' >> 'a5.9' ---
-string(6) "313233"
+string(12) "313233616263"
--- testing: '123e5' >> '0' ---
-string(6) "313233"
+string(10) "3132336535"
--- testing: '123e5' >> '65' ---
-string(4) "3631"
+string(10) "0000000000"
--- testing: '123e5' >> '-44' ---
-string(2) "30"
+
+Notice: Invalid right operand for right shift operation: -44 in %s on line %d
+string(10) "3132336535"
--- testing: '123e5' >> '1.2' ---
-string(4) "3631"
+string(10) "189919b29a"
--- testing: '123e5' >> '-7.7' ---
-string(2) "30"
+
+Notice: Invalid right operand for right shift operation: -7 in %s on line %d
+string(10) "3132336535"
--- testing: '123e5' >> 'abc' ---
-string(6) "313233"
+string(10) "3132336535"
--- testing: '123e5' >> '123abc' ---
-string(2) "30"
+string(10) "0000000000"
--- testing: '123e5' >> '123e5' ---
-string(2) "30"
+string(10) "0000000000"
--- testing: '123e5' >> '123e5xyz' ---
-string(2) "30"
+string(10) "0000000000"
--- testing: '123e5' >> ' 123abc' ---
-string(2) "30"
+string(10) "0000000000"
--- testing: '123e5' >> '123 abc' ---
-string(2) "30"
+string(10) "0000000000"
--- testing: '123e5' >> '123abc ' ---
-string(2) "30"
+string(10) "0000000000"
--- testing: '123e5' >> '3.4a' ---
-string(4) "3135"
+string(10) "0626466ca6"
--- testing: '123e5' >> 'a5.9' ---
-string(6) "313233"
+string(10) "3132336535"
--- testing: '123e5xyz' >> '0' ---
-string(6) "313233"
+string(16) "313233653578797a"
--- testing: '123e5xyz' >> '65' ---
-string(4) "3631"
+string(16) "0000000000000000"
--- testing: '123e5xyz' >> '-44' ---
-string(2) "30"
+
+Notice: Invalid right operand for right shift operation: -44 in %s on line %d
+string(16) "313233653578797a"
--- testing: '123e5xyz' >> '1.2' ---
-string(4) "3631"
+string(16) "189919b29abc3cbd"
--- testing: '123e5xyz' >> '-7.7' ---
-string(2) "30"
+
+Notice: Invalid right operand for right shift operation: -7 in %s on line %d
+string(16) "313233653578797a"
--- testing: '123e5xyz' >> 'abc' ---
-string(6) "313233"
+string(16) "313233653578797a"
--- testing: '123e5xyz' >> '123abc' ---
-string(2) "30"
+string(16) "0000000000000000"
--- testing: '123e5xyz' >> '123e5' ---
-string(2) "30"
+string(16) "0000000000000000"
--- testing: '123e5xyz' >> '123e5xyz' ---
-string(2) "30"
+string(16) "0000000000000000"
--- testing: '123e5xyz' >> ' 123abc' ---
-string(2) "30"
+string(16) "0000000000000000"
--- testing: '123e5xyz' >> '123 abc' ---
-string(2) "30"
+string(16) "0000000000000000"
--- testing: '123e5xyz' >> '123abc ' ---
-string(2) "30"
+string(16) "0000000000000000"
--- testing: '123e5xyz' >> '3.4a' ---
-string(4) "3135"
+string(16) "0626466ca6af0f2f"
--- testing: '123e5xyz' >> 'a5.9' ---
-string(6) "313233"
+string(16) "313233653578797a"
--- testing: ' 123abc' >> '0' ---
-string(6) "313233"
+string(14) "20313233616263"
--- testing: ' 123abc' >> '65' ---
-string(4) "3631"
+string(14) "00000000000000"
--- testing: ' 123abc' >> '-44' ---
-string(2) "30"
+
+Notice: Invalid right operand for right shift operation: -44 in %s on line %d
+string(14) "20313233616263"
--- testing: ' 123abc' >> '1.2' ---
-string(4) "3631"
+string(14) "10189919b0b131"
--- testing: ' 123abc' >> '-7.7' ---
-string(2) "30"