summaryrefslogtreecommitdiff
path: root/tests/lang/bug28800.phpt
diff options
context:
space:
mode:
authorGeorge Peter Banyard <girgias@php.net>2020-07-29 02:51:09 +0100
committerGeorge Peter Banyard <girgias@php.net>2020-07-29 02:51:09 +0100
commitb2248789ed21300aaf356336bf43b6b065183fcb (patch)
treec61dba0a43f72d27904e956318f911c7dc719dda /tests/lang/bug28800.phpt
parentf759936591c08d9bff6ab707f2f8c192f61b5bf1 (diff)
downloadphp-git-b2248789ed21300aaf356336bf43b6b065183fcb.tar.gz
Implement 'Saner Numeric Strings' RFC:
RFC: https://wiki.php.net/rfc/saner-numeric-strings This removes the -1 allow_error mode from is_numeric_string functions and replaces it by a trailing boolean out argument to preserve BC in a couple of places. Most of the changes can be resumed to "numeric" strings which emitted a E_NOTICE now emit a E_WARNING and "numeric" strings which emitted a E_WARNING now throw a TypeError. This mostly affects: - String offsets - Arithmetic operations - Bitwise operations Closes GH-5762
Diffstat (limited to 'tests/lang/bug28800.phpt')
-rw-r--r--tests/lang/bug28800.phpt30
1 files changed, 12 insertions, 18 deletions
diff --git a/tests/lang/bug28800.phpt b/tests/lang/bug28800.phpt
index 2845ca7c88..487c57d24e 100644
--- a/tests/lang/bug28800.phpt
+++ b/tests/lang/bug28800.phpt
@@ -4,24 +4,18 @@ Bug #28800 (Incorrect string to number conversion for strings starting with 'inf
<?php
$strings = array('into', 'info', 'inf', 'infinity', 'infin', 'inflammable');
foreach ($strings as $v) {
- echo ($v+0)."\n";
+ try {
+ echo ($v+0)."\n";
+ } catch (\TypeError $e) {
+ echo $e->getMessage() . \PHP_EOL;
+ }
}
?>
---EXPECTF--
-Warning: A non-numeric value encountered in %s on line %d
-0
+--EXPECT--
+Unsupported operand types: string + int
+Unsupported operand types: string + int
+Unsupported operand types: string + int
+Unsupported operand types: string + int
+Unsupported operand types: string + int
+Unsupported operand types: string + int
-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