summaryrefslogtreecommitdiff
path: root/tests/lang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lang')
-rw-r--r--tests/lang/030.phpt3
-rw-r--r--tests/lang/045.phpt3
-rw-r--r--tests/lang/bug22592.phpt5
-rw-r--r--tests/lang/bug24640.phpt4
-rw-r--r--tests/lang/bug28800.phpt14
-rw-r--r--tests/lang/bug71897.phpt16
-rw-r--r--tests/lang/operators/bitwiseShiftLeft_variationStr.phpt2
-rw-r--r--tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt20
-rw-r--r--tests/lang/operators/bitwiseShiftRight_variationStr.phpt20
-rw-r--r--tests/lang/operators/modulus_variationStr.phpt28
-rw-r--r--tests/lang/operators/negate_variationStr.phpt18
-rw-r--r--tests/lang/type_hints_003.phpt4
12 files changed, 93 insertions, 44 deletions
diff --git a/tests/lang/030.phpt b/tests/lang/030.phpt
index 9ee40ea5aa..7f94b2eb74 100644
--- a/tests/lang/030.phpt
+++ b/tests/lang/030.phpt
@@ -24,7 +24,8 @@ $bar1->Name = 'outside';
$bar1->echoName();
$List->echoName();
-$bar1 =& foo2(new foo('constructor'));
+$foo = new foo('constructor');
+$bar1 =& foo2($foo);
$bar1->Name = 'outside';
$bar1->echoName();
diff --git a/tests/lang/045.phpt b/tests/lang/045.phpt
index 11598cf035..44fb801410 100644
--- a/tests/lang/045.phpt
+++ b/tests/lang/045.phpt
@@ -3,7 +3,10 @@ Timeout again inside register_shutdown_function
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
+if (PHP_ZTS) die("skip hard_timeout works only on no-zts builds");
?>
+--INI--
+hard_timeout=1
--FILE--
<?php
set_time_limit(1);
diff --git a/tests/lang/bug22592.phpt b/tests/lang/bug22592.phpt
index 270584185f..4614efc169 100644
--- a/tests/lang/bug22592.phpt
+++ b/tests/lang/bug22592.phpt
@@ -32,7 +32,8 @@ var_dump($result);
$e = $result[1] = $result[6];
var_dump($result);
var_dump($a, $b, $c, $d, $e);
-$result[-1] = 'a';
+$result[0] = $result[-4] = $result[-1] = 'a';
+var_dump($result);
?>
--EXPECT--
string(5) "* *-*"
@@ -50,4 +51,4 @@ string(1) "s"
string(1) "4"
string(1) "5"
string(1) "5"
-[Illegal string offset: -1]
+string(9) "a54s4a50a"
diff --git a/tests/lang/bug24640.phpt b/tests/lang/bug24640.phpt
index d02889101e..ac3d78d06c 100644
--- a/tests/lang/bug24640.phpt
+++ b/tests/lang/bug24640.phpt
@@ -112,7 +112,7 @@ float(I%s)
I%s
I%s
------
-0
+0.0
float(0)
0
0
@@ -122,7 +122,7 @@ float(I%s)
I%s
I%s
------
-0
+0.0
float(0)
0
0
diff --git a/tests/lang/bug28800.phpt b/tests/lang/bug28800.phpt
index f81ad7fec9..8bd2c306e1 100644
--- a/tests/lang/bug28800.phpt
+++ b/tests/lang/bug28800.phpt
@@ -7,11 +7,23 @@ Bug #28800 (Incorrect string to number conversion for strings starting with 'inf
echo ($v+0)."\n";
}
?>
---EXPECT--
+--EXPECTF--
+
+Warning: A non-numeric value encountered in %s on line %d
0
+
+Warning: A non-numeric value encountered in %s on line %d
0
+
+Warning: A non-numeric value encountered in %s on line %d
0
+
+Warning: A non-numeric value encountered in %s on line %d
0
+
+Warning: A non-numeric value encountered in %s on line %d
0
+
+Warning: A non-numeric value encountered in %s on line %d
0
diff --git a/tests/lang/bug71897.phpt b/tests/lang/bug71897.phpt
new file mode 100644
index 0000000000..bd76921af6
--- /dev/null
+++ b/tests/lang/bug71897.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #71897 (ASCII 0x7F Delete control character permitted in identifiers)
+--FILE--
+<?php
+
+eval("
+ \$a\x7Fb = 3;
+ var_dump(\$a\x7Fb);
+");
+
+?>
+--EXPECTF--
+
+Warning: Unexpected character in input: '%s' (ASCII=127) state=0 in %s(%d) : eval()'d code on line %d
+
+Parse error: syntax error, unexpected 'b' (T_STRING) in %s(%d) : eval()'d code on line %d
diff --git a/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt b/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt
index 6a44c5d630..0176d90738 100644
--- a/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt
+++ b/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt
@@ -19,7 +19,7 @@ foreach ($strVals as $strVal) {
echo "--- testing: '$strVal' << '$otherVal' ---\n";
try {
var_dump(strVal<<$otherVal);
- } catch (Exception $e) {
+ } catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
}
diff --git a/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt b/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt
index d5888d837f..69fd90f1c8 100644
--- a/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt
+++ b/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt
@@ -226,17 +226,17 @@ int(984)
--- testing: '123abc' << 'a5.9' ---
int(123)
--- testing: '123e5' << '0' ---
-int(123)
+int(12300000)
--- testing: '123e5' << '65' ---
int(0)
--- testing: '123e5' << '-44' ---
Exception: Bit shift by negative number
--- testing: '123e5' << '1.2' ---
-int(246)
+int(24600000)
--- testing: '123e5' << '-7.7' ---
Exception: Bit shift by negative number
--- testing: '123e5' << 'abc' ---
-int(123)
+int(12300000)
--- testing: '123e5' << '123abc' ---
int(0)
--- testing: '123e5' << '123e5' ---
@@ -250,21 +250,21 @@ int(0)
--- testing: '123e5' << '123abc ' ---
int(0)
--- testing: '123e5' << '3.4a' ---
-int(984)
+int(98400000)
--- testing: '123e5' << 'a5.9' ---
-int(123)
+int(12300000)
--- testing: '123e5xyz' << '0' ---
-int(123)
+int(12300000)
--- testing: '123e5xyz' << '65' ---
int(0)
--- testing: '123e5xyz' << '-44' ---
Exception: Bit shift by negative number
--- testing: '123e5xyz' << '1.2' ---
-int(246)
+int(24600000)
--- testing: '123e5xyz' << '-7.7' ---
Exception: Bit shift by negative number
--- testing: '123e5xyz' << 'abc' ---
-int(123)
+int(12300000)
--- testing: '123e5xyz' << '123abc' ---
int(0)
--- testing: '123e5xyz' << '123e5' ---
@@ -278,9 +278,9 @@ int(0)
--- testing: '123e5xyz' << '123abc ' ---
int(0)
--- testing: '123e5xyz' << '3.4a' ---
-int(984)
+int(98400000)
--- testing: '123e5xyz' << 'a5.9' ---
-int(123)
+int(12300000)
--- testing: ' 123abc' << '0' ---
int(123)
--- testing: ' 123abc' << '65' ---
diff --git a/tests/lang/operators/bitwiseShiftRight_variationStr.phpt b/tests/lang/operators/bitwiseShiftRight_variationStr.phpt
index a86d0cfddb..a4c425aab3 100644
--- a/tests/lang/operators/bitwiseShiftRight_variationStr.phpt
+++ b/tests/lang/operators/bitwiseShiftRight_variationStr.phpt
@@ -222,17 +222,17 @@ int(15)
--- testing: '123abc' >> 'a5.9' ---
int(123)
--- testing: '123e5' >> '0' ---
-int(123)
+int(12300000)
--- testing: '123e5' >> '65' ---
int(0)
--- testing: '123e5' >> '-44' ---
Exception: Bit shift by negative number
--- testing: '123e5' >> '1.2' ---
-int(61)
+int(6150000)
--- testing: '123e5' >> '-7.7' ---
Exception: Bit shift by negative number
--- testing: '123e5' >> 'abc' ---
-int(123)
+int(12300000)
--- testing: '123e5' >> '123abc' ---
int(0)
--- testing: '123e5' >> '123e5' ---
@@ -246,21 +246,21 @@ int(0)
--- testing: '123e5' >> '123abc ' ---
int(0)
--- testing: '123e5' >> '3.4a' ---
-int(15)
+int(1537500)
--- testing: '123e5' >> 'a5.9' ---
-int(123)
+int(12300000)
--- testing: '123e5xyz' >> '0' ---
-int(123)
+int(12300000)
--- testing: '123e5xyz' >> '65' ---
int(0)
--- testing: '123e5xyz' >> '-44' ---
Exception: Bit shift by negative number
--- testing: '123e5xyz' >> '1.2' ---
-int(61)
+int(6150000)
--- testing: '123e5xyz' >> '-7.7' ---
Exception: Bit shift by negative number
--- testing: '123e5xyz' >> 'abc' ---
-int(123)
+int(12300000)
--- testing: '123e5xyz' >> '123abc' ---
int(0)
--- testing: '123e5xyz' >> '123e5' ---
@@ -274,9 +274,9 @@ int(0)
--- testing: '123e5xyz' >> '123abc ' ---
int(0)
--- testing: '123e5xyz' >> '3.4a' ---
-int(15)
+int(1537500)
--- testing: '123e5xyz' >> 'a5.9' ---
-int(123)
+int(12300000)
--- testing: ' 123abc' >> '0' ---
int(123)
--- testing: ' 123abc' >> '65' ---
diff --git a/tests/lang/operators/modulus_variationStr.phpt b/tests/lang/operators/modulus_variationStr.phpt
index c647ecd380..4cfd7768ff 100644
--- a/tests/lang/operators/modulus_variationStr.phpt
+++ b/tests/lang/operators/modulus_variationStr.phpt
@@ -208,9 +208,9 @@ Exception: Modulo by zero
--- testing: '123abc' % '123abc' ---
int(0)
--- testing: '123abc' % '123e5' ---
-int(0)
+int(123)
--- testing: '123abc' % '123e5xyz' ---
-int(0)
+int(123)
--- testing: '123abc' % ' 123abc' ---
int(0)
--- testing: '123abc' % '123 abc' ---
@@ -224,13 +224,13 @@ Exception: Modulo by zero
--- testing: '123e5' % '0' ---
Exception: Modulo by zero
--- testing: '123e5' % '65' ---
-int(58)
+int(50)
--- testing: '123e5' % '-44' ---
-int(35)
+int(20)
--- testing: '123e5' % '1.2' ---
int(0)
--- testing: '123e5' % '-7.7' ---
-int(4)
+int(6)
--- testing: '123e5' % 'abc' ---
Exception: Modulo by zero
--- testing: '123e5' % '123abc' ---
@@ -252,13 +252,13 @@ Exception: Modulo by zero
--- testing: '123e5xyz' % '0' ---
Exception: Modulo by zero
--- testing: '123e5xyz' % '65' ---
-int(58)
+int(50)
--- testing: '123e5xyz' % '-44' ---
-int(35)
+int(20)
--- testing: '123e5xyz' % '1.2' ---
int(0)
--- testing: '123e5xyz' % '-7.7' ---
-int(4)
+int(6)
--- testing: '123e5xyz' % 'abc' ---
Exception: Modulo by zero
--- testing: '123e5xyz' % '123abc' ---
@@ -292,9 +292,9 @@ Exception: Modulo by zero
--- testing: ' 123abc' % '123abc' ---
int(0)
--- testing: ' 123abc' % '123e5' ---
-int(0)
+int(123)
--- testing: ' 123abc' % '123e5xyz' ---
-int(0)
+int(123)
--- testing: ' 123abc' % ' 123abc' ---
int(0)
--- testing: ' 123abc' % '123 abc' ---
@@ -320,9 +320,9 @@ Exception: Modulo by zero
--- testing: '123 abc' % '123abc' ---
int(0)
--- testing: '123 abc' % '123e5' ---
-int(0)
+int(123)
--- testing: '123 abc' % '123e5xyz' ---
-int(0)
+int(123)
--- testing: '123 abc' % ' 123abc' ---
int(0)
--- testing: '123 abc' % '123 abc' ---
@@ -348,9 +348,9 @@ Exception: Modulo by zero
--- testing: '123abc ' % '123abc' ---
int(0)
--- testing: '123abc ' % '123e5' ---
-int(0)
+int(123)
--- testing: '123abc ' % '123e5xyz' ---
-int(0)
+int(123)
--- testing: '123abc ' % ' 123abc' ---
int(0)
--- testing: '123abc ' % '123 abc' ---
diff --git a/tests/lang/operators/negate_variationStr.phpt b/tests/lang/operators/negate_variationStr.phpt
index a25bdda7f5..7405d42882 100644
--- a/tests/lang/operators/negate_variationStr.phpt
+++ b/tests/lang/operators/negate_variationStr.phpt
@@ -16,7 +16,7 @@ foreach ($strVals as $strVal) {
?>
===DONE===
---EXPECT--
+--EXPECTF--
--- testing: '0' ---
int(0)
--- testing: '65' ---
@@ -28,21 +28,37 @@ float(-1.2)
--- testing: '-7.7' ---
float(7.7)
--- testing: 'abc' ---
+
+Warning: A non-numeric value encountered in %s on line %d
int(0)
--- testing: '123abc' ---
+
+Notice: A non well formed numeric value encountered in %s on line %d
int(-123)
--- testing: '123e5' ---
float(-12300000)
--- testing: '123e5xyz' ---
+
+Notice: A non well formed numeric value encountered in %s on line %d
float(-12300000)
--- testing: ' 123abc' ---
+
+Notice: A non well formed numeric value encountered in %s on line %d
int(-123)
--- testing: '123 abc' ---
+
+Notice: A non well formed numeric value encountered in %s on line %d
int(-123)
--- testing: '123abc ' ---
+
+Notice: A non well formed numeric value encountered in %s on line %d
int(-123)
--- testing: '3.4a' ---
+
+Notice: A non well formed numeric value encountered in %s on line %d
float(-3.4)
--- testing: 'a5.9' ---
+
+Warning: A non-numeric value encountered in %s on line %d
int(0)
===DONE===
diff --git a/tests/lang/type_hints_003.phpt b/tests/lang/type_hints_003.phpt
index 0ef3e3516b..2b536d0185 100644
--- a/tests/lang/type_hints_003.phpt
+++ b/tests/lang/type_hints_003.phpt
@@ -1,5 +1,5 @@
--TEST--
-ZE2 type hinting
+ZE2 type
--SKIPIF--
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
--FILE--
@@ -11,4 +11,4 @@ class T {
?>
--EXPECTF--
-Fatal error: Default value for parameters with a class type hint can only be NULL in %stype_hints_003.php on line 3
+Fatal error: Default value for parameters with a class type can only be NULL in %stype_hints_003.php on line 3