summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/fscanf_variation44.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/tests/file/fscanf_variation44.phpt')
-rw-r--r--ext/standard/tests/file/fscanf_variation44.phpt29
1 files changed, 10 insertions, 19 deletions
diff --git a/ext/standard/tests/file/fscanf_variation44.phpt b/ext/standard/tests/file/fscanf_variation44.phpt
index 6c61ba9507..3dfd5d6d7b 100644
--- a/ext/standard/tests/file/fscanf_variation44.phpt
+++ b/ext/standard/tests/file/fscanf_variation44.phpt
@@ -3,11 +3,6 @@ Test fscanf() function: usage variations - unsigned formats with boolean
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan boolean data using different unsigned format types */
$file_path = __DIR__;
@@ -53,7 +48,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++;
}
@@ -66,7 +65,7 @@ $file_path = __DIR__;
$filename = "$file_path/fscanf_variation44.tmp";
unlink($filename);
?>
---EXPECTF--
+--EXPECT--
*** Test fscanf(): different unsigned format types with boolean data ***
-- iteration 1 --
@@ -148,18 +147,10 @@ NULL
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
+Bad scan conversion character " "
+Bad scan conversion character " "
+Bad scan conversion character " "
+Bad scan conversion character " "
bool(false)
-- iteration 8 --