summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/fscanf_variation40.phpt
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2019-12-09 20:29:01 +0100
committerMáté Kocsis <kocsismate@woohoolabs.com>2019-12-10 13:01:59 +0100
commit33f7cabbf0c5f33b65c8106e2dc1ebc513f67df3 (patch)
tree1d81004801c97346938c3d64cd25d7299e6a8f2b /ext/standard/tests/file/fscanf_variation40.phpt
parentea4bb588893cb54c8350b1ae150d6ec9dd50066e (diff)
downloadphp-git-33f7cabbf0c5f33b65c8106e2dc1ebc513f67df3.tar.gz
Promote warnings to exceptions in *scanf() functions
Diffstat (limited to 'ext/standard/tests/file/fscanf_variation40.phpt')
-rw-r--r--ext/standard/tests/file/fscanf_variation40.phpt68
1 files changed, 21 insertions, 47 deletions
diff --git a/ext/standard/tests/file/fscanf_variation40.phpt b/ext/standard/tests/file/fscanf_variation40.phpt
index c65aaac9c7..986d1face4 100644
--- a/ext/standard/tests/file/fscanf_variation40.phpt
+++ b/ext/standard/tests/file/fscanf_variation40.phpt
@@ -71,7 +71,11 @@ foreach($unsigned_formats as $unsigned_format) {
rewind($file_handle);
echo "\n-- iteration $counter --\n";
while( !feof($file_handle) ) {
- var_dump( fscanf($file_handle,$unsigned_format) );
+ try {
+ var_dump(fscanf($file_handle,$unsigned_format));
+ } catch (ValueError $exception) {
+ echo $exception->getMessage() . "\n";
+ }
}
$counter++;
}
@@ -84,7 +88,7 @@ $file_path = __DIR__;
$filename = "$file_path/fscanf_variation40.tmp";
unlink($filename);
?>
---EXPECTF--
+--EXPECT--
*** Test fscanf(): different unsigned format types with float values ***
-- iteration 1 --
@@ -466,51 +470,21 @@ array(1) {
bool(false)
-- iteration 7 --
-
-Warning: fscanf(): Bad scan conversion character " " in %s on line %d
-NULL
-
-Warning: fscanf(): Bad scan conversion character " " in %s on line %d
-NULL
-
-Warning: fscanf(): Bad scan conversion character " " in %s on line %d
-NULL
-
-Warning: fscanf(): Bad scan conversion character " " in %s on line %d
-NULL
-
-Warning: fscanf(): Bad scan conversion character " " in %s on line %d
-NULL
-
-Warning: fscanf(): Bad scan conversion character " " in %s on line %d
-NULL
-
-Warning: fscanf(): Bad scan conversion character " " in %s on line %d
-NULL
-
-Warning: fscanf(): Bad scan conversion character " " in %s on line %d
-NULL
-
-Warning: fscanf(): Bad scan conversion character " " in %s on line %d
-NULL
-
-Warning: fscanf(): Bad scan conversion character " " in %s on line %d
-NULL
-
-Warning: fscanf(): Bad scan conversion character " " in %s on line %d
-NULL
-
-Warning: fscanf(): Bad scan conversion character " " in %s on line %d
-NULL
-
-Warning: fscanf(): Bad scan conversion character " " in %s on line %d
-NULL
-
-Warning: fscanf(): Bad scan conversion character " " in %s on line %d
-NULL
-
-Warning: fscanf(): Bad scan conversion character " " in %s on line %d
-NULL
+Bad scan conversion character " "
+Bad scan conversion character " "
+Bad scan conversion character " "
+Bad scan conversion character " "
+Bad scan conversion character " "
+Bad scan conversion character " "
+Bad scan conversion character " "
+Bad scan conversion character " "
+Bad scan conversion character " "
+Bad scan conversion character " "
+Bad scan conversion character " "
+Bad scan conversion character " "
+Bad scan conversion character " "
+Bad scan conversion character " "
+Bad scan conversion character " "
bool(false)
-- iteration 8 --