summaryrefslogtreecommitdiff
path: root/tests/lang/operators/negate_variationStr.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lang/operators/negate_variationStr.phpt')
-rw-r--r--tests/lang/operators/negate_variationStr.phpt29
1 files changed, 14 insertions, 15 deletions
diff --git a/tests/lang/operators/negate_variationStr.phpt b/tests/lang/operators/negate_variationStr.phpt
index 3b70349026..43b2f6a52a 100644
--- a/tests/lang/operators/negate_variationStr.phpt
+++ b/tests/lang/operators/negate_variationStr.phpt
@@ -8,10 +8,13 @@ $strVals = array(
"a5.9"
);
-
foreach ($strVals as $strVal) {
- echo "--- testing: '$strVal' ---\n";
- var_dump(-$strVal);
+ echo "--- testing: '$strVal' ---\n";
+ try {
+ var_dump(-$strVal);
+ } catch (\TypeError $e) {
+ echo $e->getMessage() . \PHP_EOL;
+ }
}
?>
@@ -27,36 +30,32 @@ float(-1.2)
--- testing: '-7.7' ---
float(7.7)
--- testing: 'abc' ---
-
-Warning: A non-numeric value encountered in %s on line %d
-int(0)
+Unsupported operand types: string * int
--- testing: '123abc' ---
-Notice: A non well formed numeric value encountered in %s on line %d
+Warning: A non-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
+Warning: A non-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
+Warning: A non-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
+Warning: A non-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
+Warning: A non-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
+Warning: A non-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)
+Unsupported operand types: string * int