diff options
Diffstat (limited to 'ext/standard/tests/file')
811 files changed, 6516 insertions, 24100 deletions
diff --git a/ext/standard/tests/file/001.phpt b/ext/standard/tests/file/001.phpt index f1dd8c0894..8fe6946d72 100644 --- a/ext/standard/tests/file/001.phpt +++ b/ext/standard/tests/file/001.phpt @@ -50,14 +50,14 @@ $s = stat ('test.file'); $ls = lstat ('test.file'); for ($i = 0; $i <= 12; $i++) { if ($ls[$i] != $s[$i]) { - echo "test.file lstat and stat differ at element $i\n"; + echo "test.file lstat and stat differ at element $i\n"; } } $s = stat ('test.link'); $ls = lstat ('test.link'); for ($i = 0; $i <= 11; $i++) { if ($ls[$i] != $s[$i]) { - if ($i != 6 && $i != 10 && $i != 11) echo "test.link lstat and stat differ at element $i\n"; + if ($i != 6 && $i != 10 && $i != 11) echo "test.link lstat and stat differ at element $i\n"; } } echo "test.file is " . filetype('test.file') . "\n"; diff --git a/ext/standard/tests/file/003.phpt b/ext/standard/tests/file/003.phpt index 8eeaa939eb..59e03f0cef 100644 --- a/ext/standard/tests/file/003.phpt +++ b/ext/standard/tests/file/003.phpt @@ -4,27 +4,27 @@ is_*() and file_exists() return values are boolean. <?php $funcs = array( - 'is_writable', - 'is_readable', - 'is_executable', - 'is_file', - 'file_exists', + 'is_writable', + 'is_readable', + 'is_executable', + 'is_file', + 'file_exists', ); $filename=""; foreach ($funcs as $test) { - $bb = $test($filename); - echo gettype($bb)."\n"; - clearstatcache(); + $bb = $test($filename); + echo gettype($bb)."\n"; + clearstatcache(); } $filename="run-tests.php"; foreach ($funcs as $test) { - $bb = $test($filename); - echo gettype($bb)."\n"; - clearstatcache(); + $bb = $test($filename); + echo gettype($bb)."\n"; + clearstatcache(); } ?> diff --git a/ext/standard/tests/file/004.phpt b/ext/standard/tests/file/004.phpt index 522b8320e4..742457c7aa 100644 --- a/ext/standard/tests/file/004.phpt +++ b/ext/standard/tests/file/004.phpt @@ -2,56 +2,56 @@ file_put_contents() test --FILE-- <?php - chdir(__DIR__); - for ($i = 1; $i < 6; $i++) { - @unlink("./TEST{$i}"); - } + chdir(__DIR__); + for ($i = 1; $i < 6; $i++) { + @unlink("./TEST{$i}"); + } - echo "String Test: "; - echo file_put_contents("TEST1", file_get_contents(__FILE__)) !== FALSE ? 'OK' : 'FAIL'; - echo "\n"; + echo "String Test: "; + echo file_put_contents("TEST1", file_get_contents(__FILE__)) !== FALSE ? 'OK' : 'FAIL'; + echo "\n"; - $old_int = $int = rand(); - $ret = file_put_contents("TEST2", $int); - echo "Integer Test: "; - if ($int === $old_int && $ret !== FALSE && md5($int) == md5_file("TEST2")) { - echo 'OK'; - } else { - echo 'FAIL'; - } - echo "\n"; + $old_int = $int = rand(); + $ret = file_put_contents("TEST2", $int); + echo "Integer Test: "; + if ($int === $old_int && $ret !== FALSE && md5($int) == md5_file("TEST2")) { + echo 'OK'; + } else { + echo 'FAIL'; + } + echo "\n"; - $old_int = $int = time() / 1000; - $ret = file_put_contents("TEST3", $int); - echo "Float Test: "; - if ($int === $old_int && $ret !== FALSE && md5($int) == md5_file("TEST3")) { - echo 'OK'; - } else { - echo 'FAIL'; - } - echo "\n"; + $old_int = $int = time() / 1000; + $ret = file_put_contents("TEST3", $int); + echo "Float Test: "; + if ($int === $old_int && $ret !== FALSE && md5($int) == md5_file("TEST3")) { + echo 'OK'; + } else { + echo 'FAIL'; + } + echo "\n"; - $ret = file_put_contents("TEST4", __FILE__); - echo "Bool Test: "; - if ($ret !== FALSE && md5(__FILE__) == md5_file("TEST4")) { - echo 'OK'; - } else { - echo 'FAIL'; - } - echo "\n"; + $ret = file_put_contents("TEST4", __FILE__); + echo "Bool Test: "; + if ($ret !== FALSE && md5(__FILE__) == md5_file("TEST4")) { + echo 'OK'; + } else { + echo 'FAIL'; + } + echo "\n"; - $ret = @file_put_contents("TEST5", $_SERVER); - echo "Array Test: "; - if ($ret !== FALSE && @md5(implode('', $_SERVER)) == md5_file("TEST5")) { - echo 'OK'; - } else { - echo 'FAIL'; - } - echo "\n"; + $ret = @file_put_contents("TEST5", $_SERVER); + echo "Array Test: "; + if ($ret !== FALSE && @md5(implode('', $_SERVER)) == md5_file("TEST5")) { + echo 'OK'; + } else { + echo 'FAIL'; + } + echo "\n"; - for ($i = 1; $i < 6; $i++) { - @unlink("./TEST{$i}"); - } + for ($i = 1; $i < 6; $i++) { + @unlink("./TEST{$i}"); + } ?> --EXPECT-- String Test: OK diff --git a/ext/standard/tests/file/005_basic.phpt b/ext/standard/tests/file/005_basic.phpt index 242110cef3..3f68e0102e 100644 --- a/ext/standard/tests/file/005_basic.phpt +++ b/ext/standard/tests/file/005_basic.phpt @@ -2,23 +2,6 @@ Test fileatime(), filemtime(), filectime() & touch() functions : basic functionality --FILE-- <?php -/* - Prototype: int fileatime ( string $filename ); - Description: Returns the time the file was last accessed, or FALSE - in case of an error. The time is returned as a Unix timestamp. - - Prototype: int filemtime ( string $filename ); - Description: Returns the time the file was last modified, or FALSE - in case of an error. - - Prototype: int filectime ( string $filename ); - Description: Returns the time the file was last changed, or FALSE - in case of an error. The time is returned as a Unix timestamp. - - Prototype: bool touch ( string $filename [, int $time [, int $atime]] ); - Description: Attempts to set the access and modification times of the file - named in the filename parameter to the value given in time. -*/ echo "*** Testing the basic functionality with file ***\n"; print( @date('Y:M:D:H:i:s', fileatime(__FILE__)) )."\n"; diff --git a/ext/standard/tests/file/005_error.phpt b/ext/standard/tests/file/005_error.phpt index e3ce551b3d..b44d3a0623 100644 --- a/ext/standard/tests/file/005_error.phpt +++ b/ext/standard/tests/file/005_error.phpt @@ -2,23 +2,6 @@ Test fileatime(), filemtime(), filectime() & touch() functions : error conditions --FILE-- <?php -/* - Prototype: int fileatime ( string $filename ); - Description: Returns the time the file was last accessed, or FALSE - in case of an error. The time is returned as a Unix timestamp. - - Prototype: int filemtime ( string $filename ); - Description: Returns the time the file was last modified, or FALSE - in case of an error. - - Prototype: int filectime ( string $filename ); - Description: Returns the time the file was last changed, or FALSE - in case of an error. The time is returned as a Unix timestamp. - - Prototype: bool touch ( string $filename [, int $time [, int $atime]] ); - Description: Attempts to set the access and modification times of the file - named in the filename parameter to the value given in time. -*/ echo "*** Testing error conditions ***\n"; @@ -29,31 +12,6 @@ var_dump( filemtime("/no/such/file/or/dir") ); var_dump( filectime("/no/such/file/or/dir") ); var_dump( touch("/no/such/file/or/dir", 10) ); -/* Only one invalid argument */ -var_dump( fileatime(__FILE__, "string") ); -var_dump( filemtime(__FILE__, 100) ); -var_dump( filectime(__FILE__, TRUE) ); -var_dump( touch(__FILE__, 10, 100, 123) ); - -echo "\n-- Testing No.of arguments less than expected --"; -var_dump( fileatime() ); -var_dump( filemtime() ); -var_dump( filectime() ); -var_dump( touch() ); - -echo "\n-- Testing No.of arguments greater than expected --"; -/* Both invalid arguments */ -var_dump( fileatime("/no/such/file/or/dir", "string") ); -var_dump( filemtime("/no/such/file/or/dir", 100) ); -var_dump( filectime("/no/such/file/or/dir", TRUE) ); -var_dump( touch("/no/such/file/or/dir", 10, 100, 123) ); - -/* Only one invalid argument */ -var_dump( fileatime(__FILE__, "string") ); -var_dump( filemtime(__FILE__, 100) ); -var_dump( filectime(__FILE__, TRUE) ); -var_dump( touch(__FILE__, 10, 100, 123) ); - echo "\nDone"; ?> --EXPECTF-- @@ -72,54 +30,4 @@ bool(false) Warning: touch(): Unable to create file /no/such/file/or/dir because No such file or directory in %s on line %d bool(false) -Warning: fileatime() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: filemtime() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: filectime() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: touch() expects at most 3 parameters, 4 given in %s on line %d -NULL - --- Testing No.of arguments less than expected -- -Warning: fileatime() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: filemtime() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: filectime() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: touch() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing No.of arguments greater than expected -- -Warning: fileatime() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: filemtime() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: filectime() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: touch() expects at most 3 parameters, 4 given in %s on line %d -NULL - -Warning: fileatime() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: filemtime() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: filectime() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: touch() expects at most 3 parameters, 4 given in %s on line %d -NULL - Done diff --git a/ext/standard/tests/file/005_variation-win32.phpt b/ext/standard/tests/file/005_variation-win32.phpt index 1e712b7828..ba58369a29 100644 --- a/ext/standard/tests/file/005_variation-win32.phpt +++ b/ext/standard/tests/file/005_variation-win32.phpt @@ -8,28 +8,7 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* - Prototype: int fileatime ( string $filename ); - Description: Returns the time the file was last accessed, or FALSE - in case of an error. The time is returned as a Unix timestamp. - - Prototype: int filemtime ( string $filename ); - Description: Returns the time the file was last modified, or FALSE - in case of an error. - - Prototype: int filectime ( string $filename ); - Description: Returns the time the file was last changed, or FALSE - in case of an error. The time is returned as a Unix timestamp. - - Prototype: bool touch ( string $filename [, int $time [, int $atime]] ); - Description: Attempts to set the access and modification times of the file - named in the filename parameter to the value given in time. -*/ - -/* - Prototype: void stat_fn(string $filename); - Description: Prints access, modification and change times of a file -*/ + function stat_fn( $filename ) { echo "-- File access time is => "; print( @date( 'Y:M:D:H:i:s', fileatime($filename) ) )."\n"; @@ -40,7 +19,6 @@ function stat_fn( $filename ) { echo "-- inode change time is => "; print( @date( 'Y:M:D:H:i:s', filectime($filename) ) )."\n"; clearstatcache(); - } echo "*** Testing fileattime(), filemtime(), filectime() & touch() : usage variations ***\n"; @@ -49,12 +27,12 @@ $file_path = __DIR__; $file_handle = fopen("$file_path/005_variation1.tmp", "w"); fclose($file_handle); stat_fn("$file_path/005_variation1.tmp"); -sleep(2); +sleep(1); $file_handle = fopen("$file_path/005_variation2.tmp", "w"); fclose($file_handle); stat_fn("$file_path/005_variation2.tmp"); -sleep(2); +sleep(1); $file_handle = fopen("$file_path/005_variation3.tmp", "w"); fclose($file_handle); @@ -70,13 +48,13 @@ $file_name = "$file_path/005_variation1.tmp"; $file_write_handle = fopen($file_name, "w"); fclose($file_write_handle); stat_fn($file_name); -sleep(2); +sleep(1); /* filectime + 2 */ echo "\n-- Checking different times, after changing the file permission --\n"; chmod($file_name, 0777); stat_fn($file_name); -sleep(2); +sleep(1); /* filemtime + 2 & filectime + 2 */ echo "\n-- Checking different times, after writing into the file --\n"; @@ -84,7 +62,7 @@ $file_write_handle = fopen($file_name, "w"); fwrite($file_write_handle, "Hello, world"); fclose($file_write_handle); stat_fn($file_name); -sleep(2); +sleep(1); /* fileatime + 2 */ echo "\n-- Checking different times, after reading from the file --\n"; @@ -92,42 +70,54 @@ $file_read_handle = fopen($file_name ,"r"); fread($file_read_handle, 10); fclose( $file_read_handle); stat_fn($file_name); -sleep(2); +sleep(1); + +/* No change */ +echo "\n-- Checking same times, after creating a softlink to the file --\n"; +symlink($file_name, "$file_path/005_variation_softlink.tmp"); +stat_fn($file_name); +sleep(1); + +/* filectime + 2 */ +echo "\n-- Checking different times, after creating a hardlink to the file --\n"; +link($file_name, "$file_path/005_variation_hardlink.tmp"); +stat_fn($file_name); +sleep(1); /* No change */ -echo "\n-- Checking different times, after making a copy of the file --\n"; +echo "\n-- Checking same times, after making a copy of the file --\n"; $file_copy = "$file_path/005_variation_copy.tmp"; copy($file_name, $file_copy); stat_fn($file_name); -sleep(2); +sleep(1); /* fileatime + 2 */ echo "\n-- Checking different times, after performing is_file() operation on the file --\n"; is_file($file_name); stat_fn($file_name); -sleep(2); +sleep(1); echo "\n*** Testing touch() function with different time values ***\n"; $file_name2 = $file_path."/005_variation_touch.tmp"; $file_handle = fopen($file_name2, "w"); fclose($file_handle); -sleep(2); +sleep(1); /* Time is not mentioned */ var_dump( touch($file_name2) ); //set to current system time stat_fn($file_name2); -sleep(2); +sleep(1); /* set to access(creation time of the file) time */ var_dump( touch($file_name2, @date(fileatime($file_name2))) ); stat_fn($file_name2); -sleep(2); +sleep(1); /* set to access time of $file_name2 */ var_dump( touch($file_path."/005_variation_touch_fly.tmp", @date(fileatime($file_name2)), time()) ); stat_fn($file_name2); -sleep(2); +sleep(1); /* set to default value, with Invalid timestamps */ var_dump( touch($file_name2, 10) ); @@ -184,7 +174,17 @@ unlink($file_path."/005_variation_touch_new.tmp"); -- File modification time is => %d:%s:%s:%d:%d:%d -- inode change time is => %d:%s:%s:%d:%d:%d --- Checking different times, after making a copy of the file -- +-- Checking same times, after creating a softlink to the file -- +-- File access time is => %d:%s:%s:%d:%d:%d +-- File modification time is => %d:%s:%s:%d:%d:%d +-- inode change time is => %d:%s:%s:%d:%d:%d + +-- Checking different times, after creating a hardlink to the file -- +-- File access time is => %d:%s:%s:%d:%d:%d +-- File modification time is => %d:%s:%s:%d:%d:%d +-- inode change time is => %d:%s:%s:%d:%d:%d + +-- Checking same times, after making a copy of the file -- -- File access time is => %d:%s:%s:%d:%d:%d -- File modification time is => %d:%s:%s:%d:%d:%d -- inode change time is => %d:%s:%s:%d:%d:%d diff --git a/ext/standard/tests/file/005_variation2-win32.phpt b/ext/standard/tests/file/005_variation2-win32.phpt index 63b3c1db67..407f51a4d1 100644 --- a/ext/standard/tests/file/005_variation2-win32.phpt +++ b/ext/standard/tests/file/005_variation2-win32.phpt @@ -10,28 +10,7 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* - Prototype: int fileatime ( string $filename ); - Description: Returns the time the file was last accessed, or FALSE - in case of an error. The time is returned as a Unix timestamp. - - Prototype: int filemtime ( string $filename ); - Description: Returns the time the file was last modified, or FALSE - in case of an error. - - Prototype: int filectime ( string $filename ); - Description: Returns the time the file was last changed, or FALSE - in case of an error. The time is returned as a Unix timestamp. - - Prototype: bool touch ( string $filename [, int $time [, int $atime]] ); - Description: Attempts to set the access and modification times of the file - named in the filename parameter to the value given in time. -*/ - -/* - Prototype: void stat_fn(string $filename); - Description: Prints access, modification and change times of a file -*/ + function stat_fn( $filename ) { echo "\n-- File '$filename' --\n"; echo "-- File access time is => "; diff --git a/ext/standard/tests/file/005_variation2.phpt b/ext/standard/tests/file/005_variation2.phpt index f365174a84..5a878a687b 100644 --- a/ext/standard/tests/file/005_variation2.phpt +++ b/ext/standard/tests/file/005_variation2.phpt @@ -10,28 +10,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* - Prototype: int fileatime ( string $filename ); - Description: Returns the time the file was last accessed, or FALSE - in case of an error. The time is returned as a Unix timestamp. - Prototype: int filemtime ( string $filename ); - Description: Returns the time the file was last modified, or FALSE - in case of an error. - - Prototype: int filectime ( string $filename ); - Description: Returns the time the file was last changed, or FALSE - in case of an error. The time is returned as a Unix timestamp. - - Prototype: bool touch ( string $filename [, int $time [, int $atime]] ); - Description: Attempts to set the access and modification times of the file - named in the filename parameter to the value given in time. -*/ - -/* - Prototype: void stat_fn(string $filename); - Description: Prints access, modification and change times of a file -*/ function stat_fn( $filename ) { echo "\n-- File '$filename' --\n"; echo "-- File access time is => "; diff --git a/ext/standard/tests/file/006_basic.phpt b/ext/standard/tests/file/006_basic.phpt index 43c9b86ab0..17092ce02e 100644 --- a/ext/standard/tests/file/006_basic.phpt +++ b/ext/standard/tests/file/006_basic.phpt @@ -9,14 +9,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* - Prototype: int fileperms ( string $filename ); - Description: Returns the permissions on the file, or FALSE in case of an error - - Prototype: bool chmod ( string $filename, int $mode ); - Description: Attempts to change the mode of the file specified by - filename to that given in mode -*/ $path = __DIR__; echo "*** Testing fileperms(), chmod() with files and dirs ***\n"; diff --git a/ext/standard/tests/file/006_error.phpt b/ext/standard/tests/file/006_error.phpt index 9451a3e18b..ce3fdf2854 100644 --- a/ext/standard/tests/file/006_error.phpt +++ b/ext/standard/tests/file/006_error.phpt @@ -9,15 +9,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* - Prototype: int fileperms ( string $filename ) - Description: Returns the permissions on the file, or FALSE in case of an error - - Prototype: bool chmod ( string $filename, int $mode ) - Description: Attempts to change the mode of the file specified by - filename to that given in mode -*/ - echo "*** Testing error conditions for fileperms(), chmod() ***\n"; /* With standard files and dirs */ @@ -36,19 +27,6 @@ var_dump( chmod("/no/such/file/dir", 0777) ); var_dump( fileperms("/no/such/file/dir") ); echo "\n"; -/* With args less than expected */ -$fp = fopen(__DIR__."/006_error.tmp", "w"); -fclose($fp); -var_dump( chmod(__DIR__."/006_error.tmp") ); -var_dump( chmod("nofile") ); -var_dump( chmod() ); -var_dump( fileperms() ); - -/* With args greater than expected */ -var_dump( chmod(__DIR__."/006_error.tmp", 0755, TRUE) ); -var_dump( fileperms(__DIR__."/006_error.tmp", 0777) ); -var_dump( fileperms("nofile", 0777) ); - echo "\n*** Done ***\n"; ?> --CLEAN-- @@ -73,25 +51,4 @@ Warning: fileperms(): stat failed for /no/such/file/dir in %s on line %d bool(false) -Warning: chmod() expects exactly 2 parameters, 1 given in %s on line %d -NULL - -Warning: chmod() expects exactly 2 parameters, 1 given in %s on line %d -NULL - -Warning: chmod() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: fileperms() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: chmod() expects exactly 2 parameters, 3 given in %s on line %d -NULL - -Warning: fileperms() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: fileperms() expects exactly 1 parameter, 2 given in %s on line %d -NULL - *** Done *** diff --git a/ext/standard/tests/file/006_variation1.phpt b/ext/standard/tests/file/006_variation1.phpt index 5a90ea6fb3..9d523b956b 100644 --- a/ext/standard/tests/file/006_variation1.phpt +++ b/ext/standard/tests/file/006_variation1.phpt @@ -9,15 +9,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* - Prototype: int fileperms ( string $filename ); - Description: Returns the permissions on the file, or FALSE in case of an error - - Prototype: bool chmod ( string $filename, int $mode ); - Description: Attempts to change the mode of the file specified by - filename to that given in mode -*/ - echo "*** Testing fileperms() & chmod() : usage variations ***\n"; $file_name = __DIR__."/006_variation1.tmp"; diff --git a/ext/standard/tests/file/006_variation2.phpt b/ext/standard/tests/file/006_variation2.phpt index 6e87d24675..72efa07032 100644 --- a/ext/standard/tests/file/006_variation2.phpt +++ b/ext/standard/tests/file/006_variation2.phpt @@ -9,15 +9,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* - Prototype: int fileperms ( string $filename ); - Description: Returns the permissions on the file, or FALSE in case of an error - - Prototype: bool chmod ( string $filename, int $mode ); - Description: Attempts to change the mode of the file specified by - filename to that given in mode -*/ - /* Testing with miscellaneous Permission */ echo "*** Testing fileperms() & chmod() : usage variations ***\n"; @@ -58,15 +49,23 @@ $perms_array = array( $count = 1; foreach($perms_array as $permission) { echo "-- Iteration $count --\n"; - var_dump( chmod($file_name, $permission) ); - printf("%o", fileperms($file_name) ); - echo "\n"; - clearstatcache(); - - var_dump( chmod($dir_name, $permission) ); - printf("%o", fileperms($dir_name) ); - echo "\n"; - clearstatcache(); + try { + var_dump( chmod($file_name, $permission) ); + printf("%o", fileperms($file_name) ); + echo "\n"; + clearstatcache(); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + + try { + var_dump( chmod($dir_name, $permission) ); + printf("%o", fileperms($dir_name) ); + echo "\n"; + clearstatcache(); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $count++; } echo "*** Done ***\n"; @@ -78,7 +77,7 @@ chmod(__DIR__."/006_variation2", 0777); unlink(__DIR__."/006_variation2.tmp"); rmdir(__DIR__."/006_variation2"); ?> ---EXPECTF-- +--EXPECT-- *** Testing fileperms() & chmod() : usage variations *** *** Testing fileperms(), chmod() with miscellaneous permissions *** @@ -138,39 +137,15 @@ bool(true) bool(true) 43567 -- Iteration 12 -- - -Warning: chmod() expects parameter 2 to be int, string given in %s on line %d -NULL -103567 - -Warning: chmod() expects parameter 2 to be int, string given in %s on line %d -NULL -43567 +chmod(): Argument #2 ($mode) must be of type int, string given +chmod(): Argument #2 ($mode) must be of type int, string given -- Iteration 13 -- - -Warning: chmod() expects parameter 2 to be int, string given in %s on line %d -NULL -103567 - -Warning: chmod() expects parameter 2 to be int, string given in %s on line %d -NULL -43567 +chmod(): Argument #2 ($mode) must be of type int, string given +chmod(): Argument #2 ($mode) must be of type int, string given -- Iteration 14 -- - -Warning: chmod() expects parameter 2 to be int, string given in %s on line %d -NULL -103567 - -Warning: chmod() expects parameter 2 to be int, string given in %s on line %d -NULL -43567 +chmod(): Argument #2 ($mode) must be of type int, string given +chmod(): Argument #2 ($mode) must be of type int, string given -- Iteration 15 -- - -Warning: chmod() expects parameter 2 to be int, string given in %s on line %d -NULL -103567 - -Warning: chmod() expects parameter 2 to be int, string given in %s on line %d -NULL -43567 +chmod(): Argument #2 ($mode) must be of type int, string given +chmod(): Argument #2 ($mode) must be of type int, string given *** Done *** diff --git a/ext/standard/tests/file/007_basic.phpt b/ext/standard/tests/file/007_basic.phpt index fd2e5575a9..3e30ebf689 100644 --- a/ext/standard/tests/file/007_basic.phpt +++ b/ext/standard/tests/file/007_basic.phpt @@ -2,18 +2,6 @@ Test fopen(), fclose() & feof() functions: basic functionality --FILE-- <?php -/* - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. - - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer - - Prototype: bool feof ( resource $handle ); - Description: Tests for end-of-file on a file pointer -*/ - echo "*** Testing basic operations of fopen() and fclose() functions ***\n"; $modes = array( "w", @@ -51,9 +39,17 @@ for( $i=0; $i<count($modes); $i++ ) { // check fclose() var_dump( fclose($handle) ); var_dump( $handle ); - // confirm the closure, using ftell() and feof(), expect, false - var_dump( ftell($handle) ); - var_dump( feof($handle) ); + // confirm the closure, using ftell() and feof() + try { + var_dump( ftell($handle) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + try { + var_dump( feof($handle) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } // remove the temp file @@ -78,9 +74,17 @@ for( $i=0; $i<count($x_modes); $i++ ) { // check fclose() var_dump( fclose($handle) ); var_dump( $handle ); - // confirm the closure, using ftell() and feof(), expect, false - var_dump( ftell($handle) ); - var_dump( feof($handle) ); + // confirm the closure, using ftell() and feof() + try { + var_dump( ftell($handle) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + try { + var_dump( feof($handle) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } var_dump( $handle ); // remove the file @@ -97,12 +101,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource -- Iteration with mode 'wb' -- resource(%d) of type (stream) @@ -110,12 +110,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource -- Iteration with mode 'wt' -- resource(%d) of type (stream) @@ -123,12 +119,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource -- Iteration with mode 'w+' -- resource(%d) of type (stream) @@ -136,12 +128,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource -- Iteration with mode 'w+b' -- resource(%d) of type (stream) @@ -149,12 +137,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource -- Iteration with mode 'w+t' -- resource(%d) of type (stream) @@ -162,12 +146,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource -- Iteration with mode 'r' -- resource(%d) of type (stream) @@ -175,12 +155,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource -- Iteration with mode 'rb' -- resource(%d) of type (stream) @@ -188,12 +164,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource -- Iteration with mode 'rt' -- resource(%d) of type (stream) @@ -201,12 +173,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource -- Iteration with mode 'r+' -- resource(%d) of type (stream) @@ -214,12 +182,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource -- Iteration with mode 'r+b' -- resource(%d) of type (stream) @@ -227,12 +191,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource -- Iteration with mode 'r+t' -- resource(%d) of type (stream) @@ -240,12 +200,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource -- Iteration with mode 'a' -- resource(%d) of type (stream) @@ -253,12 +209,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource -- Iteration with mode 'ab' -- resource(%d) of type (stream) @@ -266,12 +218,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource -- Iteration with mode 'at' -- resource(%d) of type (stream) @@ -279,12 +227,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource -- Iteration with mode 'a+' -- resource(%d) of type (stream) @@ -292,12 +236,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource -- Iteration with mode 'a+t' -- resource(%d) of type (stream) @@ -305,12 +245,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource -- Iteration with mode 'a+b' -- resource(%d) of type (stream) @@ -318,12 +254,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource -- Iteration with mode 'x' -- resource(%d) of type (stream) @@ -331,12 +263,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource resource(%d) of type (Unknown) -- Iteration with mode 'xb' -- @@ -345,12 +273,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource resource(%d) of type (Unknown) -- Iteration with mode 'xt' -- @@ -359,12 +283,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource resource(%d) of type (Unknown) -- Iteration with mode 'x+' -- @@ -373,12 +293,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource resource(%d) of type (Unknown) -- Iteration with mode 'x+b' -- @@ -387,12 +303,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource resource(%d) of type (Unknown) -- Iteration with mode 'x+t' -- @@ -401,12 +313,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) - -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource +feof(): supplied resource is not a valid stream resource resource(%d) of type (Unknown) *** Done *** diff --git a/ext/standard/tests/file/007_error.phpt b/ext/standard/tests/file/007_error.phpt deleted file mode 100644 index 93a6a23e5f..0000000000 --- a/ext/standard/tests/file/007_error.phpt +++ /dev/null @@ -1,185 +0,0 @@ ---TEST-- -Test fopen, fclose() & feof() functions: error conditions ---CREDITS-- -Dave Kelsey <d_kelsey@uk.ibm.com> ---FILE-- -<?php -/* - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. - - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer - - Prototype: bool feof ( resource $handle ) - Description: Returns TRUE if the file pointer is at EOF or an error occurs - (including socket timeout); otherwise returns FALSE. -*/ - -echo "*** Testing error conditions for fopen(), fclsoe() & feof() ***\n"; -/* Arguments less than minimum no.of args */ - -// fopen () -var_dump(fopen(__FILE__)); // one valid argument -var_dump(fopen()); // zero argument - -// fclose() -$fp = fopen(__FILE__, "r"); -fclose($fp); -var_dump( fclose($fp) ); // closed handle -var_dump( fclose(__FILE__) ); // invalid handle -var_dump( fclose() ); // zero argument - -//feof() -var_dump( feof($fp) ); // closed handle -var_dump( feof(__FILE__) ); // invalid handle -var_dump( feof() ); //zero argument - -/* Arguments greater than maximum no.of ags */ -var_dump(fopen(__FILE__, "r", TRUE, "www.example.com", 100)); - -$fp = fopen(__FILE__, "r"); -var_dump( fclose($fp, "handle") ); - -var_dump( feof($fp, "handle")); -fclose($fp); - -/* test invalid arguments : non-resources */ -echo "-- Testing fopen(), fclose() & feof() with invalid arguments --\n"; -$invalid_args = array ( - "string", - 10, - 10.5, - true, - array(1,2,3), - new stdclass, - NULL, - "" -); - -/* loop to test fclose with different invalid type of args */ -for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++) { - echo "-- Iteration $loop_counter --\n"; - var_dump( fopen($invalid_args[$loop_counter - 1], "r") ); - var_dump( fclose($invalid_args[$loop_counter - 1]) ); - var_dump( feof($invalid_args[$loop_counter - 1]) ); -} - -?> ---EXPECTF-- -*** Testing error conditions for fopen(), fclsoe() & feof() *** - -Warning: fopen() expects at least 2 parameters, 1 given in %s on line %d -bool(false) - -Warning: fopen() expects at least 2 parameters, 0 given in %s on line %d -bool(false) - -Warning: fclose(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, string given in %s on line %d -bool(false) - -Warning: fclose() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof() expects parameter 1 to be resource, string given in %s on line %d -bool(false) - -Warning: feof() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: fopen() expects at most 4 parameters, 5 given in %s on line %d -bool(false) - -Warning: fclose() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -Warning: feof() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) --- Testing fopen(), fclose() & feof() with invalid arguments -- --- Iteration 1 -- - -Warning: fopen(string): failed to open stream: No such file or directory in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, string given in %s on line %d -bool(false) - -Warning: feof() expects parameter 1 to be resource, string given in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: fopen(10): failed to open stream: No such file or directory in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, int given in %s on line %d -bool(false) - -Warning: feof() expects parameter 1 to be resource, int given in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: fopen(10.5): failed to open stream: No such file or directory in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, float given in %s on line %d -bool(false) - -Warning: feof() expects parameter 1 to be resource, float given in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: fopen(1): failed to open stream: No such file or directory in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) - -Warning: feof() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: fopen() expects parameter 1 to be a valid path, array given in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, array given in %s on line %d -bool(false) - -Warning: feof() expects parameter 1 to be resource, array given in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: fopen() expects parameter 1 to be a valid path, object given in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, object given in %s on line %d -bool(false) - -Warning: feof() expects parameter 1 to be resource, object given in %s on line %d -bool(false) --- Iteration 7 -- - -Warning: fopen(): Filename cannot be empty in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, null given in %s on line %d -bool(false) - -Warning: feof() expects parameter 1 to be resource, null given in %s on line %d -bool(false) --- Iteration 8 -- - -Warning: fopen(): Filename cannot be empty in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, string given in %s on line %d -bool(false) - -Warning: feof() expects parameter 1 to be resource, string given in %s on line %d -bool(false) diff --git a/ext/standard/tests/file/007_variation1.phpt b/ext/standard/tests/file/007_variation1.phpt index f22fdc0dc9..1ddc00d3eb 100644 --- a/ext/standard/tests/file/007_variation1.phpt +++ b/ext/standard/tests/file/007_variation1.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "r" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "r" mode, checking for the file creation, write & read operations, @@ -49,7 +38,7 @@ string(20) "line line of text li" -Notice: fwrite(): write of 37 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 37 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) bool(true) string(7) "Unknown" diff --git a/ext/standard/tests/file/007_variation10.phpt b/ext/standard/tests/file/007_variation10.phpt index 7f163265aa..2972bd2f84 100644 --- a/ext/standard/tests/file/007_variation10.phpt +++ b/ext/standard/tests/file/007_variation10.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "r+t" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "r+t" mode, checking for the file creation, write & read operations, diff --git a/ext/standard/tests/file/007_variation11-win32-mb.phpt b/ext/standard/tests/file/007_variation11-win32-mb.phpt index fc24ba3853..aea248c4eb 100644 --- a/ext/standard/tests/file/007_variation11-win32-mb.phpt +++ b/ext/standard/tests/file/007_variation11-win32-mb.phpt @@ -7,17 +7,6 @@ if( substr(PHP_OS, 0, 3) != "WIN" ) ?> --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "wt" mode, checking for the file creation, write & read operations, @@ -69,7 +58,7 @@ int(0) int(37) int(37) -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(true) diff --git a/ext/standard/tests/file/007_variation11-win32.phpt b/ext/standard/tests/file/007_variation11-win32.phpt index f52e211ea5..da8c586f99 100644 --- a/ext/standard/tests/file/007_variation11-win32.phpt +++ b/ext/standard/tests/file/007_variation11-win32.phpt @@ -7,17 +7,6 @@ if( substr(PHP_OS, 0, 3) != "WIN" ) ?> --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "wt" mode, checking for the file creation, write & read operations, @@ -67,7 +56,7 @@ int(0) int(37) int(37) -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(true) diff --git a/ext/standard/tests/file/007_variation11.phpt b/ext/standard/tests/file/007_variation11.phpt index 6bc9975104..4e38b5e2a4 100644 --- a/ext/standard/tests/file/007_variation11.phpt +++ b/ext/standard/tests/file/007_variation11.phpt @@ -7,17 +7,6 @@ if( substr(PHP_OS, 0, 3) == "WIN" ) ?> --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "wt" mode, checking for the file creation, write & read operations, @@ -67,7 +56,7 @@ int(0) int(37) int(37) -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(true) diff --git a/ext/standard/tests/file/007_variation12-win32.phpt b/ext/standard/tests/file/007_variation12-win32.phpt index 08a3ff80d8..1aa2e94286 100644 --- a/ext/standard/tests/file/007_variation12-win32.phpt +++ b/ext/standard/tests/file/007_variation12-win32.phpt @@ -7,17 +7,6 @@ if( substr(PHP_OS, 0, 3) != "WIN" ) ?> --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "w+t" mode, checking for the file creation, write & read operations, diff --git a/ext/standard/tests/file/007_variation12.phpt b/ext/standard/tests/file/007_variation12.phpt index f75ef8df96..e3d1526998 100644 --- a/ext/standard/tests/file/007_variation12.phpt +++ b/ext/standard/tests/file/007_variation12.phpt @@ -7,17 +7,6 @@ if( substr(PHP_OS, 0, 3) == "WIN" ) ?> --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "w+t" mode, checking for the file creation, write & read operations, diff --git a/ext/standard/tests/file/007_variation13-win32.phpt b/ext/standard/tests/file/007_variation13-win32.phpt index d588cc4235..b5d57995ec 100644 --- a/ext/standard/tests/file/007_variation13-win32.phpt +++ b/ext/standard/tests/file/007_variation13-win32.phpt @@ -7,17 +7,6 @@ if( substr(PHP_OS, 0, 3) != "WIN" ) ?> --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "at" mode, checking for the file creation, write & read operations, @@ -57,7 +46,7 @@ resource(%d) of type (stream) string(6) "stream" int(37) -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(true) diff --git a/ext/standard/tests/file/007_variation13.phpt b/ext/standard/tests/file/007_variation13.phpt index 742d06a487..3daeba3a12 100644 --- a/ext/standard/tests/file/007_variation13.phpt +++ b/ext/standard/tests/file/007_variation13.phpt @@ -7,17 +7,6 @@ if( substr(PHP_OS, 0, 3) == "WIN" ) ?> --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "at" mode, checking for the file creation, write & read operations, @@ -57,7 +46,7 @@ resource(%d) of type (stream) string(6) "stream" int(37) -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(true) diff --git a/ext/standard/tests/file/007_variation14.phpt b/ext/standard/tests/file/007_variation14.phpt index 405a6a2dfe..b94df4b413 100644 --- a/ext/standard/tests/file/007_variation14.phpt +++ b/ext/standard/tests/file/007_variation14.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "a+t" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "a+t" mode, checking for the file creation, write & read operations, diff --git a/ext/standard/tests/file/007_variation15.phpt b/ext/standard/tests/file/007_variation15.phpt index 128ed2fc46..a1fa61a431 100644 --- a/ext/standard/tests/file/007_variation15.phpt +++ b/ext/standard/tests/file/007_variation15.phpt @@ -4,13 +4,11 @@ Test fopen and fclose() functions - usage variations - "xt" mode <?php /* fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); + Description: Opens file or URL. */ /* fclose() function: - Prototype: bool fclose ( resource $handle ); Description: Closes an open file pointer */ @@ -50,11 +48,11 @@ int(0) int(37) int(37) -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(true) string(7) "Unknown" -Warning: fopen(%s): failed to open stream: File exists in %s on line %d +Warning: fopen(%s): Failed to open stream: File exists in %s on line %d *** Done *** diff --git a/ext/standard/tests/file/007_variation16.phpt b/ext/standard/tests/file/007_variation16.phpt index 9173138db4..a249addfd0 100644 --- a/ext/standard/tests/file/007_variation16.phpt +++ b/ext/standard/tests/file/007_variation16.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "x+t" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "x+t" mode, checking for the file creation, write & read operations, @@ -56,5 +45,5 @@ int(37) bool(true) string(7) "Unknown" -Warning: fopen(%s): failed to open stream: File exists in %s on line %d +Warning: fopen(%s): Failed to open stream: File exists in %s on line %d *** Done *** diff --git a/ext/standard/tests/file/007_variation17.phpt b/ext/standard/tests/file/007_variation17.phpt index b817526365..263a90e68c 100644 --- a/ext/standard/tests/file/007_variation17.phpt +++ b/ext/standard/tests/file/007_variation17.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "rb" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "rb" mode, checking for the file creation, write & read operations, @@ -49,7 +38,7 @@ string(20) "line line of text li" -Notice: fwrite(): write of 37 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 37 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) bool(true) string(7) "Unknown" diff --git a/ext/standard/tests/file/007_variation18.phpt b/ext/standard/tests/file/007_variation18.phpt index 0e510a421e..ee81dc152f 100644 --- a/ext/standard/tests/file/007_variation18.phpt +++ b/ext/standard/tests/file/007_variation18.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "r+b" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "r+b" mode, checking for the file creation, write & read operations, diff --git a/ext/standard/tests/file/007_variation19.phpt b/ext/standard/tests/file/007_variation19.phpt index 316616fa14..fa57cdd3b3 100644 --- a/ext/standard/tests/file/007_variation19.phpt +++ b/ext/standard/tests/file/007_variation19.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "wb" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "wb" mode, checking for the file creation, write & read operations, @@ -62,7 +51,7 @@ int(0) int(37) int(37) -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(true) diff --git a/ext/standard/tests/file/007_variation2.phpt b/ext/standard/tests/file/007_variation2.phpt index 87ee8a3dd6..69e2a0fd46 100644 --- a/ext/standard/tests/file/007_variation2.phpt +++ b/ext/standard/tests/file/007_variation2.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "r+" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "r+" mode, checking for the file creation, write & read operations, diff --git a/ext/standard/tests/file/007_variation20.phpt b/ext/standard/tests/file/007_variation20.phpt index d470063228..080c153523 100644 --- a/ext/standard/tests/file/007_variation20.phpt +++ b/ext/standard/tests/file/007_variation20.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "w+b" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "w+b" mode, checking for the file creation, write & read operations, diff --git a/ext/standard/tests/file/007_variation21.phpt b/ext/standard/tests/file/007_variation21.phpt index 37b1797491..e8165a1115 100644 --- a/ext/standard/tests/file/007_variation21.phpt +++ b/ext/standard/tests/file/007_variation21.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "ab" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "ab" mode, checking for the file creation, write & read operations, @@ -52,7 +41,7 @@ resource(%d) of type (stream) string(6) "stream" int(37) -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(true) diff --git a/ext/standard/tests/file/007_variation22.phpt b/ext/standard/tests/file/007_variation22.phpt index 8e14a84b5b..3c956fe372 100644 --- a/ext/standard/tests/file/007_variation22.phpt +++ b/ext/standard/tests/file/007_variation22.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "a+b" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "a+b" mode, checking for the file creation, write & read operations, diff --git a/ext/standard/tests/file/007_variation23.phpt b/ext/standard/tests/file/007_variation23.phpt index eafa408eac..2d1d198d67 100644 --- a/ext/standard/tests/file/007_variation23.phpt +++ b/ext/standard/tests/file/007_variation23.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "xb" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "xb" mode, checking for the file creation, write & read operations, @@ -50,11 +39,11 @@ int(0) int(37) int(37) -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(true) string(7) "Unknown" -Warning: fopen(%s): failed to open stream: File exists in %s on line %d +Warning: fopen(%s): Failed to open stream: File exists in %s on line %d *** Done *** diff --git a/ext/standard/tests/file/007_variation24.phpt b/ext/standard/tests/file/007_variation24.phpt index 86b7347a1c..b090f93d49 100644 --- a/ext/standard/tests/file/007_variation24.phpt +++ b/ext/standard/tests/file/007_variation24.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "x+b" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "x+b" mode, checking for the file creation, write & read operations, @@ -56,5 +45,5 @@ int(37) bool(true) string(7) "Unknown" -Warning: fopen(%s): failed to open stream: File exists in %s on line %d +Warning: fopen(%s): Failed to open stream: File exists in %s on line %d *** Done *** diff --git a/ext/standard/tests/file/007_variation3.phpt b/ext/standard/tests/file/007_variation3.phpt index 59fb4587f9..7406e3bef0 100644 --- a/ext/standard/tests/file/007_variation3.phpt +++ b/ext/standard/tests/file/007_variation3.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "w" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "w" mode, checking for the file creation, write & read operations, @@ -62,7 +51,7 @@ int(0) int(37) int(37) -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(true) diff --git a/ext/standard/tests/file/007_variation4.phpt b/ext/standard/tests/file/007_variation4.phpt index 217dbc5ce5..7e522fd6d0 100644 --- a/ext/standard/tests/file/007_variation4.phpt +++ b/ext/standard/tests/file/007_variation4.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "w+" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "w+" mode, checking for the file creation, write & read operations, diff --git a/ext/standard/tests/file/007_variation5.phpt b/ext/standard/tests/file/007_variation5.phpt index 5e4fc5c9db..e872ae3f34 100644 --- a/ext/standard/tests/file/007_variation5.phpt +++ b/ext/standard/tests/file/007_variation5.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "a" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "a" mode, checking for the file creation, write & read operations, @@ -52,7 +41,7 @@ resource(%d) of type (stream) string(6) "stream" int(37) -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(true) diff --git a/ext/standard/tests/file/007_variation6.phpt b/ext/standard/tests/file/007_variation6.phpt index a2ac5d8050..1482ad0337 100644 --- a/ext/standard/tests/file/007_variation6.phpt +++ b/ext/standard/tests/file/007_variation6.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "a+" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "a+" mode, checking for the file creation, write & read operations, diff --git a/ext/standard/tests/file/007_variation7.phpt b/ext/standard/tests/file/007_variation7.phpt index 40e22c4655..c15966cae2 100644 --- a/ext/standard/tests/file/007_variation7.phpt +++ b/ext/standard/tests/file/007_variation7.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "x" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "x" mode, checking for the file creation, write & read operations, @@ -50,11 +39,11 @@ int(0) int(37) int(37) -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(true) string(7) "Unknown" -Warning: fopen(%s): failed to open stream: File exists in %s on line %d +Warning: fopen(%s): Failed to open stream: File exists in %s on line %d *** Done *** diff --git a/ext/standard/tests/file/007_variation8.phpt b/ext/standard/tests/file/007_variation8.phpt index b19fbaf9ec..95d2855459 100644 --- a/ext/standard/tests/file/007_variation8.phpt +++ b/ext/standard/tests/file/007_variation8.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "x+" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "x+" mode, checking for the file creation, write & read operations, @@ -56,5 +45,5 @@ int(37) bool(true) string(7) "Unknown" -Warning: fopen(%s): failed to open stream: File exists in %s on line %d +Warning: fopen(%s): Failed to open stream: File exists in %s on line %d *** Done *** diff --git a/ext/standard/tests/file/007_variation9.phpt b/ext/standard/tests/file/007_variation9.phpt index c20d3b4cf1..54bd82bab6 100644 --- a/ext/standard/tests/file/007_variation9.phpt +++ b/ext/standard/tests/file/007_variation9.phpt @@ -2,17 +2,6 @@ Test fopen and fclose() functions - usage variations - "rt" mode --FILE-- <?php -/* - fopen() function: - Prototype: resource fopen(string $filename, string $mode - [, bool $use_include_path [, resource $context]] ); - Description: Opens file or URL. -*/ -/* - fclose() function: - Prototype: bool fclose ( resource $handle ); - Description: Closes an open file pointer -*/ /* Test fopen() and fclose(): Opening the file in "rt" mode, checking for the file creation, write & read operations, @@ -49,7 +38,7 @@ string(20) "line line of text li" -Notice: fwrite(): write of 37 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 37 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) bool(true) string(7) "Unknown" diff --git a/ext/standard/tests/file/auto_detect_line_endings_1.phpt b/ext/standard/tests/file/auto_detect_line_endings_1.phpt index c79082ecdb..5a4ff0a10f 100644 --- a/ext/standard/tests/file/auto_detect_line_endings_1.phpt +++ b/ext/standard/tests/file/auto_detect_line_endings_1.phpt @@ -15,7 +15,7 @@ var_dump(fgets(STDIN)); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- string(1) "1" string(8) "fooBar1
" string(8) "fooBar2
" diff --git a/ext/standard/tests/file/auto_detect_line_endings_2.phpt b/ext/standard/tests/file/auto_detect_line_endings_2.phpt index f33a055e08..3994f1ee3b 100644 --- a/ext/standard/tests/file/auto_detect_line_endings_2.phpt +++ b/ext/standard/tests/file/auto_detect_line_endings_2.phpt @@ -16,7 +16,7 @@ var_dump(fgets($stdin)); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- string(2) "on" string(8) "fooBar1
" string(8) "fooBar2
" diff --git a/ext/standard/tests/file/basename-win32.phpt b/ext/standard/tests/file/basename-win32.phpt index 996b060cea..4d6cf7e089 100644 --- a/ext/standard/tests/file/basename-win32.phpt +++ b/ext/standard/tests/file/basename-win32.phpt @@ -11,7 +11,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { --FILE-- <?php /* - * proto string basename(string path [, string suffix]) * Function is implemented in ext/standard/string.c */ $file_paths = array ( @@ -115,26 +114,9 @@ check_basename( $file_paths ); echo "\n*** Testing possible variations in path and suffix ***\n"; check_basename( $file_path_variations ); -echo "\n*** Testing error conditions ***\n"; -// zero arguments -var_dump( basename() ); - -// more than expected no. of arguments -var_dump( basename("\\blah\\tmp\\bar.zip", ".zip", ".zip") ); - -// passing invalid type arguments -$object = new stdclass; -var_dump( basename( array("string\\bar") ) ); -var_dump( basename( array("string\\bar"), "bar" ) ); -var_dump( basename( "bar", array("string\\bar") ) ); -var_dump( basename( $object, "bar" ) ); -var_dump( basename( $object ) ); -var_dump( basename( $object, $object ) ); -var_dump( basename( "bar", $object ) ); - echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing basic operations *** --Iteration 1-- @@ -309,33 +291,4 @@ string(0) "" --Iteration 32-- string(0) "" - -*** Testing error conditions *** - -Warning: basename() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: basename() expects at most 2 parameters, 3 given in %s on line %d -NULL - -Warning: basename() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: basename() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: basename() expects parameter 2 to be string, array given in %s on line %d -NULL - -Warning: basename() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: basename() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: basename() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: basename() expects parameter 2 to be string, object given in %s on line %d -NULL Done diff --git a/ext/standard/tests/file/basename.phpt b/ext/standard/tests/file/basename.phpt Binary files differindex a9b4389b5a..2b8507fa2d 100644 --- a/ext/standard/tests/file/basename.phpt +++ b/ext/standard/tests/file/basename.phpt diff --git a/ext/standard/tests/file/basename_basic-win32.phpt b/ext/standard/tests/file/basename_basic-win32.phpt index ceccf9eef7..79de350eae 100644 --- a/ext/standard/tests/file/basename_basic-win32.phpt +++ b/ext/standard/tests/file/basename_basic-win32.phpt @@ -60,7 +60,7 @@ $file_paths = array ( ); foreach ($file_paths as $file_path) { - var_dump(basename($file_path)); + var_dump(basename($file_path)); } ?> diff --git a/ext/standard/tests/file/basename_basic.phpt b/ext/standard/tests/file/basename_basic.phpt index 6354b2acd7..55bd868c55 100644 --- a/ext/standard/tests/file/basename_basic.phpt +++ b/ext/standard/tests/file/basename_basic.phpt @@ -60,7 +60,7 @@ $file_paths = array ( ); foreach ($file_paths as $file_path) { - var_dump(basename($file_path)); + var_dump(basename($file_path)); } ?> diff --git a/ext/standard/tests/file/basename_bug66395-win32.phpt b/ext/standard/tests/file/basename_bug66395-win32.phpt index b4ad18dd28..c276107881 100644 --- a/ext/standard/tests/file/basename_bug66395-win32.phpt +++ b/ext/standard/tests/file/basename_bug66395-win32.phpt @@ -9,10 +9,8 @@ echo basename("d:subdir\\file.txt") . "\n"; echo basename("y:file.txt", ".txt") . "\n"; echo basename("notdriveletter:file.txt") . "\n"; ?> -==DONE== --EXPECT-- file.txt file.txt file notdriveletter:file.txt -==DONE== diff --git a/ext/standard/tests/file/basename_bug66395_variation2-win32.phpt b/ext/standard/tests/file/basename_bug66395_variation2-win32.phpt index 4dc05dbeb1..7311b7797c 100644 --- a/ext/standard/tests/file/basename_bug66395_variation2-win32.phpt +++ b/ext/standard/tests/file/basename_bug66395_variation2-win32.phpt @@ -19,7 +19,6 @@ echo basename("x:y:z:hello\world:my.stream:\$DATA") . "\n"; echo basename("a:\\b:\\c:d:hello\\world:c:\$DATA") . "\n"; echo basename("a:\\b:\\c:d:hello\\d:world:c:\$DATA") . "\n"; ?> -==DONE== --EXPECT-- y y @@ -35,4 +34,3 @@ world:some.stream:$DATA world:my.stream:$DATA world:c:$DATA world:c:$DATA -==DONE== diff --git a/ext/standard/tests/file/basename_variation1-win32.phpt b/ext/standard/tests/file/basename_variation1-win32.phpt index eb2a4ff497..b68765ca68 100644 --- a/ext/standard/tests/file/basename_variation1-win32.phpt +++ b/ext/standard/tests/file/basename_variation1-win32.phpt @@ -12,25 +12,25 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { $prefixes = array ( // drive letters - "A:/", + "A:/", "Z:/", "A:\\", // other prefixes "http://", "blah://", - "blah:\\", + "blah:\\", "hostname:", - // home directory ~ - "~/", - "~\\", + // home directory ~ + "~/", + "~\\", ); $paths = array ( - "foo", - "foo/", + "foo", + "foo/", "foo\\", "foo.bar", "foo.bar/", @@ -43,11 +43,11 @@ $paths = array ( ); foreach ($prefixes as $prefix) { - foreach ($paths as $path) { - $input = $prefix . $path; - echo "basename for path $input is:\n"; - var_dump(basename($input)); - } + foreach ($paths as $path) { + $input = $prefix . $path; + echo "basename for path $input is:\n"; + var_dump(basename($input)); + } } echo "\ndone\n"; diff --git a/ext/standard/tests/file/basename_variation1.phpt b/ext/standard/tests/file/basename_variation1.phpt index ea7cdfe8b7..2b2ac3110e 100644 --- a/ext/standard/tests/file/basename_variation1.phpt +++ b/ext/standard/tests/file/basename_variation1.phpt @@ -12,25 +12,25 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { $prefixes = array ( // drive letters - "A:/", + "A:/", "Z:/", "A:\\", // other prefixes "http://", "blah://", - "blah:\\", + "blah:\\", "hostname:", - // home directory ~ - "~/", - "~\\", + // home directory ~ + "~/", + "~\\", ); $paths = array ( - "foo", - "foo/", + "foo", + "foo/", "foo\\", "foo.bar", "foo.bar/", @@ -43,11 +43,11 @@ $paths = array ( ); foreach ($prefixes as $prefix) { - foreach ($paths as $path) { - $input = $prefix . $path; - echo "basename for path $input is:\n"; - var_dump(basename($input)); - } + foreach ($paths as $path) { + $input = $prefix . $path; + echo "basename for path $input is:\n"; + var_dump(basename($input)); + } } echo "\ndone\n"; diff --git a/ext/standard/tests/file/basename_variation2-win32.phpt b/ext/standard/tests/file/basename_variation2-win32.phpt index 43d6de5060..870fc617dd 100644 --- a/ext/standard/tests/file/basename_variation2-win32.phpt +++ b/ext/standard/tests/file/basename_variation2-win32.phpt @@ -11,8 +11,8 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { $paths = array ( - "foo", - "foo/", + "foo", + "foo/", "foo\\", "foo.bar", "foo.bar/", @@ -26,8 +26,8 @@ $paths = array ( $suffixes = array ( - ".bar", - ".b", + ".bar", + ".b", ".", " ", "foo", @@ -39,10 +39,10 @@ $suffixes = array ( ); foreach ($paths as $path) { - foreach ($suffixes as $suffix) { - echo "basename for path $path, supplying suffix $suffix is:\n"; - var_dump(basename($path, $suffix)); - } + foreach ($suffixes as $suffix) { + echo "basename for path $path, supplying suffix $suffix is:\n"; + var_dump(basename($path, $suffix)); + } } echo "\ndone\n"; diff --git a/ext/standard/tests/file/basename_variation2.phpt b/ext/standard/tests/file/basename_variation2.phpt index 195b98a6d3..a428d84e06 100644 --- a/ext/standard/tests/file/basename_variation2.phpt +++ b/ext/standard/tests/file/basename_variation2.phpt @@ -11,8 +11,8 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { $paths = array ( - "foo", - "foo/", + "foo", + "foo/", "foo\\", "foo.bar", "foo.bar/", @@ -26,8 +26,8 @@ $paths = array ( $suffixes = array ( - ".bar", - ".b", + ".bar", + ".b", ".", " ", "foo", @@ -39,10 +39,10 @@ $suffixes = array ( ); foreach ($paths as $path) { - foreach ($suffixes as $suffix) { - echo "basename for path $path, supplying suffix $suffix is:\n"; - var_dump(basename($path, $suffix)); - } + foreach ($suffixes as $suffix) { + echo "basename for path $path, supplying suffix $suffix is:\n"; + var_dump(basename($path, $suffix)); + } } echo "\ndone\n"; diff --git a/ext/standard/tests/file/bug12556.phpt b/ext/standard/tests/file/bug12556.phpt index 30299899a1..83b39ad782 100644 --- a/ext/standard/tests/file/bug12556.phpt +++ b/ext/standard/tests/file/bug12556.phpt @@ -4,8 +4,8 @@ Bug #12556 (fgetcsv() ignores lengths when quotes not closed) <?php $fp = fopen(__DIR__."/test.csv", "r"); while($line = fgetcsv($fp, 24)) { - $line = str_replace("\x0d\x0a", "\x0a", $line); - var_dump($line); + $line = str_replace("\x0d\x0a", "\x0a", $line); + var_dump($line); } fclose($fp); ?> diff --git a/ext/standard/tests/file/bug22382.phpt b/ext/standard/tests/file/bug22382.phpt index 7768a13b3e..c8dd01efd0 100644 --- a/ext/standard/tests/file/bug22382.phpt +++ b/ext/standard/tests/file/bug22382.phpt @@ -4,7 +4,7 @@ Bug #22382 (fgetcsv() does not handle escaped quotes correctly) <?php $fp = fopen(__DIR__."/test2.csv", "r"); while(($line = fgetcsv($fp, 1024))) { - var_dump($line); + var_dump($line); } fclose($fp); ?> diff --git a/ext/standard/tests/file/bug22414.phpt b/ext/standard/tests/file/bug22414.phpt index c6e993ac9f..5507856815 100644 --- a/ext/standard/tests/file/bug22414.phpt +++ b/ext/standard/tests/file/bug22414.phpt @@ -5,33 +5,33 @@ output_handler= --FILE-- <?php - $php = getenv('TEST_PHP_EXECUTABLE'); - $tmpfile = tempnam(__DIR__, 'phpt'); - $args = ' -n '; + $php = getenv('TEST_PHP_EXECUTABLE'); + $tmpfile = tempnam(__DIR__, 'phpt'); + $args = ' -n '; - /* Regular Data Test */ - passthru($php . $args . ' -r " echo \"HELLO\"; "'); + /* Regular Data Test */ + passthru($php . $args . ' -r " echo \"HELLO\"; "'); - echo "\n"; + echo "\n"; - /* Binary Data Test */ + /* Binary Data Test */ - if (substr(PHP_OS, 0, 3) != 'WIN') { - $cmd = $php . $args . ' -r \"readfile(@getenv(\'\\\'\'TEST_PHP_EXECUTABLE\'\\\'\')); \"'; - $cmd = $php . $args . ' -r \' passthru("'.$cmd.'"); \' > '.$tmpfile ; - } else { - $cmd = $php . $args . ' -r \"readfile(@getenv(\\\\\\"TEST_PHP_EXECUTABLE\\\\\\")); \"'; - $cmd = $php . $args . ' -r " passthru(\''.$cmd.'\');" > '.$tmpfile ; - } - exec($cmd); + if (substr(PHP_OS, 0, 3) != 'WIN') { + $cmd = $php . $args . ' -r \"readfile(@getenv(\'\\\'\'TEST_PHP_EXECUTABLE\'\\\'\')); \"'; + $cmd = $php . $args . ' -r \' passthru("'.$cmd.'"); \' > '.$tmpfile ; + } else { + $cmd = $php . $args . ' -r \"readfile(@getenv(\\\\\\"TEST_PHP_EXECUTABLE\\\\\\")); \"'; + $cmd = $php . $args . ' -r " passthru(\''.$cmd.'\');" > '.$tmpfile ; + } + exec($cmd); - if (md5_file($php) == md5_file($tmpfile)) { - echo "Works\n"; - } else { - echo "Does not work\n"; - } + if (md5_file($php) == md5_file($tmpfile)) { + echo "Works\n"; + } else { + echo "Does not work\n"; + } - @unlink($tmpfile); + @unlink($tmpfile); ?> --EXPECT-- HELLO diff --git a/ext/standard/tests/file/bug24313.phpt b/ext/standard/tests/file/bug24313.phpt index e5bceee856..0893889a02 100644 --- a/ext/standard/tests/file/bug24313.phpt +++ b/ext/standard/tests/file/bug24313.phpt @@ -10,7 +10,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { open_basedir=/dev --FILE-- <?php - var_dump(file_exists("/dev/bogus_file_no_such_thing")); + var_dump(file_exists("/dev/bogus_file_no_such_thing")); ?> --EXPECT-- bool(false) diff --git a/ext/standard/tests/file/bug24482.phpt b/ext/standard/tests/file/bug24482.phpt index 9fe4d2d9ee..ba3dd73318 100644 --- a/ext/standard/tests/file/bug24482.phpt +++ b/ext/standard/tests/file/bug24482.phpt @@ -18,24 +18,24 @@ $globdirs = glob("*", GLOB_ONLYDIR); $dirs = array(); $dh = opendir("."); while (is_string($file = readdir($dh))) { - if ($file[0] === ".") continue; - if (!is_dir($file)) continue; - $dirs[] = $file; + if ($file[0] === ".") continue; + if (!is_dir($file)) continue; + $dirs[] = $file; } closedir($dh); if (count($dirs) != count($globdirs)) { - echo "Directory count mismatch\n"; + echo "Directory count mismatch\n"; - echo "glob found:\n"; - sort($globdirs); - var_dump($globdirs); + echo "glob found:\n"; + sort($globdirs); + var_dump($globdirs); - echo "opendir/readdir/isdir found:\n"; - sort($dirs); - var_dump($dirs); + echo "opendir/readdir/isdir found:\n"; + sort($dirs); + var_dump($dirs); } else { - echo "OK\n"; + echo "OK\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/file/bug26615.phpt b/ext/standard/tests/file/bug26615.phpt index 3689fdfe16..8a5df91ec1 100644 --- a/ext/standard/tests/file/bug26615.phpt +++ b/ext/standard/tests/file/bug26615.phpt @@ -7,9 +7,9 @@ variables_order=E $out = array(); $status = -1; if (substr(PHP_OS, 0, 3) != 'WIN') { - exec($_ENV['TEST_PHP_EXECUTABLE'].' -n -r \'for($i=1;$i<=5000;$i++) print "$i\n";\' | tr \'\n\' \' \'', $out, $status); + exec($_ENV['TEST_PHP_EXECUTABLE'].' -n -r \'for($i=1;$i<=5000;$i++) print "$i\n";\' | tr \'\n\' \' \'', $out, $status); } else { - exec($_ENV['TEST_PHP_EXECUTABLE'].' -n -r "for($i=1;$i<=5000;$i++) echo $i,\' \';"', $out, $status); + exec($_ENV['TEST_PHP_EXECUTABLE'].' -n -r "for($i=1;$i<=5000;$i++) echo $i,\' \';"', $out, $status); } print_r($out); ?> diff --git a/ext/standard/tests/file/bug26938.phpt b/ext/standard/tests/file/bug26938.phpt index d1ad6b6526..13732c03f6 100644 --- a/ext/standard/tests/file/bug26938.phpt +++ b/ext/standard/tests/file/bug26938.phpt @@ -6,19 +6,19 @@ $out = array(); $status = -1; $php = getenv('TEST_PHP_EXECUTABLE'); if (substr(PHP_OS, 0, 3) != 'WIN') { - exec($php . ' -n -r \'' - . '$lengths = array(10,20000,10000,5,10000,3);' - . 'foreach($lengths as $length) {' - . ' for($i=0;$i<$length;$i++) print chr(65+$i % 27);' - . ' print "\n";' - . '}\'', $out, $status); + exec($php . ' -n -r \'' + . '$lengths = array(10,20000,10000,5,10000,3);' + . 'foreach($lengths as $length) {' + . ' for($i=0;$i<$length;$i++) print chr(65+$i % 27);' + . ' print "\n";' + . '}\'', $out, $status); } else { - exec($php . ' -n -r "' - . '$lengths = array(10,20000,10000,5,10000,3);' - . 'foreach($lengths as $length) {' - . ' for($i=0;$i<$length;$i++) print chr(65+$i % 27);' - . ' print \\"\\n\\";' - . '}"', $out, $status); + exec($php . ' -n -r "' + . '$lengths = array(10,20000,10000,5,10000,3);' + . 'foreach($lengths as $length) {' + . ' for($i=0;$i<$length;$i++) print chr(65+$i % 27);' + . ' print \\"\\n\\";' + . '}"', $out, $status); } for ($i=0;$i<6;$i++) print "md5(line $i)= " . md5($out[$i]) . " (length " . diff --git a/ext/standard/tests/file/bug27619.phpt b/ext/standard/tests/file/bug27619.phpt index 095a18c199..6f377b52a9 100644 --- a/ext/standard/tests/file/bug27619.phpt +++ b/ext/standard/tests/file/bug27619.phpt @@ -2,17 +2,17 @@ Bug #27619 (filters not applied to pre-buffered data) --FILE-- <?php - $fp = tmpfile(); - fwrite($fp, "this is a lowercase string.\n"); - rewind($fp); + $fp = tmpfile(); + fwrite($fp, "this is a lowercase string.\n"); + rewind($fp); - /* Echo out the first four bytes 'this' without applying filter - Remainder will get sucked into the read buffer though. */ - echo fread($fp, 4); + /* Echo out the first four bytes 'this' without applying filter + Remainder will get sucked into the read buffer though. */ + echo fread($fp, 4); - stream_filter_append($fp, "string.toupper"); + stream_filter_append($fp, "string.toupper"); - fpassthru($fp); + fpassthru($fp); ?> --EXPECT-- this IS A LOWERCASE STRING. diff --git a/ext/standard/tests/file/bug35740.phpt b/ext/standard/tests/file/bug35740.phpt index 29e8d8ebf8..29ab0248d8 100644 --- a/ext/standard/tests/file/bug35740.phpt +++ b/ext/standard/tests/file/bug35740.phpt @@ -8,7 +8,7 @@ include (__DIR__); echo "Done\n"; ?> --EXPECTF-- -Warning: include(%s): failed to open stream: %s in %s on line %d +Warning: include(%s): Failed to open stream: %s in %s on line %d Warning: include(): Failed opening '%s' for inclusion (include_path='%s') in %s on line %d Done diff --git a/ext/standard/tests/file/bug35781.phpt b/ext/standard/tests/file/bug35781.phpt index 30b49beb78..c07900e9d7 100644 --- a/ext/standard/tests/file/bug35781.phpt +++ b/ext/standard/tests/file/bug35781.phpt @@ -19,7 +19,7 @@ var_dump(file_get_contents($filename)); echo "Done\n"; ?> --EXPECTF-- -Notice: fpassthru(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fpassthru(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d string(15) "Guvf vf n grfg " Done diff --git a/ext/standard/tests/file/bug36365.phpt b/ext/standard/tests/file/bug36365.phpt new file mode 100644 index 0000000000..be1a6c5165 --- /dev/null +++ b/ext/standard/tests/file/bug36365.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #36365 (scandir duplicates file name at every 65535th file) +--SKIPIF-- +<?php +if (getenv("SKIP_SLOW_TESTS")) die('skip slow test'); +?> +--FILE-- +<?php +$testdir = __DIR__ . '/bug36365'; + +mkdir($testdir); +for ($i = 0; $i < 70000; $i++) { + touch(sprintf("$testdir/%05d.txt", $i)); +} + +var_dump(count(scandir($testdir))); +?> +--CLEAN-- +<?php +$testdir = __DIR__ . '/bug36365'; +for ($i = 0; $i < 70000; $i++) { + unlink(sprintf("$testdir/%05d.txt", $i)); +} +rmdir($testdir); +?> +--EXPECT-- +int(70002) diff --git a/ext/standard/tests/file/bug37158.phpt b/ext/standard/tests/file/bug37158.phpt index 3200a62cf9..9afeaeeb8c 100644 --- a/ext/standard/tests/file/bug37158.phpt +++ b/ext/standard/tests/file/bug37158.phpt @@ -17,7 +17,7 @@ $file = __DIR__ . '/footest.txt'; $x = str_repeat(1, 8192); $fp = fopen($file, 'w'); for ($i = 0; $i < 5; $i++) { - fwrite($fp, $x); + fwrite($fp, $x); } fclose($fp); diff --git a/ext/standard/tests/file/bug37864.phpt b/ext/standard/tests/file/bug37864.phpt index f8743bd5ec..1da8f16183 100644 --- a/ext/standard/tests/file/bug37864.phpt +++ b/ext/standard/tests/file/bug37864.phpt @@ -2,10 +2,10 @@ Bug #37864 (file_get_contents() leaks on empty file) --FILE-- <?php - $tmpfname = tempnam(sys_get_temp_dir(), "emptyfile"); - var_dump(file_get_contents($tmpfname)); - echo "done.\n"; - unlink($tmpfname); + $tmpfname = tempnam(sys_get_temp_dir(), "emptyfile"); + var_dump(file_get_contents($tmpfname)); + echo "done.\n"; + unlink($tmpfname); ?> --EXPECT-- string(0) "" diff --git a/ext/standard/tests/file/bug38450.phpt b/ext/standard/tests/file/bug38450.phpt index eae86cf9a0..a82be7848a 100644 --- a/ext/standard/tests/file/bug38450.phpt +++ b/ext/standard/tests/file/bug38450.phpt @@ -4,85 +4,85 @@ Bug #38450 (constructor is not called for classes used in userspace stream wrapp <?php class VariableStream { - var $position; - var $varname; - - function __construct($var=null) { - var_dump("constructor!"); - } - - function stream_open($path, $mode, $options, &$opened_path) - { - $url = parse_url($path); - $this->varname = $url["host"]; - $this->position = 0; - - return true; - } - - function stream_read($count) - { - $ret = substr($GLOBALS[$this->varname], $this->position, $count); - $this->position += strlen($ret); - return $ret; - } - - function stream_write($data) - { - $left = substr($GLOBALS[$this->varname], 0, $this->position); - $right = substr($GLOBALS[$this->varname], $this->position + strlen($data)); - $GLOBALS[$this->varname] = $left . $data . $right; - $this->position += strlen($data); - return strlen($data); - } - - function stream_tell() - { - return $this->position; - } - - function stream_eof() - { - return $this->position >= strlen($GLOBALS[$this->varname]); - } - function stream_seek($offset, $whence) - { - switch ($whence) { - case SEEK_SET: - if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { - $this->position = $offset; - return true; - } else { - return false; - } - break; - - case SEEK_CUR: - if ($offset >= 0) { - $this->position += $offset; - return true; - } else { - return false; - } - break; - - case SEEK_END: - if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { - $this->position = strlen($GLOBALS[$this->varname]) + $offset; - return true; - } else { - return false; - } - break; - - default: - return false; - } - } + var $position; + var $varname; + + function __construct($var=null) { + var_dump("constructor!"); + } + + function stream_open($path, $mode, $options, &$opened_path) + { + $url = parse_url($path); + $this->varname = $url["host"]; + $this->position = 0; + + return true; + } + + function stream_read($count) + { + $ret = substr($GLOBALS[$this->varname], $this->position, $count); + $this->position += strlen($ret); + return $ret; + } + + function stream_write($data) + { + $left = substr($GLOBALS[$this->varname], 0, $this->position); + $right = substr($GLOBALS[$this->varname], $this->position + strlen($data)); + $GLOBALS[$this->varname] = $left . $data . $right; + $this->position += strlen($data); + return strlen($data); + } + + function stream_tell() + { + return $this->position; + } + + function stream_eof() + { + return $this->position >= strlen($GLOBALS[$this->varname]); + } + function stream_seek($offset, $whence) + { + switch ($whence) { + case SEEK_SET: + if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { + $this->position = $offset; + return true; + } else { + return false; + } + break; + + case SEEK_CUR: + if ($offset >= 0) { + $this->position += $offset; + return true; + } else { + return false; + } + break; + + case SEEK_END: + if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { + $this->position = strlen($GLOBALS[$this->varname]) + $offset; + return true; + } else { + return false; + } + break; + + default: + return false; + } + } } stream_wrapper_register("var", "VariableStream") - or die("Failed to register protocol"); + or die("Failed to register protocol"); $myvar = ""; @@ -94,7 +94,7 @@ fwrite($fp, "line3\n"); rewind($fp); while (!feof($fp)) { - echo fgets($fp); + echo fgets($fp); } fclose($fp); var_dump($myvar); diff --git a/ext/standard/tests/file/bug38450_1.phpt b/ext/standard/tests/file/bug38450_1.phpt index 9cc383171b..6eea9e2000 100644 --- a/ext/standard/tests/file/bug38450_1.phpt +++ b/ext/standard/tests/file/bug38450_1.phpt @@ -4,85 +4,85 @@ Bug #38450 (constructor is not called for classes used in userspace stream wrapp <?php class VariableStream { - var $position; - var $varname; - - function __construct($var = null) { - var_dump("constructor!"); - } - - function stream_open($path, $mode, $options, &$opened_path) - { - $url = parse_url($path); - $this->varname = $url["host"]; - $this->position = 0; - - return true; - } - - function stream_read($count) - { - $ret = substr($GLOBALS[$this->varname], $this->position, $count); - $this->position += strlen($ret); - return $ret; - } - - function stream_write($data) - { - $left = substr($GLOBALS[$this->varname], 0, $this->position); - $right = substr($GLOBALS[$this->varname], $this->position + strlen($data)); - $GLOBALS[$this->varname] = $left . $data . $right; - $this->position += strlen($data); - return strlen($data); - } - - function stream_tell() - { - return $this->position; - } - - function stream_eof() - { - return $this->position >= strlen($GLOBALS[$this->varname]); - } - function stream_seek($offset, $whence) - { - switch ($whence) { - case SEEK_SET: - if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { - $this->position = $offset; - return true; - } else { - return false; - } - break; - - case SEEK_CUR: - if ($offset >= 0) { - $this->position += $offset; - return true; - } else { - return false; - } - break; - - case SEEK_END: - if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { - $this->position = strlen($GLOBALS[$this->varname]) + $offset; - return true; - } else { - return false; - } - break; - - default: - return false; - } - } + var $position; + var $varname; + + function __construct($var = null) { + var_dump("constructor!"); + } + + function stream_open($path, $mode, $options, &$opened_path) + { + $url = parse_url($path); + $this->varname = $url["host"]; + $this->position = 0; + + return true; + } + + function stream_read($count) + { + $ret = substr($GLOBALS[$this->varname], $this->position, $count); + $this->position += strlen($ret); + return $ret; + } + + function stream_write($data) + { + $left = substr($GLOBALS[$this->varname], 0, $this->position); + $right = substr($GLOBALS[$this->varname], $this->position + strlen($data)); + $GLOBALS[$this->varname] = $left . $data . $right; + $this->position += strlen($data); + return strlen($data); + } + + function stream_tell() + { + return $this->position; + } + + function stream_eof() + { + return $this->position >= strlen($GLOBALS[$this->varname]); + } + function stream_seek($offset, $whence) + { + switch ($whence) { + case SEEK_SET: + if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { + $this->position = $offset; + return true; + } else { + return false; + } + break; + + case SEEK_CUR: + if ($offset >= 0) { + $this->position += $offset; + return true; + } else { + return false; + } + break; + + case SEEK_END: + if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { + $this->position = strlen($GLOBALS[$this->varname]) + $offset; + return true; + } else { + return false; + } + break; + + default: + return false; + } + } } stream_wrapper_register("var", "VariableStream") - or die("Failed to register protocol"); + or die("Failed to register protocol"); $myvar = ""; @@ -94,7 +94,7 @@ fwrite($fp, "line3\n"); rewind($fp); while (!feof($fp)) { - echo fgets($fp); + echo fgets($fp); } fclose($fp); var_dump($myvar); diff --git a/ext/standard/tests/file/bug38450_2.phpt b/ext/standard/tests/file/bug38450_2.phpt index 33a13da0db..cf4cb91928 100644 --- a/ext/standard/tests/file/bug38450_2.phpt +++ b/ext/standard/tests/file/bug38450_2.phpt @@ -4,85 +4,85 @@ Bug #38450 (constructor is not called for classes used in userspace stream wrapp <?php class VariableStream { - var $position; - var $varname; - - function __construct($var = null) { - throw new Exception("constructor"); - } - - function stream_open($path, $mode, $options, &$opened_path) - { - $url = parse_url($path); - $this->varname = $url["host"]; - $this->position = 0; - - return true; - } - - function stream_read($count) - { - $ret = substr($GLOBALS[$this->varname], $this->position, $count); - $this->position += strlen($ret); - return $ret; - } - - function stream_write($data) - { - $left = substr($GLOBALS[$this->varname], 0, $this->position); - $right = substr($GLOBALS[$this->varname], $this->position + strlen($data)); - $GLOBALS[$this->varname] = $left . $data . $right; - $this->position += strlen($data); - return strlen($data); - } - - function stream_tell() - { - return $this->position; - } - - function stream_eof() - { - return $this->position >= strlen($GLOBALS[$this->varname]); - } - function stream_seek($offset, $whence) - { - switch ($whence) { - case SEEK_SET: - if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { - $this->position = $offset; - return true; - } else { - return false; - } - break; - - case SEEK_CUR: - if ($offset >= 0) { - $this->position += $offset; - return true; - } else { - return false; - } - break; - - case SEEK_END: - if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { - $this->position = strlen($GLOBALS[$this->varname]) + $offset; - return true; - } else { - return false; - } - break; - - default: - return false; - } - } + var $position; + var $varname; + + function __construct($var = null) { + throw new Exception("constructor"); + } + + function stream_open($path, $mode, $options, &$opened_path) + { + $url = parse_url($path); + $this->varname = $url["host"]; + $this->position = 0; + + return true; + } + + function stream_read($count) + { + $ret = substr($GLOBALS[$this->varname], $this->position, $count); + $this->position += strlen($ret); + return $ret; + } + + function stream_write($data) + { + $left = substr($GLOBALS[$this->varname], 0, $this->position); + $right = substr($GLOBALS[$this->varname], $this->position + strlen($data)); + $GLOBALS[$this->varname] = $left . $data . $right; + $this->position += strlen($data); + return strlen($data); + } + + function stream_tell() + { + return $this->position; + } + + function stream_eof() + { + return $this->position >= strlen($GLOBALS[$this->varname]); + } + function stream_seek($offset, $whence) + { + switch ($whence) { + case SEEK_SET: + if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { + $this->position = $offset; + return true; + } else { + return false; + } + break; + + case SEEK_CUR: + if ($offset >= 0) { + $this->position += $offset; + return true; + } else { + return false; + } + break; + + case SEEK_END: + if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { + $this->position = strlen($GLOBALS[$this->varname]) + $offset; + return true; + } else { + return false; + } + break; + + default: + return false; + } + } } stream_wrapper_register("var", "VariableStream") - or die("Failed to register protocol"); + or die("Failed to register protocol"); $myvar = ""; @@ -94,7 +94,7 @@ fwrite($fp, "line3\n"); rewind($fp); while (!feof($fp)) { - echo fgets($fp); + echo fgets($fp); } fclose($fp); var_dump($myvar); diff --git a/ext/standard/tests/file/bug38450_3.phpt b/ext/standard/tests/file/bug38450_3.phpt index 8a5c696587..cbd03e908e 100644 --- a/ext/standard/tests/file/bug38450_3.phpt +++ b/ext/standard/tests/file/bug38450_3.phpt @@ -4,85 +4,85 @@ Bug #38450 (constructor is not called for classes used in userspace stream wrapp <?php class VariableStream { - var $position; - var $varname; - - function __construct(array $var) { - var_dump("constructor!"); - } - - function stream_open($path, $mode, $options, &$opened_path) - { - $url = parse_url($path); - $this->varname = $url["host"]; - $this->position = 0; - - return true; - } - - function stream_read($count) - { - $ret = substr($GLOBALS[$this->varname], $this->position, $count); - $this->position += strlen($ret); - return $ret; - } - - function stream_write($data) - { - $left = substr($GLOBALS[$this->varname], 0, $this->position); - $right = substr($GLOBALS[$this->varname], $this->position + strlen($data)); - $GLOBALS[$this->varname] = $left . $data . $right; - $this->position += strlen($data); - return strlen($data); - } - - function stream_tell() - { - return $this->position; - } - - function stream_eof() - { - return $this->position >= strlen($GLOBALS[$this->varname]); - } - function stream_seek($offset, $whence) - { - switch ($whence) { - case SEEK_SET: - if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { - $this->position = $offset; - return true; - } else { - return false; - } - break; - - case SEEK_CUR: - if ($offset >= 0) { - $this->position += $offset; - return true; - } else { - return false; - } - break; - - case SEEK_END: - if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { - $this->position = strlen($GLOBALS[$this->varname]) + $offset; - return true; - } else { - return false; - } - break; - - default: - return false; - } - } + var $position; + var $varname; + + function __construct(array $var) { + var_dump("constructor!"); + } + + function stream_open($path, $mode, $options, &$opened_path) + { + $url = parse_url($path); + $this->varname = $url["host"]; + $this->position = 0; + + return true; + } + + function stream_read($count) + { + $ret = substr($GLOBALS[$this->varname], $this->position, $count); + $this->position += strlen($ret); + return $ret; + } + + function stream_write($data) + { + $left = substr($GLOBALS[$this->varname], 0, $this->position); + $right = substr($GLOBALS[$this->varname], $this->position + strlen($data)); + $GLOBALS[$this->varname] = $left . $data . $right; + $this->position += strlen($data); + return strlen($data); + } + + function stream_tell() + { + return $this->position; + } + + function stream_eof() + { + return $this->position >= strlen($GLOBALS[$this->varname]); + } + function stream_seek($offset, $whence) + { + switch ($whence) { + case SEEK_SET: + if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { + $this->position = $offset; + return true; + } else { + return false; + } + break; + + case SEEK_CUR: + if ($offset >= 0) { + $this->position += $offset; + return true; + } else { + return false; + } + break; + + case SEEK_END: + if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { + $this->position = strlen($GLOBALS[$this->varname]) + $offset; + return true; + } else { + return false; + } + break; + + default: + return false; + } + } } stream_wrapper_register("var", "VariableStream") - or die("Failed to register protocol"); + or die("Failed to register protocol"); $myvar = ""; @@ -94,7 +94,7 @@ fwrite($fp, "line3\n"); rewind($fp); while (!feof($fp)) { - echo fgets($fp); + echo fgets($fp); } fclose($fp); var_dump($myvar); diff --git a/ext/standard/tests/file/bug39538.phpt b/ext/standard/tests/file/bug39538.phpt index cdff507b48..5f40192ec9 100644 --- a/ext/standard/tests/file/bug39538.phpt +++ b/ext/standard/tests/file/bug39538.phpt @@ -7,8 +7,8 @@ $content = array("\"\nthis is an test\", \"next data\", \"p\narsed\"","\"\r\nthi $file = __DIR__ . "/bug39538.csv"; @unlink($file); foreach ($content as $v) { - file_put_contents($file, $v); - print_r (fgetcsv(fopen($file, "r"), filesize($file))); + file_put_contents($file, $v); + print_r (fgetcsv(fopen($file, "r"), filesize($file))); } @unlink($file); ?> diff --git a/ext/standard/tests/file/bug39551.phpt b/ext/standard/tests/file/bug39551.phpt index 2877c4951f..c3d011351e 100644 --- a/ext/standard/tests/file/bug39551.phpt +++ b/ext/standard/tests/file/bug39551.phpt @@ -6,12 +6,12 @@ Bug #39551 (Segfault with stream_bucket_new in user filter) $bucket = stream_bucket_new(fopen('php://temp', 'w+'), ''); class bucketFilter { - public function filter($in, $out, &$consumed, $closing ){ + public function filter($in, $out, &$consumed, $closing ){ - $bucket = stream_bucket_new(fopen('php://temp', 'w+'), ''); - stream_bucket_append($out, $bucket); - return PSFS_PASS_ON; - } + $bucket = stream_bucket_new(fopen('php://temp', 'w+'), ''); + stream_bucket_append($out, $bucket); + return PSFS_PASS_ON; + } } stream_filter_register('bucketfault', 'bucketFilter'); diff --git a/ext/standard/tests/file/bug39673.phpt b/ext/standard/tests/file/bug39673.phpt index 70a47e3fc1..64c66cc141 100644 --- a/ext/standard/tests/file/bug39673.phpt +++ b/ext/standard/tests/file/bug39673.phpt @@ -9,20 +9,20 @@ $filename = __DIR__.'/bug39673.txt'; file_put_contents($filename, $str); $offsets = array( - -1, - 0, - 3456*4, - 3456*4 - 1, - 3456*4 + 1, - 2000, - 5000, - 100000, + -1, + 0, + 3456*4, + 3456*4 - 1, + 3456*4 + 1, + 2000, + 5000, + 100000, ); foreach ($offsets as $offset) { - $r = file_get_contents($filename, false, null, $offset); - if ($r !== false) var_dump(strlen($r)); + $r = file_get_contents($filename, false, null, $offset); + if ($r !== false) var_dump(strlen($r)); } @unlink($filename); diff --git a/ext/standard/tests/file/bug39863.phpt b/ext/standard/tests/file/bug39863.phpt index 5460203e05..982367cccb 100644 --- a/ext/standard/tests/file/bug39863.phpt +++ b/ext/standard/tests/file/bug39863.phpt @@ -7,16 +7,11 @@ Andrew van der Stock, vanderaj @ owasp.org $filename = __FILE__ . chr(0). ".ridiculous"; -if (file_exists($filename)) { - echo "FAIL\n"; -} -else { - echo "PASS\n"; +try { + var_dump(file_exists($filename)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; } ?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -Warning: file_exists() expects parameter 1 to be a valid path, string given in %s on line %d -PASS -===DONE=== +--EXPECT-- +file_exists(): Argument #1 ($filename) must be a valid path, string given diff --git a/ext/standard/tests/file/bug41655_2.phpt b/ext/standard/tests/file/bug41655_2.phpt index 20c29844c1..61fdec1054 100644 --- a/ext/standard/tests/file/bug41655_2.phpt +++ b/ext/standard/tests/file/bug41655_2.phpt @@ -4,9 +4,9 @@ Bug #41655 (open_basedir bypass via glob()) 2/2 open_basedir=/ --FILE-- <?php - $dir = __DIR__; - $a=glob($dir . "/test*csv"); - print_r($a); + $dir = __DIR__; + $a=glob($dir . "/test*csv"); + print_r($a); ?> --EXPECTF-- Array diff --git a/ext/standard/tests/file/bug41693.phpt b/ext/standard/tests/file/bug41693.phpt deleted file mode 100644 index ea074fa4fd..0000000000 --- a/ext/standard/tests/file/bug41693.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #41693 (scandir() allows empty directory names) ---FILE-- -<?php - -var_dump(scandir('')); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: scandir(): Directory name cannot be empty in %s on line %d -bool(false) -Done diff --git a/ext/standard/tests/file/bug41815.phpt b/ext/standard/tests/file/bug41815.phpt index 58f287cedf..d77d73055b 100644 --- a/ext/standard/tests/file/bug41815.phpt +++ b/ext/standard/tests/file/bug41815.phpt @@ -12,7 +12,7 @@ fread($reader, 1); fwrite($writer, "foo"); if (strlen(fread($reader, 10)) > 0) { - echo "OK\n"; + echo "OK\n"; } fclose($writer); diff --git a/ext/standard/tests/file/bug43008.phpt b/ext/standard/tests/file/bug43008.phpt index 0d9d6ed986..60bea35429 100644 --- a/ext/standard/tests/file/bug43008.phpt +++ b/ext/standard/tests/file/bug43008.phpt @@ -9,12 +9,12 @@ allow_url_fopen=1 --FILE-- <?php $url = "" - . "php://filter/read=" - . urlencode("convert.iconv.ISO-8859-15/UTF-8") - . '|' . urlencode("string.rot13") - . '|' . urlencode("string.rot13") - . '|' . urlencode("convert.iconv.UTF-8/ISO-8859-15") - . "/resource=data://text/plain,foob%E2r"; + . "php://filter/read=" + . urlencode("convert.iconv.ISO-8859-15/UTF-8") + . '|' . urlencode("string.rot13") + . '|' . urlencode("string.rot13") + . '|' . urlencode("convert.iconv.UTF-8/ISO-8859-15") + . "/resource=data://text/plain,foob%E2r"; var_dump(urlencode(file_get_contents($url))); ?> --EXPECTF-- diff --git a/ext/standard/tests/file/bug43137.phpt b/ext/standard/tests/file/bug43137.phpt index 8125445bb0..f0f17895b7 100644 --- a/ext/standard/tests/file/bug43137.phpt +++ b/ext/standard/tests/file/bug43137.phpt @@ -2,16 +2,16 @@ Bug #43137 (rmdir() and rename() do not clear statcache) --FILE-- <?php - $toname = "TO_" . md5(microtime()); - $dirname = "FROM_" . md5(microtime()); + $toname = "TO_" . md5(microtime()); + $dirname = "FROM_" . md5(microtime()); - mkdir($dirname); - var_dump(is_dir($dirname)); // Expected: true - rename($dirname, $toname); - var_dump(is_dir($dirname)); // Expected: false - var_dump(is_dir($toname)); // Expected: true - rmdir($toname); - var_dump(is_dir($toname)); // Expected: false + mkdir($dirname); + var_dump(is_dir($dirname)); // Expected: true + rename($dirname, $toname); + var_dump(is_dir($dirname)); // Expected: false + var_dump(is_dir($toname)); // Expected: true + rmdir($toname); + var_dump(is_dir($toname)); // Expected: false ?> --EXPECT-- bool(true) diff --git a/ext/standard/tests/file/bug43353.phpt b/ext/standard/tests/file/bug43353.phpt index d9576f24e2..6089fabadd 100644 --- a/ext/standard/tests/file/bug43353.phpt +++ b/ext/standard/tests/file/bug43353.phpt @@ -16,5 +16,5 @@ bool(false) bool(false) string(3) "foo" -Warning: file_get_contents(datafoo:text/plain,foo): failed to open stream: No such file or directory in %s +Warning: file_get_contents(datafoo:text/plain,foo): Failed to open stream: No such file or directory in %s bool(false) diff --git a/ext/standard/tests/file/bug43522.phpt b/ext/standard/tests/file/bug43522.phpt index 10e44fc352..185f2c3697 100644 --- a/ext/standard/tests/file/bug43522.phpt +++ b/ext/standard/tests/file/bug43522.phpt @@ -9,10 +9,10 @@ DoTest($fp, 'ZZZ'); // test multi-char delimiter DoTest($fp, "Z"); // test single-char delimiter function DoTest($fp, $delim) { - echo "Delimiter: " . $delim . "\n"; - rewind($fp); - echo "\t" . stream_get_line($fp, 10, $delim) . "\n"; - echo "\t" . stream_get_line($fp, 10, $delim) . "\n"; + echo "Delimiter: " . $delim . "\n"; + rewind($fp); + echo "\t" . stream_get_line($fp, 10, $delim) . "\n"; + echo "\t" . stream_get_line($fp, 10, $delim) . "\n"; } ?> diff --git a/ext/standard/tests/file/bug44034.phpt b/ext/standard/tests/file/bug44034.phpt index 887b9eb08e..2b7e1168c8 100644 --- a/ext/standard/tests/file/bug44034.phpt +++ b/ext/standard/tests/file/bug44034.phpt @@ -11,8 +11,8 @@ $urls[] = "data://text/plain,\r\nfoo\r\nbar\r\n"; $urls[] = "data://text/plain,foo\r\nbar"; foreach($urls as $url) { - echo strtr($url, array("\r" => "\\r", "\n" => "\\n")) . "\n"; - var_dump(file($url, FILE_IGNORE_NEW_LINES)); + echo strtr($url, array("\r" => "\\r", "\n" => "\\n")) . "\n"; + var_dump(file($url, FILE_IGNORE_NEW_LINES)); } ?> --EXPECT-- diff --git a/ext/standard/tests/file/bug44805.phpt b/ext/standard/tests/file/bug44805.phpt index ac4e334f53..0b81be6a06 100644 --- a/ext/standard/tests/file/bug44805.phpt +++ b/ext/standard/tests/file/bug44805.phpt @@ -14,10 +14,10 @@ rename($file1, $file2); echo "reading file 2: "; readfile($file2); if (file_exists($file1)) { - unlink($file1); + unlink($file1); } if (file_exists($file2)) { - unlink($file2); + unlink($file2); } ?> --EXPECT-- diff --git a/ext/standard/tests/file/bug45303.phpt b/ext/standard/tests/file/bug45303.phpt index 0a4b33bcff..927c459fb5 100644 --- a/ext/standard/tests/file/bug45303.phpt +++ b/ext/standard/tests/file/bug45303.phpt @@ -9,5 +9,5 @@ var_dump(fseek($fd, 1024*1024, SEEK_SET)); --EXPECTF-- resource(%d) of type (stream) -Warning: fseek(): stream does not support seeking in %s +Warning: fseek(): Stream does not support seeking in %s int(-1) diff --git a/ext/standard/tests/file/bug47517.phpt b/ext/standard/tests/file/bug47517.phpt index f8c9e41446..4eaf9a132c 100644 --- a/ext/standard/tests/file/bug47517.phpt +++ b/ext/standard/tests/file/bug47517.phpt @@ -15,7 +15,5 @@ if (!$status) { /* This has to behave same way on both 64- and 32-bits. */ file_put_contents('C:\Program Files\myfile.txt', 'hello'); ?> -==DONE== --EXPECTF-- -Warning: file_put_contents(C:\Program Files\myfile.txt): failed to open stream: Permission denied in %sbug47517.php on line %d -==DONE== +Warning: file_put_contents(C:\Program Files\myfile.txt): Failed to open stream: Permission denied in %sbug47517.php on line %d diff --git a/ext/standard/tests/file/bug52820.phpt b/ext/standard/tests/file/bug52820.phpt index cdf4db3e5a..ea3089ea8c 100644 --- a/ext/standard/tests/file/bug52820.phpt +++ b/ext/standard/tests/file/bug52820.phpt @@ -10,7 +10,7 @@ if (!extension_loaded("curl")) exit("skip curl extension not loaded"); $handle=curl_init('file:///i_dont_exist/'); curl_setopt($handle, CURLOPT_VERBOSE, true); curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); -if (!curl_setopt($handle, CURLOPT_STDERR, fopen("php://memory", "w+"))) +if (!@curl_setopt($handle, CURLOPT_STDERR, fopen("php://memory", "w+"))) die("skip fopencookie not supported on this platform"); --FILE-- <?php diff --git a/ext/standard/tests/file/bug55124.phpt b/ext/standard/tests/file/bug55124.phpt index 7938196dbc..a894ff32e0 100644 --- a/ext/standard/tests/file/bug55124.phpt +++ b/ext/standard/tests/file/bug55124.phpt @@ -6,10 +6,10 @@ $old_dir_path = getcwd(); chdir(__DIR__); mkdir('a/./b', 0755, true); if (is_dir('a/b')) { - rmdir('a/b'); + rmdir('a/b'); } if (is_dir('./a')) { - rmdir('a'); + rmdir('a'); } chdir($old_dir_path); echo "OK"; diff --git a/ext/standard/tests/file/bug60120.phpt b/ext/standard/tests/file/bug60120.phpt index 77ebf086bd..9d964e34cb 100644 --- a/ext/standard/tests/file/bug60120.phpt +++ b/ext/standard/tests/file/bug60120.phpt @@ -14,7 +14,7 @@ error_reporting(E_ALL); $php = getenv('TEST_PHP_EXECUTABLE'); if (!$php) { - die("No php executable defined\n"); + die("No php executable defined\n"); } $cmd = 'php -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"'; $descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w')); diff --git a/ext/standard/tests/file/bug61961.phpt b/ext/standard/tests/file/bug61961.phpt index a2d83fe77e..c9ae4c8880 100644 --- a/ext/standard/tests/file/bug61961.phpt +++ b/ext/standard/tests/file/bug61961.phpt @@ -8,7 +8,5 @@ file_put_contents($tmp_empty_file, ""); var_dump(file_get_contents($tmp_empty_file, NULL, NULL, NULL, 10)); unlink($tmp_empty_file); ?> -==DONE== --EXPECT-- string(0) "" -==DONE== diff --git a/ext/standard/tests/file/bug63512.phpt b/ext/standard/tests/file/bug63512.phpt index 9277359256..a22ba9f0cf 100644 --- a/ext/standard/tests/file/bug63512.phpt +++ b/ext/standard/tests/file/bug63512.phpt @@ -4,13 +4,13 @@ Fixed bug #63512 (parse_ini_file() with INI_SCANNER_RAW removes quotes from valu <?php $array = parse_ini_string(' - int = 123 - constant = INSTALL_ROOT - quotedString = "string" - a = INSTALL_ROOT "waa" - b = "INSTALL_ROOT" - c = "waa" INSTALL_ROOT - d = INSTALL_ROOT "INSTALL_ROOT"', false, INI_SCANNER_RAW); + int = 123 + constant = INSTALL_ROOT + quotedString = "string" + a = INSTALL_ROOT "waa" + b = "INSTALL_ROOT" + c = "waa" INSTALL_ROOT + d = INSTALL_ROOT "INSTALL_ROOT"', false, INI_SCANNER_RAW); var_dump($array); --EXPECT-- diff --git a/ext/standard/tests/file/bug65701.phpt b/ext/standard/tests/file/bug65701.phpt index c4a356b41b..f70446a17e 100644 --- a/ext/standard/tests/file/bug65701.phpt +++ b/ext/standard/tests/file/bug65701.phpt @@ -7,7 +7,7 @@ Boro Sitnikovski <buritomath@yahoo.com> $file_path = __DIR__ . "/bug65701/"; if (!is_dir($file_path)) { - mkdir($file_path); + mkdir($file_path); } $src = $file_path . '/srcbug65701_file.txt'; diff --git a/ext/standard/tests/file/bug68335.phpt b/ext/standard/tests/file/bug68335.phpt index b3a8165e5b..bb5f597fca 100644 --- a/ext/standard/tests/file/bug68335.phpt +++ b/ext/standard/tests/file/bug68335.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #68335: rmdir doesnt work with file:// stream wrapper +Bug #68335: rmdir doesn't work with file:// stream wrapper --FILE-- <?php $dir = 'file://' . __DIR__ . '/testDir'; diff --git a/ext/standard/tests/file/bug69442.phpt b/ext/standard/tests/file/bug69442.phpt index d7063f429d..8b6ae3f7d7 100644 --- a/ext/standard/tests/file/bug69442.phpt +++ b/ext/standard/tests/file/bug69442.phpt @@ -17,7 +17,7 @@ EOC; $output = join("\n", $output); unlink($tmpFile); - if (strstr($output, "pty pseudo terminal not supported on this system") !== false) { + if (strstr($output, "PTY (pseudoterminal) not supported on this system") !== false) { die("skip PTY pseudo terminals are not supported"); } --FILE-- @@ -28,17 +28,31 @@ $pipes = array(); $process = proc_open($cmd, $descriptors, $pipes); -foreach ($pipes as $type => $pipe) { - $data = fread($pipe, 999); - echo 'type ' . $type . ' '; - var_dump($data); - fclose($pipe); +function read_from_pipe($pipe) { + $result = fread($pipe, 1000); + /* We can't guarantee that everything written to the pipe will be returned by a single call + * to fread(), even if it was written with a single syscall and the number of bytes written + * was small */ + $again = @fread($pipe, 1000); + if ($again) { + $result .= $again; + } + return $result; } + +$data0 = read_from_pipe($pipes[0]); +echo 'read from pipe 0: '; +var_dump($data0); +fclose($pipes[0]); + +$data3 = read_from_pipe($pipes[3]); +echo 'read from pipe 3: '; +var_dump($data3); +fclose($pipes[3]); + proc_close($process); --EXPECT-- -type 0 string(5) "foo +read from pipe 0: string(5) "foo " -type 1 string(0) "" -type 2 string(0) "" -type 3 string(3) "42 +read from pipe 3: string(3) "42 " diff --git a/ext/standard/tests/file/bug71287.phpt b/ext/standard/tests/file/bug71287.phpt index b7987829b0..f88414f2c2 100644 --- a/ext/standard/tests/file/bug71287.phpt +++ b/ext/standard/tests/file/bug71287.phpt @@ -3,13 +3,13 @@ Bug #71287 (Error message contains hexadecimal instead of decimal number) --FILE-- <?php class Stream { - public function stream_open($path, $mode, $options, $opened_path) { - return true; - } + public function stream_open($path, $mode, $options, $opened_path) { + return true; + } - public function stream_write($data) { - return strlen($data) - 2; - } + public function stream_write($data) { + return strlen($data) - 2; + } } stream_wrapper_register('test', Stream::class); diff --git a/ext/standard/tests/file/bug71882.phpt b/ext/standard/tests/file/bug71882.phpt index c132aa95c7..68f98f19b6 100644 --- a/ext/standard/tests/file/bug71882.phpt +++ b/ext/standard/tests/file/bug71882.phpt @@ -3,10 +3,11 @@ Bug #71882 (Negative ftruncate() on php://memory exhausts memory) --FILE-- <?php $fd = fopen("php://memory", "w+"); -var_dump(ftruncate($fd, -1)); +try { + var_dump(ftruncate($fd, -1)); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} ?> -==DONE== ---EXPECTF-- -Warning: ftruncate(): Negative size is not supported in %s%ebug71882.php on line %d -bool(false) -==DONE== +--EXPECT-- +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 diff --git a/ext/standard/tests/file/bug72035.phpt b/ext/standard/tests/file/bug72035.phpt index 704d746efc..6ed7fe470f 100644 --- a/ext/standard/tests/file/bug72035.phpt +++ b/ext/standard/tests/file/bug72035.phpt @@ -3,7 +3,6 @@ Bug #72035 php-cgi.exe fails to run scripts relative to drive root --SKIPIF-- <?php if(substr(PHP_OS, 0, 3) != 'WIN' ) die('skip windows only test'); -if(php_sapi_name() != "cli") die('skip CLI only test'); $cgi = realpath(dirname(PHP_BINARY)) . DIRECTORY_SEPARATOR . "php-cgi.exe"; if (!file_exists($cgi)) die('skip CGI binary not found'); @@ -24,17 +23,15 @@ $cmd = "$cgi -n -C $fl"; $desc = array(0 => array("pipe", "r")); $proc = proc_open($cmd, $desc, $pipes, getcwd(), array()); if (is_resource($proc)) { - echo stream_get_contents($pipes[0]); + echo stream_get_contents($pipes[0]); - proc_close($proc); + proc_close($proc); } unlink($fl); ?> -==DONE== --EXPECTF-- X-Powered-By: PHP/%s Content-type: text/html; charset=UTF-8 hello -==DONE== diff --git a/ext/standard/tests/file/bug74719.phpt b/ext/standard/tests/file/bug74719.phpt index 57309bcf06..ab888d682f 100644 --- a/ext/standard/tests/file/bug74719.phpt +++ b/ext/standard/tests/file/bug74719.phpt @@ -33,11 +33,9 @@ if (rmdir($tmpDir, NULL)) { } ?> -===DONE=== --EXPECT-- ok ok ok ok ok -===DONE=== diff --git a/ext/standard/tests/file/bug75679.phpt b/ext/standard/tests/file/bug75679.phpt index 1441447853..df8b994781 100644 --- a/ext/standard/tests/file/bug75679.phpt +++ b/ext/standard/tests/file/bug75679.phpt @@ -24,7 +24,6 @@ foreach ($Files2Report as $file => &$Report) ?> -==DONE== --CLEAN-- <?php $d = __DIR__; @@ -63,4 +62,3 @@ Array [strlen] => 261 [result] => ok ) -==DONE== diff --git a/ext/standard/tests/file/bug77552.phpt b/ext/standard/tests/file/bug77552.phpt index 9404b8e09f..8e3a835537 100644 --- a/ext/standard/tests/file/bug77552.phpt +++ b/ext/standard/tests/file/bug77552.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #77552 Unintialized php_stream_statbuf in stat functions +Bug #77552 Uninitialized php_stream_statbuf in stat functions --SKIPIF-- <?php if (substr(PHP_OS, 0, 3) != 'WIN') { @@ -15,7 +15,7 @@ $target = $tmpDir.'/folder/target'; mkdir($target, 0777, true); $junction = $tmpDir.'/junction'; -$cmd = sprintf('mklink /J "%s" "%s"', $junction, $target); +$cmd = sprintf('mklink /J "%s" "%s"', $junction, $target); exec($cmd); $stat = lstat($junction); diff --git a/ext/standard/tests/file/bug79099.phpt b/ext/standard/tests/file/bug79099.phpt index a1f2a3355f..1896d7d02c 100644 --- a/ext/standard/tests/file/bug79099.phpt +++ b/ext/standard/tests/file/bug79099.phpt @@ -2,31 +2,11 @@ Bug #79099 (OOB read in php_strip_tags_ex) --FILE-- <?php -$stream = fopen('php://memory', 'w+'); -fputs($stream, "<?\n\"\n"); -rewind($stream); -var_dump(@fgetss($stream)); -var_dump(@fgetss($stream)); -fclose($stream); - -$stream = fopen('php://memory', 'w+'); -fputs($stream, "<\0\n!\n"); -rewind($stream); -var_dump(@fgetss($stream)); -var_dump(@fgetss($stream)); -fclose($stream); - -$stream = fopen('php://memory', 'w+'); -fputs($stream, "<\0\n?\n"); -rewind($stream); -var_dump(@fgetss($stream)); -var_dump(@fgetss($stream)); -fclose($stream); +var_dump(strip_tags("<?\n\"\n")); +var_dump(strip_tags("<\0\n!\n")); +var_dump(strip_tags("<\0\n?\n")); ?> --EXPECT-- string(0) "" string(0) "" string(0) "" -string(0) "" -string(0) "" -string(0) "" diff --git a/ext/standard/tests/file/chgrp.phpt b/ext/standard/tests/file/chgrp.phpt index 03ea24141b..37ae20d40e 100644 --- a/ext/standard/tests/file/chgrp.phpt +++ b/ext/standard/tests/file/chgrp.phpt @@ -7,9 +7,11 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -chgrp("sjhgfskhagkfdgskjfhgskfsdgfkdsajf", NULL); -echo "ALIVE\n"; +try { + chgrp("sjhgfskhagkfdgskjfhgskfsdgfkdsajf", null); +} catch (TypeError $exception) { + echo $exception->getMessage() . "\n"; +} ?> ---EXPECTF-- -Warning: chgrp(): parameter 2 should be string or int, null given in %schgrp.php on line 2 -ALIVE +--EXPECT-- +chgrp(): Argument #2 ($group) must be of type string|int, null given diff --git a/ext/standard/tests/file/chmod_basic-win32-mb.phpt b/ext/standard/tests/file/chmod_basic-win32-mb.phpt index 3970504ddb..a3c0b62410 100644 --- a/ext/standard/tests/file/chmod_basic-win32-mb.phpt +++ b/ext/standard/tests/file/chmod_basic-win32-mb.phpt @@ -17,10 +17,10 @@ $fd = fopen($filename, "w+"); fclose($fd); for ($perms_to_set = 0777; $perms_to_set >= 0; $perms_to_set--) { - chmod($filename, $perms_to_set); - $set_perms = (fileperms($filename) & PERMISSIONS_MASK); - clearstatcache(); - printf("Setting mode %o gives mode %o\n", $perms_to_set, $set_perms); + chmod($filename, $perms_to_set); + $set_perms = (fileperms($filename) & PERMISSIONS_MASK); + clearstatcache(); + printf("Setting mode %o gives mode %o\n", $perms_to_set, $set_perms); } var_dump(chmod($filename, 0777)); diff --git a/ext/standard/tests/file/chmod_basic-win32.phpt b/ext/standard/tests/file/chmod_basic-win32.phpt index 31d44c80aa..072f98d644 100644 --- a/ext/standard/tests/file/chmod_basic-win32.phpt +++ b/ext/standard/tests/file/chmod_basic-win32.phpt @@ -17,10 +17,10 @@ $fd = fopen($filename, "w+"); fclose($fd); for ($perms_to_set = 0777; $perms_to_set >= 0; $perms_to_set--) { - chmod($filename, $perms_to_set); - $set_perms = (fileperms($filename) & PERMISSIONS_MASK); - clearstatcache(); - printf("Setting mode %o gives mode %o\n", $perms_to_set, $set_perms); + chmod($filename, $perms_to_set); + $set_perms = (fileperms($filename) & PERMISSIONS_MASK); + clearstatcache(); + printf("Setting mode %o gives mode %o\n", $perms_to_set, $set_perms); } var_dump(chmod($filename, 0777)); diff --git a/ext/standard/tests/file/chmod_basic.phpt b/ext/standard/tests/file/chmod_basic.phpt index fc983074fd..635ea8de79 100644 --- a/ext/standard/tests/file/chmod_basic.phpt +++ b/ext/standard/tests/file/chmod_basic.phpt @@ -17,12 +17,12 @@ $fd = fopen($filename, "w+"); fclose($fd); for ($perms_to_set = 07777; $perms_to_set >= 0; $perms_to_set--) { - chmod($filename, $perms_to_set); - $set_perms = (fileperms($filename) & MODE_MASK); - clearstatcache(); - if ($set_perms != $perms_to_set) { - printf("Error: %o does not match %o\n", $set_perms, $perms_to_set); - } + chmod($filename, $perms_to_set); + $set_perms = (fileperms($filename) & MODE_MASK); + clearstatcache(); + if ($set_perms != $perms_to_set) { + printf("Error: %o does not match %o\n", $set_perms, $perms_to_set); + } } var_dump(chmod($filename, 0777)); diff --git a/ext/standard/tests/file/chmod_error.phpt b/ext/standard/tests/file/chmod_error.phpt index 3b234c741f..7d8601ff3e 100644 --- a/ext/standard/tests/file/chmod_error.phpt +++ b/ext/standard/tests/file/chmod_error.phpt @@ -2,46 +2,15 @@ Test chmod() function : error conditions --FILE-- <?php -/* Prototype : bool chmod(string filename, int mode) - * Description: Change file mode - * Source code: ext/standard/filestat.c - * Alias to functions: - */ - echo "*** Testing chmod() : error conditions ***\n"; - -//Test chmod with one more than the expected number of arguments -echo "\n-- Testing chmod() function with more than expected no. of arguments --\n"; -$filename = 'string_val'; -$mode = 10; -$extra_arg = 10; -var_dump( chmod($filename, $mode, $extra_arg) ); - -// Testing chmod with one less than the expected number of arguments -echo "\n-- Testing chmod() function with less than expected no. of arguments --\n"; -$filename = 'string_val'; -var_dump( chmod($filename) ); - // testing chmod with a non-existing file $filename = "___nonExisitingFile___"; var_dump(chmod($filename, 0777)); ?> -===DONE=== --EXPECTF-- *** Testing chmod() : error conditions *** --- Testing chmod() function with more than expected no. of arguments -- - -Warning: chmod() expects exactly 2 parameters, 3 given in %s on line %d -NULL - --- Testing chmod() function with less than expected no. of arguments -- - -Warning: chmod() expects exactly 2 parameters, 1 given in %s on line %d -NULL - Warning: chmod(): No such file or directory in %s on line %d bool(false) -===DONE=== diff --git a/ext/standard/tests/file/chmod_variation1.phpt b/ext/standard/tests/file/chmod_variation1.phpt index 935d30ce55..f89c70fa5d 100644 --- a/ext/standard/tests/file/chmod_variation1.phpt +++ b/ext/standard/tests/file/chmod_variation1.phpt @@ -15,12 +15,12 @@ $dirname = __DIR__ . "/" . basename(__FILE__, ".php") . "testdir"; mkdir($dirname); for ($perms_to_set = 0777; $perms_to_set >= 0; $perms_to_set--) { - chmod($dirname, $perms_to_set); - $set_perms = (fileperms($dirname) & PERMISSIONS_MASK); - clearstatcache(); - if ($set_perms != $perms_to_set) { - printf("Error: %o does not match %o\n", $set_perms, $perms_to_set); - } + chmod($dirname, $perms_to_set); + $set_perms = (fileperms($dirname) & PERMISSIONS_MASK); + clearstatcache(); + if ($set_perms != $perms_to_set) { + printf("Error: %o does not match %o\n", $set_perms, $perms_to_set); + } } var_dump(chmod($dirname, 0777)); diff --git a/ext/standard/tests/file/chown.phpt b/ext/standard/tests/file/chown.phpt index 049073e7a0..1654e550b6 100644 --- a/ext/standard/tests/file/chown.phpt +++ b/ext/standard/tests/file/chown.phpt @@ -11,5 +11,5 @@ chown("sjhgfskhagkfdgskjfhgskfsdgfkdsajf", NULL); echo "ALIVE\n"; ?> --EXPECTF-- -Warning: chown(): parameter 2 should be string or int, null given in %schown.php on line %d +Warning: chown(): Parameter 2 should be string or int, null given in %schown.php on line %d ALIVE diff --git a/ext/standard/tests/file/copy_basic.phpt b/ext/standard/tests/file/copy_basic.phpt index 2bd3fc5176..a1eef1486d 100644 --- a/ext/standard/tests/file/copy_basic.phpt +++ b/ext/standard/tests/file/copy_basic.phpt @@ -2,11 +2,6 @@ Test copy() function: basic functionality --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - * Description: Makes a copy of the file source to dest. - * Returns TRUE on success or FALSE on failure. - */ - echo "*** Testing copy() function: to copy file from source to destination --\n"; var_dump( file_exists(__FILE__) ); diff --git a/ext/standard/tests/file/copy_error.phpt b/ext/standard/tests/file/copy_error.phpt index 2d6395167b..3814c3d5f2 100644 --- a/ext/standard/tests/file/copy_error.phpt +++ b/ext/standard/tests/file/copy_error.phpt @@ -2,36 +2,15 @@ Test copy() function: error conditions --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - * Description: Makes a copy of the file source to dest. - * Returns TRUE on success or FALSE on failure. - */ - echo "*** Testing copy() function: error conditions --\n"; /* Invalid args */ var_dump( copy("/no/file", "file") ); -/* No.of args less than expected */ -var_dump( copy() ); -var_dump( copy(__FILE__) ); - -/* No.of args less than expected */ -var_dump( copy(__FILE__, "file1", "file1") ); - echo "*** Done ***\n"; ?> --EXPECTF-- *** Testing copy() function: error conditions -- -Warning: copy(/no/file): failed to open stream: No such file or directory in %s on line %d +Warning: copy(/no/file): Failed to open stream: No such file or directory in %s on line %d bool(false) - -Warning: copy() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: copy() expects at least 2 parameters, 1 given in %s on line %d -NULL - -Warning: copy() expects parameter 3 to be resource, string given in %s on line %d -NULL *** Done *** diff --git a/ext/standard/tests/file/copy_variation1.phpt b/ext/standard/tests/file/copy_variation1.phpt index 018ff47048..40028a6e85 100644 --- a/ext/standard/tests/file/copy_variation1.phpt +++ b/ext/standard/tests/file/copy_variation1.phpt @@ -2,11 +2,6 @@ Test copy() function: usage variations - destination file names(numerics/strings) --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy() function: In creation of destination file names containing numerics/strings and checking the existence and size of destination files */ diff --git a/ext/standard/tests/file/copy_variation10.phpt b/ext/standard/tests/file/copy_variation10.phpt index 78c3426adc..09497c859c 100644 --- a/ext/standard/tests/file/copy_variation10.phpt +++ b/ext/standard/tests/file/copy_variation10.phpt @@ -2,11 +2,6 @@ Test copy() function: usage variations - identical names --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy(): Try copying source file to desntination file, where destination file name is identical to source name */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/copy_variation11.phpt b/ext/standard/tests/file/copy_variation11.phpt index 312802f181..678d13d4c0 100644 --- a/ext/standard/tests/file/copy_variation11.phpt +++ b/ext/standard/tests/file/copy_variation11.phpt @@ -2,11 +2,6 @@ Test copy() function: usage variations - existing dir as destination --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy(): Trying to copy the file to a destination, where destination is an existing dir */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/copy_variation12-win32.phpt b/ext/standard/tests/file/copy_variation12-win32.phpt index 01bf14cc54..ecf857e629 100644 --- a/ext/standard/tests/file/copy_variation12-win32.phpt +++ b/ext/standard/tests/file/copy_variation12-win32.phpt @@ -7,11 +7,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy(): Trying to create a copy of an existing dir */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/copy_variation12.phpt b/ext/standard/tests/file/copy_variation12.phpt index 945ec07083..dad928b4b5 100644 --- a/ext/standard/tests/file/copy_variation12.phpt +++ b/ext/standard/tests/file/copy_variation12.phpt @@ -7,11 +7,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy(): Trying to create a copy of an existing dir */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/copy_variation13.phpt b/ext/standard/tests/file/copy_variation13.phpt index fcd3d6a2a6..f703b0f059 100644 --- a/ext/standard/tests/file/copy_variation13.phpt +++ b/ext/standard/tests/file/copy_variation13.phpt @@ -2,11 +2,6 @@ Test copy() function: usage variations - src as dir and dest as an existing file(Bug #42243) --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy(): Trying to copy dir to an existing file */ echo "*** Test copy() function: Trying to copy dir to file ***\n"; diff --git a/ext/standard/tests/file/copy_variation14.phpt b/ext/standard/tests/file/copy_variation14.phpt index 45289af90a..a79bbf69c5 100644 --- a/ext/standard/tests/file/copy_variation14.phpt +++ b/ext/standard/tests/file/copy_variation14.phpt @@ -2,13 +2,8 @@ Test copy() function: usage variations - non existing src/dest --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy(): Trying to create a copy of non-existing source in an existing destination - and an existing source in non-existing destiantion */ + and an existing source in non-existing destination */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/copy_variation15.phpt b/ext/standard/tests/file/copy_variation15.phpt index 6b52eb7f9b..abe425a4e3 100644 --- a/ext/standard/tests/file/copy_variation15.phpt +++ b/ext/standard/tests/file/copy_variation15.phpt @@ -8,11 +8,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy(): Trying to create a copy of file in a dir which doesn't have write permissions */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/copy_variation16-win32.phpt b/ext/standard/tests/file/copy_variation16-win32.phpt index b6e8a26684..d2730ce332 100644 --- a/ext/standard/tests/file/copy_variation16-win32.phpt +++ b/ext/standard/tests/file/copy_variation16-win32.phpt @@ -7,11 +7,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy() function: Trying to create copy of source file into different destination dir paths given in various notations */ @@ -130,7 +125,7 @@ Size of destination file => int(3500) -- Iteration 7 -- Size of source file => int(3500) Copy operation => -Warning: copy(%s): failed to open stream: No such file or directory in %s on line %d +Warning: copy(%s): Failed to open stream: No such file or directory in %s on line %d bool(false) Existence of destination file => bool(false) diff --git a/ext/standard/tests/file/copy_variation16.phpt b/ext/standard/tests/file/copy_variation16.phpt index cc01f1c534..45095f399e 100644 --- a/ext/standard/tests/file/copy_variation16.phpt +++ b/ext/standard/tests/file/copy_variation16.phpt @@ -7,11 +7,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy() function: Trying to create copy of source file into different destination dir paths given in various notations */ diff --git a/ext/standard/tests/file/copy_variation17.phpt b/ext/standard/tests/file/copy_variation17.phpt index 337e7ec46e..446d72d35d 100644 --- a/ext/standard/tests/file/copy_variation17.phpt +++ b/ext/standard/tests/file/copy_variation17.phpt @@ -2,11 +2,6 @@ Test copy() function: usage variations - wildcard chars in source --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy(): Trying to copy the source file which is given with the combination of wild-card chars */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/copy_variation18.phpt b/ext/standard/tests/file/copy_variation18.phpt index 81d5e3dab9..75938f0888 100644 --- a/ext/standard/tests/file/copy_variation18.phpt +++ b/ext/standard/tests/file/copy_variation18.phpt @@ -2,11 +2,6 @@ Test copy() function: usage variations - stat after copy --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy(): checking stat of file before and after after copy operation */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/copy_variation2-win32-mb.phpt b/ext/standard/tests/file/copy_variation2-win32-mb.phpt index 530fb6089c..4251a24e54 100644 --- a/ext/standard/tests/file/copy_variation2-win32-mb.phpt +++ b/ext/standard/tests/file/copy_variation2-win32-mb.phpt @@ -7,11 +7,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy() function: In creation of destination file names containing special characters and checking the existence and size of destination files */ diff --git a/ext/standard/tests/file/copy_variation2-win32.phpt b/ext/standard/tests/file/copy_variation2-win32.phpt index 563475a3bb..c8f695efea 100644 --- a/ext/standard/tests/file/copy_variation2-win32.phpt +++ b/ext/standard/tests/file/copy_variation2-win32.phpt @@ -7,11 +7,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy() function: In creation of destination file names containing special characters and checking the existence and size of destination files */ diff --git a/ext/standard/tests/file/copy_variation2.phpt b/ext/standard/tests/file/copy_variation2.phpt index 2106cd5ed7..33770b6b31 100644 --- a/ext/standard/tests/file/copy_variation2.phpt +++ b/ext/standard/tests/file/copy_variation2.phpt @@ -7,11 +7,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy() function: In creation of destination file names containing special characters and checking the existence and size of destination files */ diff --git a/ext/standard/tests/file/copy_variation3-win32.phpt b/ext/standard/tests/file/copy_variation3-win32.phpt index a8a3aeb746..ed4cbfb89b 100644 --- a/ext/standard/tests/file/copy_variation3-win32.phpt +++ b/ext/standard/tests/file/copy_variation3-win32.phpt @@ -9,11 +9,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") obscure_filename --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy() function: In creation of destination file names containing white spaces and checking the existence and size of destination files */ diff --git a/ext/standard/tests/file/copy_variation3.phpt b/ext/standard/tests/file/copy_variation3.phpt index ca70ed24f4..7dc9c1b1b3 100644 --- a/ext/standard/tests/file/copy_variation3.phpt +++ b/ext/standard/tests/file/copy_variation3.phpt @@ -9,11 +9,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") obscure_filename --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy() function: In creation of destination file names containing white spaces and checking the existence and size of destination files */ diff --git a/ext/standard/tests/file/copy_variation4.phpt b/ext/standard/tests/file/copy_variation4.phpt Binary files differindex b082c082b5..d467cb4ce9 100644 --- a/ext/standard/tests/file/copy_variation4.phpt +++ b/ext/standard/tests/file/copy_variation4.phpt diff --git a/ext/standard/tests/file/copy_variation5-win32.phpt b/ext/standard/tests/file/copy_variation5-win32.phpt index 8ef72ef8ce..d3f75262a1 100644 --- a/ext/standard/tests/file/copy_variation5-win32.phpt +++ b/ext/standard/tests/file/copy_variation5-win32.phpt @@ -7,11 +7,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy() function: Checking case sensitivity in creation of destination file names and the existence and size of destination files */ diff --git a/ext/standard/tests/file/copy_variation5.phpt b/ext/standard/tests/file/copy_variation5.phpt index 404ff843fb..6da9f1f48c 100644 --- a/ext/standard/tests/file/copy_variation5.phpt +++ b/ext/standard/tests/file/copy_variation5.phpt @@ -7,11 +7,6 @@ if( (stristr(PHP_OS, "Darwin")) || (stristr(PHP_OS, "Win")) ) ?> --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy() function: Checking case sensitivity in creation of destination file names and the existence and size of destination files */ diff --git a/ext/standard/tests/file/copy_variation6-win32.phpt b/ext/standard/tests/file/copy_variation6-win32.phpt index 59a82236d2..c0b3ec9720 100644 --- a/ext/standard/tests/file/copy_variation6-win32.phpt +++ b/ext/standard/tests/file/copy_variation6-win32.phpt @@ -7,11 +7,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy() function: Trying to create copy of source file into different destination dir paths given in various notations */ @@ -129,7 +124,7 @@ Size of destination file => int(0) -- Iteration 7 -- Copy operation => -Warning: copy(%s/copy_variation6/copy_variation6_sub///../*): failed to open stream: No such file or directory in %s on line %d +Warning: copy(%s/copy_variation6/copy_variation6_sub///../*): Failed to open stream: No such file or directory in %s on line %d bool(false) Existence of destination file => bool(false) diff --git a/ext/standard/tests/file/copy_variation6.phpt b/ext/standard/tests/file/copy_variation6.phpt index c505cb77ec..ae20f48733 100644 --- a/ext/standard/tests/file/copy_variation6.phpt +++ b/ext/standard/tests/file/copy_variation6.phpt @@ -7,11 +7,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy() function: Trying to create copy of source file into different destination dir paths given in various notations */ diff --git a/ext/standard/tests/file/copy_variation7.phpt b/ext/standard/tests/file/copy_variation7.phpt index 0ab30cdb7b..c5321aad4e 100644 --- a/ext/standard/tests/file/copy_variation7.phpt +++ b/ext/standard/tests/file/copy_variation7.phpt @@ -7,11 +7,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy() function: Trying to create copy of links */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/copy_variation8.phpt b/ext/standard/tests/file/copy_variation8.phpt index dc69a27b33..6d54595470 100644 --- a/ext/standard/tests/file/copy_variation8.phpt +++ b/ext/standard/tests/file/copy_variation8.phpt @@ -7,11 +7,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Trying to copy the links across dir paths given in various notations and dirs having limited access */ diff --git a/ext/standard/tests/file/copy_variation9.phpt b/ext/standard/tests/file/copy_variation9.phpt index 2c1005ec64..ee82eda188 100644 --- a/ext/standard/tests/file/copy_variation9.phpt +++ b/ext/standard/tests/file/copy_variation9.phpt @@ -8,11 +8,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype: bool copy ( string $source, string $dest ); - Description: Makes a copy of the file source to dest. - Returns TRUE on success or FALSE on failure. -*/ - /* Test copy(): Trying to copy source file to destination file with and without write permissions */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/directory_wrapper_fstat_basic.phpt b/ext/standard/tests/file/directory_wrapper_fstat_basic.phpt index 9131a4cfcd..14f7bac438 100644 --- a/ext/standard/tests/file/directory_wrapper_fstat_basic.phpt +++ b/ext/standard/tests/file/directory_wrapper_fstat_basic.phpt @@ -7,7 +7,5 @@ $h = opendir($d); var_dump(fstat($h)); closedir($h); ?> -===DONE=== --EXPECT-- bool(false) -===DONE=== diff --git a/ext/standard/tests/file/dirname_basic-win32.phpt b/ext/standard/tests/file/dirname_basic-win32.phpt index bb53255fc8..6b1ed3095f 100644 --- a/ext/standard/tests/file/dirname_basic-win32.phpt +++ b/ext/standard/tests/file/dirname_basic-win32.phpt @@ -9,55 +9,48 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype : string dirname(string path) - * Description: Returns the directory name component of the path - * Source code: ext/standard/string.c - * Alias to functions: - */ - echo "*** Testing dirname() : basic functionality ***\n"; // Initialise all required variables $paths = array( - '', - ' ', - 'c:', - 'c:\\', - 'c:/', - 'afile', - 'c:\test\afile', - 'c:\\test\\afile', - 'c://test//afile', - 'c:\test\afile\\', - '/usr/lib/locale/en_US', - '//usr/lib//locale/en_US', - '\\', - '\\\\', - '/', - '//', - '///', - '/usr/lib/locale/en_US/', - 'c:\windows/system32\drivers/etc\hosts', - '/usr\lib/locale\en_US', - ' c:\test\adir\afile.txt', - 'c:\test\adir\afile.txt ', - ' c:\test\adir\afile.txt ', - ' /usr/lib/locale/en_US', - '/usr/lib/locale/en_US ', - ' /usr/lib/locale/en_US ', - ' c:', - ' c:\test\adir\afile.txt', - '/usr', - '/usr/', - ); + '', + ' ', + 'c:', + 'c:\\', + 'c:/', + 'afile', + 'c:\test\afile', + 'c:\\test\\afile', + 'c://test//afile', + 'c:\test\afile\\', + '/usr/lib/locale/en_US', + '//usr/lib//locale/en_US', + '\\', + '\\\\', + '/', + '//', + '///', + '/usr/lib/locale/en_US/', + 'c:\windows/system32\drivers/etc\hosts', + '/usr\lib/locale\en_US', + ' c:\test\adir\afile.txt', + 'c:\test\adir\afile.txt ', + ' c:\test\adir\afile.txt ', + ' /usr/lib/locale/en_US', + '/usr/lib/locale/en_US ', + ' /usr/lib/locale/en_US ', + ' c:', + ' c:\test\adir\afile.txt', + '/usr', + '/usr/', + ); foreach ($paths as $path) { - var_dump( dirname($path) ); + var_dump( dirname($path) ); } ?> -===DONE=== --EXPECT-- *** Testing dirname() : basic functionality *** string(0) "" @@ -90,4 +83,3 @@ string(1) "." string(14) " c:\test\adir" string(1) "\" string(1) "\" -===DONE=== diff --git a/ext/standard/tests/file/dirname_basic.phpt b/ext/standard/tests/file/dirname_basic.phpt index 74d0a14e9e..97fbe85a28 100644 --- a/ext/standard/tests/file/dirname_basic.phpt +++ b/ext/standard/tests/file/dirname_basic.phpt @@ -9,55 +9,48 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype : string dirname(string path) - * Description: Returns the directory name component of the path - * Source code: ext/standard/string.c - * Alias to functions: - */ - echo "*** Testing dirname() : basic functionality ***\n"; // Initialise all required variables $paths = array( - '', - ' ', - 'c:', - 'c:\\', - 'c:/', - 'afile', - 'c:\test\afile', - 'c:\\test\\afile', - 'c://test//afile', - 'c:\test\afile\\', - '/usr/lib/locale/en_US', - '//usr/lib//locale/en_US', - '\\', - '\\\\', - '/', - '//', - '///', - '/usr/lib/locale/en_US/', - 'c:\windows/system32\drivers/etc\hosts', - '/usr\lib/locale\en_US', - ' c:\test\adir\afile.txt', - 'c:\test\adir\afile.txt ', - ' c:\test\adir\afile.txt ', - ' /usr/lib/locale/en_US', - '/usr/lib/locale/en_US ', - ' /usr/lib/locale/en_US ', - ' c:', - ' c:\test\adir\afile.txt', - '/usr', - '/usr/' - ); + '', + ' ', + 'c:', + 'c:\\', + 'c:/', + 'afile', + 'c:\test\afile', + 'c:\\test\\afile', + 'c://test//afile', + 'c:\test\afile\\', + '/usr/lib/locale/en_US', + '//usr/lib//locale/en_US', + '\\', + '\\\\', + '/', + '//', + '///', + '/usr/lib/locale/en_US/', + 'c:\windows/system32\drivers/etc\hosts', + '/usr\lib/locale\en_US', + ' c:\test\adir\afile.txt', + 'c:\test\adir\afile.txt ', + ' c:\test\adir\afile.txt ', + ' /usr/lib/locale/en_US', + '/usr/lib/locale/en_US ', + ' /usr/lib/locale/en_US ', + ' c:', + ' c:\test\adir\afile.txt', + '/usr', + '/usr/' + ); foreach ($paths as $path) { - var_dump( dirname($path) ); + var_dump( dirname($path) ); } ?> -===DONE=== --EXPECT-- *** Testing dirname() : basic functionality *** string(0) "" @@ -90,4 +83,3 @@ string(1) "." string(1) "." string(1) "/" string(1) "/" -===DONE=== diff --git a/ext/standard/tests/file/dirname_no_path_normalization-win32.phpt b/ext/standard/tests/file/dirname_no_path_normalization-win32.phpt index 2bb227b5c2..cde1e92e24 100644 --- a/ext/standard/tests/file/dirname_no_path_normalization-win32.phpt +++ b/ext/standard/tests/file/dirname_no_path_normalization-win32.phpt @@ -10,18 +10,16 @@ if(substr(PHP_OS, 0, 3) != "WIN") $s = '/php_sanity/sanity.php?'; while (dirname($s) == "/php_sanity" && strlen($s) < 10000) { - $s .= str_repeat('X', 250); + $s .= str_repeat('X', 250); } if (strlen($s) >= 10000) { - echo "OK\n"; + echo "OK\n"; } else { - print "ERROR: " . PHP_EOL; - var_dump(dirname($s)); - var_dump(strlen($s)); + print "ERROR: " . PHP_EOL; + var_dump(dirname($s)); + var_dump(strlen($s)); } ?> -===DONE=== --EXPECT-- OK -===DONE=== diff --git a/ext/standard/tests/file/disk.phpt b/ext/standard/tests/file/disk.phpt index 0ed1dcea95..424de1f6ba 100644 --- a/ext/standard/tests/file/disk.phpt +++ b/ext/standard/tests/file/disk.phpt @@ -13,9 +13,6 @@ disk_total_space --FILE-- <?php -var_dump(disk_free_space()); -var_dump(disk_total_space()); - var_dump(disk_free_space(-1)); var_dump(disk_total_space(-1)); @@ -28,12 +25,6 @@ var_dump(disk_total_space("/some/path/here")); echo "Done\n"; ?> --EXPECTF-- -Warning: disk_free_space() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: disk_total_space() expects exactly 1 parameter, 0 given in %s on line %d -NULL - Warning: disk_free_space(): No such file or directory in %s on line %d bool(false) diff --git a/ext/standard/tests/file/disk_free_space_basic.phpt b/ext/standard/tests/file/disk_free_space_basic.phpt index fcb2a93e41..29b2cefed9 100644 --- a/ext/standard/tests/file/disk_free_space_basic.phpt +++ b/ext/standard/tests/file/disk_free_space_basic.phpt @@ -8,13 +8,6 @@ if (getenv("TRAVIS") === "true") die("skip inaccurate on TravisCI"); memory_limit=32M --FILE-- <?php -/* - * Prototype: float disk_free_space( string directory ) - * Description: Given a string containing a directory, this function - * will return the number of bytes available on the corresponding - * filesystem or disk partition - */ - $file_path = __DIR__; echo "*** Testing with existing directory ***\n"; diff --git a/ext/standard/tests/file/disk_free_space_error-win32.phpt b/ext/standard/tests/file/disk_free_space_error-win32.phpt index 43e71719c0..64723f5bf7 100644 --- a/ext/standard/tests/file/disk_free_space_error-win32.phpt +++ b/ext/standard/tests/file/disk_free_space_error-win32.phpt @@ -7,21 +7,8 @@ if(substr(PHP_OS, 0, 3) != 'WIN' ) ?> --FILE-- <?php -/* - * Prototype: float disk_free_space( string directory ) - * Description: Given a string containing a directory, this function will - * return the number of bytes available on the corresponding - * filesystem or disk partition - */ - echo "*** Testing error conditions ***\n"; $file_path = __DIR__; -var_dump( disk_free_space() ); // Zero Arguments -var_dump( diskfreespace() ); - -var_dump( disk_free_space( $file_path, "extra argument") ); // More than valid number of arguments -var_dump( diskfreespace( $file_path, "extra argument") ); - var_dump( disk_free_space( $file_path."/dir1" )); // Invalid directory var_dump( diskfreespace( $file_path."/dir1" )); @@ -43,18 +30,6 @@ unlink($file_path."/disk_free_space.tmp"); --EXPECTF-- *** Testing error conditions *** -Warning: disk_free_space() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: diskfreespace() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: disk_free_space() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: diskfreespace() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: disk_free_space(): The system cannot find the path specified. in %s on line %d bool(false) diff --git a/ext/standard/tests/file/disk_free_space_error.phpt b/ext/standard/tests/file/disk_free_space_error.phpt index aca17b2331..62dd8c40ee 100644 --- a/ext/standard/tests/file/disk_free_space_error.phpt +++ b/ext/standard/tests/file/disk_free_space_error.phpt @@ -7,21 +7,8 @@ if(substr(PHP_OS, 0, 3) == 'WIN') ?> --FILE-- <?php -/* - * Prototype: float disk_free_space( string directory ) - * Description: Given a string containing a directory, this function will - * return the number of bytes available on the corresponding - * filesystem or disk partition - */ - echo "*** Testing error conditions ***\n"; $file_path = __DIR__; -var_dump( disk_free_space() ); // Zero Arguments -var_dump( diskfreespace() ); - -var_dump( disk_free_space( $file_path, "extra argument") ); // More than valid number of arguments -var_dump( diskfreespace( $file_path, "extra argument") ); - var_dump( disk_free_space( $file_path."/dir1" )); // Invalid directory var_dump( diskfreespace( $file_path."/dir1" )); @@ -43,18 +30,6 @@ unlink($file_path."/disk_free_space.tmp"); --EXPECTF-- *** Testing error conditions *** -Warning: disk_free_space() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: diskfreespace() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: disk_free_space() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: diskfreespace() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: disk_free_space(): No such file or directory in %s on line %d bool(false) diff --git a/ext/standard/tests/file/disk_free_space_variation.phpt b/ext/standard/tests/file/disk_free_space_variation.phpt index 25eeadf800..d5adb32213 100644 --- a/ext/standard/tests/file/disk_free_space_variation.phpt +++ b/ext/standard/tests/file/disk_free_space_variation.phpt @@ -2,13 +2,6 @@ Test disk_free_space and its alias diskfreespace() functions : Usage Variations --FILE-- <?php -/* - * Prototype: float disk_free_space( string directory ) - * Description: Given a string containing a directory, this function - * will return the number of bytes available on the corresponding - * filesystem or disk partition - */ - $file_path = __DIR__; echo "*** Testing with a directory ***\n"; @@ -48,8 +41,16 @@ $count = 1; /* loop through to test each element the above array */ foreach($dirs_arr as $dir1) { echo "\n-- Iteration $count --\n"; - var_dump( disk_free_space( $dir1 ) ); - var_dump( diskfreespace( $dir1 ) ); + try { + var_dump( disk_free_space( $dir1 ) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + try { + var_dump( diskfreespace( $dir1 ) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $count++; } @@ -102,35 +103,19 @@ float(%d) float(%d) -- Iteration 9 -- - -Warning: disk_free_space() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: diskfreespace() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +disk_free_space(): Argument #1 ($directory) must be a valid path, string given +diskfreespace(): Argument #1 ($directory) must be a valid path, string given -- Iteration 10 -- - -Warning: disk_free_space() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: diskfreespace() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +disk_free_space(): Argument #1 ($directory) must be a valid path, string given +diskfreespace(): Argument #1 ($directory) must be a valid path, string given -- Iteration 11 -- - -Warning: disk_free_space() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: diskfreespace() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +disk_free_space(): Argument #1 ($directory) must be a valid path, string given +diskfreespace(): Argument #1 ($directory) must be a valid path, string given -- Iteration 12 -- - -Warning: disk_free_space() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: diskfreespace() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +disk_free_space(): Argument #1 ($directory) must be a valid path, string given +diskfreespace(): Argument #1 ($directory) must be a valid path, string given --- Done --- diff --git a/ext/standard/tests/file/disk_total_space_basic.phpt b/ext/standard/tests/file/disk_total_space_basic.phpt index b32b60f6b6..0bb6159a40 100644 --- a/ext/standard/tests/file/disk_total_space_basic.phpt +++ b/ext/standard/tests/file/disk_total_space_basic.phpt @@ -4,13 +4,6 @@ Test disk_total_space() function : basic functionality disk_total_space --FILE-- <?php -/* - * Prototype: float disk_total_space( string $directory ); - * Description: given a string containing a directory, this function will - * return the total number of bytes on the corresponding filesyatem - * or disk partition. - */ - $file_path = __DIR__; echo "*** Testing with normal directory ***\n"; diff --git a/ext/standard/tests/file/disk_total_space_error-win32.phpt b/ext/standard/tests/file/disk_total_space_error-win32.phpt index c280f5e064..7621fe1523 100644 --- a/ext/standard/tests/file/disk_total_space_error-win32.phpt +++ b/ext/standard/tests/file/disk_total_space_error-win32.phpt @@ -9,19 +9,8 @@ if(substr(PHP_OS, 0, 3) != 'WIN' ) disk_total_space --FILE-- <?php -/* - * Prototype: float disk_total_space( string $directory ); - * Description: given a string containing a directory, this function - * will return the total number of bytes on the corresponding - * filesystem or disk partition - */ - echo "*** Testing error conditions ***\n"; $file_path = __DIR__; -var_dump( disk_total_space() ); // Zero Arguments - -var_dump( disk_total_space( $file_path, "extra argument") ); // More than valid number of arguments - var_dump( disk_total_space( $file_path."/dir1" )); // Invalid directory @@ -40,12 +29,6 @@ unlink($file_path."/disk_total_space.tmp"); --EXPECTF-- *** Testing error conditions *** -Warning: disk_total_space() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: disk_total_space() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: disk_total_space(): The system cannot find the path specified. in %s on line %d bool(false) diff --git a/ext/standard/tests/file/disk_total_space_error.phpt b/ext/standard/tests/file/disk_total_space_error.phpt index 8fd5cc3c53..e4bd31fa5d 100644 --- a/ext/standard/tests/file/disk_total_space_error.phpt +++ b/ext/standard/tests/file/disk_total_space_error.phpt @@ -9,19 +9,8 @@ if(substr(PHP_OS, 0, 3) == 'WIN') disk_total_space --FILE-- <?php -/* - * Prototype: float disk_total_space( string $directory ); - * Description: given a string containing a directory, this function - * will return the total number of bytes on the corresponding - * filesystem or disk partition - */ - echo "*** Testing error conditions ***\n"; $file_path = __DIR__; -var_dump( disk_total_space() ); // Zero Arguments - -var_dump( disk_total_space( $file_path, "extra argument") ); // More than valid number of arguments - var_dump( disk_total_space( $file_path."/dir1" )); // Invalid directory @@ -40,12 +29,6 @@ unlink($file_path."/disk_total_space.tmp"); --EXPECTF-- *** Testing error conditions *** -Warning: disk_total_space() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: disk_total_space() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: disk_total_space(): No such file or directory in %s on line %d bool(false) float(%d) diff --git a/ext/standard/tests/file/disk_total_space_variation.phpt b/ext/standard/tests/file/disk_total_space_variation.phpt index 05d1f074d3..da09238ecc 100644 --- a/ext/standard/tests/file/disk_total_space_variation.phpt +++ b/ext/standard/tests/file/disk_total_space_variation.phpt @@ -4,13 +4,6 @@ Testing disk_total_space() functions : Usage Variations. disk_total_space --FILE-- <?php -/* - * Prototype: float disk_total_space( string directory ) - * Description: given a string containing a directory, this function - * will return the total number of bytes on the corresponding - * filesystem or disk partition. - */ - $file_path = __DIR__; echo "*** Testing with a directory ***\n"; @@ -51,7 +44,11 @@ $count = 1; /* loop through to test each element the above array */ foreach($dirs_arr as $dir1) { echo "\n-- Iteration $count --\n"; - var_dump( disk_total_space( $dir1 ) ); + try { + var_dump( disk_total_space( $dir1 ) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $count++; } @@ -98,25 +95,17 @@ float(%d) float(%d) -- Iteration 9 -- - -Warning: disk_total_space() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +disk_total_space(): Argument #1 ($directory) must be a valid path, string given -- Iteration 10 -- - -Warning: disk_total_space() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +disk_total_space(): Argument #1 ($directory) must be a valid path, string given -- Iteration 11 -- - -Warning: disk_total_space() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +disk_total_space(): Argument #1 ($directory) must be a valid path, string given -- Iteration 12 -- - -Warning: disk_total_space() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +disk_total_space(): Argument #1 ($directory) must be a valid path, string given *** Testing with Binary Input *** -float(%d) +float(%s) --- Done --- diff --git a/ext/standard/tests/file/fclose_variation1.phpt b/ext/standard/tests/file/fclose_variation1.phpt index ba3631e50d..8d3e1a1805 100644 --- a/ext/standard/tests/file/fclose_variation1.phpt +++ b/ext/standard/tests/file/fclose_variation1.phpt @@ -7,9 +7,13 @@ function separate_zval(&$var) { } $s2 = $s; separate_zval($s2); fclose($s); -echo fread($s2, strlen("<?php")); +try { + echo fread($s2, strlen("<?php")); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "\nDone.\n"; ---EXPECTF-- -Warning: fread(): supplied resource is not a valid stream resource in %s on line %d +--EXPECT-- +fread(): supplied resource is not a valid stream resource Done. diff --git a/ext/standard/tests/file/feof_basic.phpt b/ext/standard/tests/file/feof_basic.phpt index 2fc2e4b855..a263bf1fbe 100644 --- a/ext/standard/tests/file/feof_basic.phpt +++ b/ext/standard/tests/file/feof_basic.phpt @@ -4,12 +4,6 @@ Test feof() function : basic functionality Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : proto bool feof(resource fp) - * Description: Test for end-of-file on a file pointer - * Source code: ext/standard/file.c - * Alias to functions: gzeof - */ - echo "*** Testing feof() : basic functionality ***\n"; $tmpFile1 = __FILE__.".tmp1"; $h = fopen($tmpFile1, 'wb'); @@ -64,13 +58,17 @@ var_dump(feof($h)); echo "*** closing file, testing eof ***\n"; fclose($h); -feof($h); +try { + feof($h); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} unlink($tmpFile1); unlink($tmpFile2); echo "Done"; ?> ---EXPECTF-- +--EXPECT-- *** Testing feof() : basic functionality *** *** testing reading complete file using feof to stop *** @@ -96,6 +94,5 @@ bool(false) *** testing feof after a seek passed the end *** bool(false) *** closing file, testing eof *** - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d +feof(): supplied resource is not a valid stream resource Done diff --git a/ext/standard/tests/file/fflush_basic.phpt b/ext/standard/tests/file/fflush_basic.phpt index 2c9314394b..3d1dd22f7b 100644 --- a/ext/standard/tests/file/fflush_basic.phpt +++ b/ext/standard/tests/file/fflush_basic.phpt @@ -2,9 +2,6 @@ Test fflush() function: basic functionality --FILE-- <?php -/* Prototype: bool fflush ( resource $handle ); - Description: Flushes the output to a file -*/ echo "*** Testing fflush(): writing to a file and reading the contents ***\n"; $data = <<<EOD @@ -22,7 +19,7 @@ if($file_handle == false) exit("Error:failed to open file $filename"); if(substr(PHP_OS, 0, 3) == "WIN") { - $data = str_replace("\r",'', $data); + $data = str_replace("\r",'', $data); } // writing data to the file diff --git a/ext/standard/tests/file/fflush_variation1-win32-mb.phpt b/ext/standard/tests/file/fflush_variation1-win32-mb.phpt index 9c654a8688..964806bc68 100644 --- a/ext/standard/tests/file/fflush_variation1-win32-mb.phpt +++ b/ext/standard/tests/file/fflush_variation1-win32-mb.phpt @@ -7,9 +7,6 @@ if( substr(PHP_OS, 0, 3) != "WIN" ) ?> --FILE-- <?php -/* Prototype: bool fflush ( resource $handle ); - Description: Flushes the output to a file -*/ /* test fflush() with handle to the files opened in different modes */ diff --git a/ext/standard/tests/file/fflush_variation1-win32.phpt b/ext/standard/tests/file/fflush_variation1-win32.phpt index fd72d652b4..9761b97655 100644 --- a/ext/standard/tests/file/fflush_variation1-win32.phpt +++ b/ext/standard/tests/file/fflush_variation1-win32.phpt @@ -7,9 +7,6 @@ if( substr(PHP_OS, 0, 3) != "WIN" ) ?> --FILE-- <?php -/* Prototype: bool fflush ( resource $handle ); - Description: Flushes the output to a file -*/ /* test fflush() with handle to the files opened in different modes */ diff --git a/ext/standard/tests/file/fflush_variation1.phpt b/ext/standard/tests/file/fflush_variation1.phpt index 8dd2db1d21..930aabff5c 100644 --- a/ext/standard/tests/file/fflush_variation1.phpt +++ b/ext/standard/tests/file/fflush_variation1.phpt @@ -7,9 +7,6 @@ if( substr(PHP_OS, 0, 3) == "WIN" ) ?> --FILE-- <?php -/* Prototype: bool fflush ( resource $handle ); - Description: Flushes the output to a file -*/ /* test fflush() with handle of files opened in different modes */ diff --git a/ext/standard/tests/file/fflush_variation2.phpt b/ext/standard/tests/file/fflush_variation2.phpt index a10be353bc..c13eeb0ccf 100644 --- a/ext/standard/tests/file/fflush_variation2.phpt +++ b/ext/standard/tests/file/fflush_variation2.phpt @@ -7,9 +7,6 @@ if( substr(PHP_OS, 0, 3) == 'WIN') ?> --FILE-- <?php -/* Prototype: bool fflush ( resource $handle ); - Description: Flushes the output to a file -*/ /* test fflush() with handle to symbollic link */ diff --git a/ext/standard/tests/file/fflush_variation3.phpt b/ext/standard/tests/file/fflush_variation3.phpt index 7f9a1b6772..53a9f661b1 100644 --- a/ext/standard/tests/file/fflush_variation3.phpt +++ b/ext/standard/tests/file/fflush_variation3.phpt @@ -7,9 +7,6 @@ if( substr(PHP_OS, 0, 3) == 'WIN') ?> --FILE-- <?php -/* Prototype: bool fflush ( resource $handle ); - Description: Flushes the output to a file -*/ /* test fflush() with handle to hard links as resource */ diff --git a/ext/standard/tests/file/fflush_variation4.phpt b/ext/standard/tests/file/fflush_variation4.phpt index 94c0f6a31e..e73735700d 100644 --- a/ext/standard/tests/file/fflush_variation4.phpt +++ b/ext/standard/tests/file/fflush_variation4.phpt @@ -2,9 +2,6 @@ Test fflush() function: usage variations - file opened in read-only mode --FILE-- <?php -/* Prototype: bool fflush ( resource $handle ); - Description: Flushes the output to a file -*/ /* test fflush() with handle to a file opened in read-only mode as resource */ diff --git a/ext/standard/tests/file/fgetc_basic.phpt b/ext/standard/tests/file/fgetc_basic.phpt index f5b8ef9055..1f7ad2c03e 100644 --- a/ext/standard/tests/file/fgetc_basic.phpt +++ b/ext/standard/tests/file/fgetc_basic.phpt @@ -2,15 +2,11 @@ Test fgetc() function : basic functionality --FILE-- <?php -/* - Prototype: string fgetc ( resource $handle ); - Description: Gets character from file pointer -*/ // include the header for common test function include ("file.inc"); echo "*** Testing fgetc() : basic operations ***\n"; -/* read charecter from different files which are opened in different modes */ +/* read character from different files which are opened in different modes */ $file_modes = array( "r", "rb", "rt", "r+", "r+b", "r+t"); /* create file with following type of contents */ @@ -46,7 +42,7 @@ for($outerloop_counter = 0; $outerloop_counter < count($file_content_types); $ou var_dump( fgetc($file_handle) ); // read a char var_dump( ftell($file_handle) ); // file pointer position var_dump( feof($file_handle) ); // is it eof() - var_dump($file_handle); // dump the $file_handle to see if any thing got modifed + var_dump($file_handle); // dump the $file_handle to see if any thing got modified } // end of for // close the file diff --git a/ext/standard/tests/file/fgetc_variation1.phpt b/ext/standard/tests/file/fgetc_variation1.phpt index 7c6a01ded9..a4d956aa5a 100644 --- a/ext/standard/tests/file/fgetc_variation1.phpt +++ b/ext/standard/tests/file/fgetc_variation1.phpt @@ -2,10 +2,6 @@ Test fgetc() function : usage variations - read when file pointer at EOF --FILE-- <?php -/* - Prototype: string fgetc ( resource $handle ); - Description: Gets character from file pointer -*/ // include the header for common test function include ("file.inc"); diff --git a/ext/standard/tests/file/fgetc_variation2.phpt b/ext/standard/tests/file/fgetc_variation2.phpt index d444209af4..4255899833 100644 --- a/ext/standard/tests/file/fgetc_variation2.phpt +++ b/ext/standard/tests/file/fgetc_variation2.phpt @@ -2,11 +2,6 @@ Test fgetc() function : usage variations - closed handle --FILE-- <?php -/* - Prototype: string fgetc ( resource $handle ); - Description: Gets character from file pointer -*/ - /* try reading a char using fgetc() using invalid handles - closed file handle - unset file handle @@ -24,29 +19,16 @@ $file_handle = fopen(__FILE__, "r"); fclose($file_handle); // read from closed file -var_dump( fgetc($file_handle) ); - -echo "-- Testing fgetc() with unset handle --\n"; -// open the file for reading -$file_handle = fopen(__FILE__, "r"); -// unset the file handle -unset($file_handle); - -//fgetc using unset handle -var_dump( fgetc($file_handle) ); +try { + var_dump( fgetc($file_handle) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fgetc() : usage variations *** -- Testing fgetc() with closed handle -- - -Warning: fgetc(): supplied resource is not a valid stream resource in %s on line %d -bool(false) --- Testing fgetc() with unset handle -- - -Notice: Undefined variable: file_handle in %s on line %d - -Warning: fgetc() expects parameter 1 to be resource, null given in %s on line %d -bool(false) +fgetc(): supplied resource is not a valid stream resource Done diff --git a/ext/standard/tests/file/fgetc_variation3.phpt b/ext/standard/tests/file/fgetc_variation3.phpt index 67f5c76ff4..ba47e303f7 100644 --- a/ext/standard/tests/file/fgetc_variation3.phpt +++ b/ext/standard/tests/file/fgetc_variation3.phpt @@ -3,7 +3,6 @@ Test fgetc() function : usage variations - write only modes (Bug #42036) --FILE-- <?php /* - Prototype: string fgetc ( resource $handle ); Description: Gets character from file pointer */ @@ -56,7 +55,7 @@ bool(true) int(0) bool(false) -Notice: fgetc(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fgetc(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -65,7 +64,7 @@ bool(true) int(0) bool(false) -Notice: fgetc(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fgetc(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -74,7 +73,7 @@ bool(true) int(0) bool(false) -Notice: fgetc(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fgetc(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -83,7 +82,7 @@ bool(true) int(0) bool(false) -Notice: fgetc(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fgetc(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -92,7 +91,7 @@ bool(true) int(0) bool(false) -Notice: fgetc(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fgetc(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -101,7 +100,7 @@ bool(true) int(0) bool(false) -Notice: fgetc(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fgetc(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -110,7 +109,7 @@ bool(true) int(0) bool(false) -Notice: fgetc(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fgetc(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -119,7 +118,7 @@ bool(true) int(0) bool(false) -Notice: fgetc(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fgetc(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -128,7 +127,7 @@ bool(true) int(0) bool(false) -Notice: fgetc(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fgetc(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) diff --git a/ext/standard/tests/file/fgetc_variation4.phpt b/ext/standard/tests/file/fgetc_variation4.phpt index 99af3c80af..99eef57d06 100644 --- a/ext/standard/tests/file/fgetc_variation4.phpt +++ b/ext/standard/tests/file/fgetc_variation4.phpt @@ -2,11 +2,6 @@ Test fgetc() function : usage variations - different read modes --FILE-- <?php -/* - Prototype: string fgetc ( resource $handle ); - Description: Gets character from file pointer -*/ - /* read from fie using fgetc, file opened using different read read modes */ diff --git a/ext/standard/tests/file/fgetcsv.phpt b/ext/standard/tests/file/fgetcsv.phpt index 7a6d7d59db..17ac19ca60 100644 --- a/ext/standard/tests/file/fgetcsv.phpt +++ b/ext/standard/tests/file/fgetcsv.phpt @@ -2,39 +2,39 @@ various fgetcsv() functionality tests --FILE-- <?php - $list = array( - 'aaa,bbb', - 'aaa,"bbb"', - '"aaa","bbb"', - 'aaa,bbb', - '"aaa",bbb', - '"aaa", "bbb"', - ',', - 'aaa,', - ',"aaa"', - '"",""', - '"\\"","aaa"', - '"""""",', - '""""",aaa', - '"\\""",aaa', - 'aaa,"\\"bbb,ccc', - 'aaa,bbb ', - 'aaa,"bbb "', - 'aaa"aaa","bbb"bbb', - 'aaa"aaa""",bbb', - 'aaa"\\"a","bbb"' - ); + $list = array( + 'aaa,bbb', + 'aaa,"bbb"', + '"aaa","bbb"', + 'aaa,bbb', + '"aaa",bbb', + '"aaa", "bbb"', + ',', + 'aaa,', + ',"aaa"', + '"",""', + '"\\"","aaa"', + '"""""",', + '""""",aaa', + '"\\""",aaa', + 'aaa,"\\"bbb,ccc', + 'aaa,bbb ', + 'aaa,"bbb "', + 'aaa"aaa","bbb"bbb', + 'aaa"aaa""",bbb', + 'aaa"\\"a","bbb"' + ); - $file = __DIR__ . '/fgetcsv.csv'; - @unlink($file); - foreach ($list as $v) { - $fp = fopen($file, "w"); - fwrite($fp, $v . "\n"); - fclose($fp); + $file = __DIR__ . '/fgetcsv.csv'; + @unlink($file); + foreach ($list as $v) { + $fp = fopen($file, "w"); + fwrite($fp, $v . "\n"); + fclose($fp); - var_dump(fgetcsv(fopen($file, "r"), 1024)); - } - @unlink($file); + var_dump(fgetcsv(fopen($file, "r"), 1024)); + } + @unlink($file); ?> --EXPECT-- array(2) { diff --git a/ext/standard/tests/file/fgetcsv_error_conditions.csv b/ext/standard/tests/file/fgetcsv_error_conditions.csv new file mode 100644 index 0000000000..7bcd2a6a9c --- /dev/null +++ b/ext/standard/tests/file/fgetcsv_error_conditions.csv @@ -0,0 +1,2 @@ +"water",fruit +This is line of text without csv fields
\ No newline at end of file diff --git a/ext/standard/tests/file/fgetcsv_error_conditions.phpt b/ext/standard/tests/file/fgetcsv_error_conditions.phpt new file mode 100644 index 0000000000..684ef7258a --- /dev/null +++ b/ext/standard/tests/file/fgetcsv_error_conditions.phpt @@ -0,0 +1,61 @@ +--TEST-- +Various fgetcsv() error conditions +--FILE-- +<?php + +$file_name = __DIR__ . '/fgetcsv_error_conditions.csv'; +$file_handle = fopen($file_name, 'r'); + +$length = 1024; +$delimiter = ','; +$enclosure = '"'; + +echo 'fgetcsv() with negative length' . \PHP_EOL; +try { + var_dump( fgetcsv($file_handle, -10) ); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} +try { + var_dump( fgetcsv($file_handle, -10, $delimiter) ); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} +try { + var_dump( fgetcsv($file_handle, -10, $delimiter, $enclosure) ); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} + +echo 'fgetcsv() with delimiter as NULL' . \PHP_EOL; +try { + var_dump( fgetcsv($file_handle, $length, NULL, $enclosure) ); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} + +echo 'fgetcsv() with enclosure as NULL' . \PHP_EOL; +try { + var_dump( fgetcsv($file_handle, $length, $delimiter, NULL) ); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} + +echo 'fgetcsv() with delimiter & enclosure as NULL' . \PHP_EOL; +try { + var_dump( fgetcsv($file_handle, $length, NULL, NULL) ); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} +?> +--EXPECT-- +fgetcsv() with negative length +fgetcsv(): Argument #2 ($length) must be a greater than or equal to 0 +fgetcsv(): Argument #2 ($length) must be a greater than or equal to 0 +fgetcsv(): Argument #2 ($length) must be a greater than or equal to 0 +fgetcsv() with delimiter as NULL +fgetcsv(): Argument #3 ($delimiter) must be a single character +fgetcsv() with enclosure as NULL +fgetcsv(): Argument #4 ($enclosure) must be a single character +fgetcsv() with delimiter & enclosure as NULL +fgetcsv(): Argument #3 ($delimiter) must be a single character diff --git a/ext/standard/tests/file/fgetcsv_variation1.phpt b/ext/standard/tests/file/fgetcsv_variation1.phpt index e0569288fc..04936b8c81 100644 --- a/ext/standard/tests/file/fgetcsv_variation1.phpt +++ b/ext/standard/tests/file/fgetcsv_variation1.phpt @@ -3,7 +3,6 @@ Test fgetcsv() : usage variations - with all parameters specified --FILE-- <?php /* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); Description: Gets line from file pointer and parse for CSV fields */ diff --git a/ext/standard/tests/file/fgetcsv_variation10.phpt b/ext/standard/tests/file/fgetcsv_variation10.phpt index ee173b8cd6..7582892465 100644 --- a/ext/standard/tests/file/fgetcsv_variation10.phpt +++ b/ext/standard/tests/file/fgetcsv_variation10.phpt @@ -2,11 +2,6 @@ Test fgetcsv() : usage variations - file pointer pointing to EOF --FILE-- <?php -/* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - /* Testing fgetcsv() by reading from a file when the file pointer is pointing to end of file */ echo "*** Testing fgetcsv() : with file pointer pointing to EOF ***\n"; diff --git a/ext/standard/tests/file/fgetcsv_variation11.phpt b/ext/standard/tests/file/fgetcsv_variation11.phpt index 25815a0174..30b1feb3bf 100644 --- a/ext/standard/tests/file/fgetcsv_variation11.phpt +++ b/ext/standard/tests/file/fgetcsv_variation11.phpt @@ -2,11 +2,6 @@ Test fgetcsv() : usage variations - with different enclosure but same delimiter --FILE-- <?php -/* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - /* Testing fgetcsv() by reading from a file when different enclosure that is not present in the data being read and delimiter which is present in the data */ diff --git a/ext/standard/tests/file/fgetcsv_variation12.phpt b/ext/standard/tests/file/fgetcsv_variation12.phpt index 4989f5f8e7..f1dfc52a27 100644 --- a/ext/standard/tests/file/fgetcsv_variation12.phpt +++ b/ext/standard/tests/file/fgetcsv_variation12.phpt @@ -2,11 +2,6 @@ Test fgetcsv() : usage variations - two chars as enclosure & delimiter (various read and append modes) --FILE-- <?php -/* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - /* Testing fgetcsv() by providing two characters for enclosure and delimiter parameters */ echo "*** Testing fgetcsv() : with two chars as enclosure & delimiter ***\n"; diff --git a/ext/standard/tests/file/fgetcsv_variation13.phpt b/ext/standard/tests/file/fgetcsv_variation13.phpt index f1ca0a6ab0..bfc81bbb22 100644 --- a/ext/standard/tests/file/fgetcsv_variation13.phpt +++ b/ext/standard/tests/file/fgetcsv_variation13.phpt @@ -2,11 +2,6 @@ Test fgetcsv() : usage variations - with line without any csv fields --FILE-- <?php -/* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - /* Testing fgetcsv() to read a line from a file which doesn't have any CSV field */ echo "*** Testing fgetcsv() : reading the line which is without csv fields ***\n"; diff --git a/ext/standard/tests/file/fgetcsv_variation14.phpt b/ext/standard/tests/file/fgetcsv_variation14.phpt index a8486e56a8..a87be1e01f 100644 --- a/ext/standard/tests/file/fgetcsv_variation14.phpt +++ b/ext/standard/tests/file/fgetcsv_variation14.phpt @@ -2,11 +2,6 @@ Test fgetcsv() : usage variations - reading the blank line --FILE-- <?php -/* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - /* Testing fgetcsv() by reading a file containing a blank line */ echo "*** Testing fgetcsv() : reading the blank line ***\n"; diff --git a/ext/standard/tests/file/fgetcsv_variation15.phpt b/ext/standard/tests/file/fgetcsv_variation15.phpt index 6e1c71438b..7400d5bd1a 100644 --- a/ext/standard/tests/file/fgetcsv_variation15.phpt +++ b/ext/standard/tests/file/fgetcsv_variation15.phpt @@ -2,11 +2,6 @@ Test fgetcsv() : usage variations - with default enclosure --FILE-- <?php -/* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - /* Testing fgetcsv() to read a file when provided with default enclosure character */ echo "*** Testing fgetcsv() : with default enclosure ***\n"; diff --git a/ext/standard/tests/file/fgetcsv_variation16.phpt b/ext/standard/tests/file/fgetcsv_variation16.phpt index 3e83ca46bb..0c5981ff6c 100644 --- a/ext/standard/tests/file/fgetcsv_variation16.phpt +++ b/ext/standard/tests/file/fgetcsv_variation16.phpt @@ -2,11 +2,6 @@ Test fgetcsv() : usage variations - with default enclosure & length as 0 --FILE-- <?php -/* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - /* Testing fgetcsv() to read a file when provided with default enclosure character and length value equal to zero */ diff --git a/ext/standard/tests/file/fgetcsv_variation17.phpt b/ext/standard/tests/file/fgetcsv_variation17.phpt index 1dffb6c2be..0010b87b6f 100644 --- a/ext/standard/tests/file/fgetcsv_variation17.phpt +++ b/ext/standard/tests/file/fgetcsv_variation17.phpt @@ -2,11 +2,6 @@ Test fgetcsv() : usage variations - with default enclosure & length less than line size --FILE-- <?php -/* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - /* Testing fgetcsv() to read a file when provided with default enclosure character and length value less than the size of line being read */ diff --git a/ext/standard/tests/file/fgetcsv_variation18.phpt b/ext/standard/tests/file/fgetcsv_variation18.phpt index 022a46075d..b991afda4e 100644 --- a/ext/standard/tests/file/fgetcsv_variation18.phpt +++ b/ext/standard/tests/file/fgetcsv_variation18.phpt @@ -3,7 +3,6 @@ Test fgetcsv() : usage variations - with default enclosure and different delimit --FILE-- <?php /* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); Description: Gets line from file pointer and parse for CSV fields */ diff --git a/ext/standard/tests/file/fgetcsv_variation19.phpt b/ext/standard/tests/file/fgetcsv_variation19.phpt index 0f40f25266..dd5aa73567 100644 --- a/ext/standard/tests/file/fgetcsv_variation19.phpt +++ b/ext/standard/tests/file/fgetcsv_variation19.phpt @@ -3,11 +3,6 @@ Test fgetcsv() : usage variations - with default enclosure & delimiter of two ch --FILE-- <?php /* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - -/* Testing fgetcsv() to read a file when provided with default enclosure character and with delimiter of two characters */ diff --git a/ext/standard/tests/file/fgetcsv_variation2.phpt b/ext/standard/tests/file/fgetcsv_variation2.phpt index f235186d3a..2f88dcad60 100644 --- a/ext/standard/tests/file/fgetcsv_variation2.phpt +++ b/ext/standard/tests/file/fgetcsv_variation2.phpt @@ -2,11 +2,6 @@ Test fgetcsv() : usage variations - with length as 0 --FILE-- <?php -/* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - /* Testing fgetcsv() to rwad from a file with length argument equal to zero */ echo "*** Testing fgetcsv() : with length as 0 ***\n"; diff --git a/ext/standard/tests/file/fgetcsv_variation20.phpt b/ext/standard/tests/file/fgetcsv_variation20.phpt index dce4c82c59..a3c04992db 100644 --- a/ext/standard/tests/file/fgetcsv_variation20.phpt +++ b/ext/standard/tests/file/fgetcsv_variation20.phpt @@ -3,11 +3,6 @@ Test fgetcsv() : usage variations - with default enclosure, line without any csv --FILE-- <?php /* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - -/* Testing fgetcsv() to read a line without any csv fields from a file when provided with default enclosure value */ diff --git a/ext/standard/tests/file/fgetcsv_variation21.phpt b/ext/standard/tests/file/fgetcsv_variation21.phpt index 91503ff487..d47a143d4c 100644 --- a/ext/standard/tests/file/fgetcsv_variation21.phpt +++ b/ext/standard/tests/file/fgetcsv_variation21.phpt @@ -3,11 +3,6 @@ Test fgetcsv() : usage variations - with default enclosure, blank line --FILE-- <?php /* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - -/* Testing fgetcsv() to read a file containing blank line when provided with default enclosure argument */ diff --git a/ext/standard/tests/file/fgetcsv_variation22.phpt b/ext/standard/tests/file/fgetcsv_variation22.phpt index 14d808ab87..ba927e0190 100644 --- a/ext/standard/tests/file/fgetcsv_variation22.phpt +++ b/ext/standard/tests/file/fgetcsv_variation22.phpt @@ -3,11 +3,6 @@ Test fgetcsv() : usage variations - with default enclosure, file pointer pointin --FILE-- <?php /* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - -/* Testing fgetcsv() to read a file whose file pointer is pointing to end of file and fgetcsv() provided with default enclosure argument */ diff --git a/ext/standard/tests/file/fgetcsv_variation23.phpt b/ext/standard/tests/file/fgetcsv_variation23.phpt index cb74351fb9..e933ae5449 100644 --- a/ext/standard/tests/file/fgetcsv_variation23.phpt +++ b/ext/standard/tests/file/fgetcsv_variation23.phpt @@ -2,11 +2,6 @@ Test fgetcsv() : usage variations - empty file --FILE-- <?php -/* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - /* Testing fgetcsv() to read from an empty file */ echo "*** Testing fgetcsv() : reading from file which is having zero content ***\n"; diff --git a/ext/standard/tests/file/fgetcsv_variation24.phpt b/ext/standard/tests/file/fgetcsv_variation24.phpt index d1e8b7ca80..f99ccd62d8 100644 --- a/ext/standard/tests/file/fgetcsv_variation24.phpt +++ b/ext/standard/tests/file/fgetcsv_variation24.phpt @@ -3,11 +3,6 @@ Test fgetcsv() : usage variations - two chars as enclosure & delimiter (various --FILE-- <?php /* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - -/* Testing fgetcsv() to read from a file opened in various write modes and enclosure argument with two characters */ diff --git a/ext/standard/tests/file/fgetcsv_variation25.phpt b/ext/standard/tests/file/fgetcsv_variation25.phpt deleted file mode 100644 index 073248c101..0000000000 --- a/ext/standard/tests/file/fgetcsv_variation25.phpt +++ /dev/null @@ -1,935 +0,0 @@ ---TEST-- -Test fgetcsv() : usage variations - with negative length value along with enclosure and delimiter ---FILE-- -<?php -/* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - -/* - Testing fgetcsv() to read from a file when provided with negative length argument - along with delimiter and enclosure arguments -*/ - -echo "*** Testing fgetcsv() : with negative length value ***\n"; - -/* the array is with three elements in it. Each element should be read as - 1st element is delimiter, 2nd element is enclosure - and 3rd element is csv fields -*/ -$csv_lists = array ( - array(',', '"', '"water",fruit'), - array(',', '"', '"water","fruit"'), - array(' ', '^', '^water^ ^fruit^'), - array(':', '&', '&water&:&fruit&'), - array('=', '=', '=water===fruit='), - array('-', '-', '-water--fruit-air'), - array('-', '-', '-water---fruit---air-'), - array(':', '&', '&""""&:&"&:,:":&,&:,,,,') -); - -$filename = __DIR__ . '/fgetcsv_variation25.tmp'; -@unlink($filename); - -$file_modes = array ("r","rb", "rt", "r+", "r+b", "r+t", - "a+", "a+b", "a+t", - "w+", "w+b", "w+t", - "x+", "x+b", "x+t"); - -$loop_counter = 1; -foreach ($csv_lists as $csv_list) { - for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - // create the file and add the content with has csv fields - if ( strstr($file_modes[$mode_counter], "r") ) { - $file_handle = fopen($filename, "w"); - } else { - $file_handle = fopen($filename, $file_modes[$mode_counter] ); - } - if ( !$file_handle ) { - echo "Error: failed to create file $filename!\n"; - exit(); - } - $delimiter = $csv_list[0]; - $enclosure = $csv_list[1]; - $csv_field = $csv_list[2]; - - fwrite($file_handle, $csv_field . "\n"); - // write another line of text and a blank line - // this will be used to test, if the fgetcsv() read more than a line and its - // working when only a blank line is read - fwrite($file_handle, "This is line of text without csv fields\n"); - fwrite($file_handle, "\n"); // blank line - - // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to beginning of the file - if ( strstr($file_modes[$mode_counter], "r" ) ) { - fclose($file_handle); - $file_handle = fopen($filename, $file_modes[$mode_counter]); - } else { - // rewind the file pointer to bof - rewind($file_handle); - } - - echo "\n-- Testing fgetcsv() with file opened using $file_modes[$mode_counter] mode --\n"; - - // call fgetcsv() to parse csv fields - - // use the right delimiter and enclosure with negative length - var_dump( fgetcsv($file_handle, -10, $delimiter, $enclosure) ); - // check the file pointer position and if eof - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - // close the file - fclose($file_handle); - //delete file - unlink($filename); - } //end of mode loop -} // end of foreach - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing fgetcsv() : with negative length value *** - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) -Done diff --git a/ext/standard/tests/file/fgetcsv_variation26.phpt b/ext/standard/tests/file/fgetcsv_variation26.phpt deleted file mode 100644 index 289972acb3..0000000000 --- a/ext/standard/tests/file/fgetcsv_variation26.phpt +++ /dev/null @@ -1,585 +0,0 @@ ---TEST-- -Test fgetcsv() : usage variations - reading files opened in write only mode (Bug #42036) ---FILE-- -<?php -/* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - -/* Testing fgetcsv() to read from files opened in write only mode */ - -echo "*** Testing fgetcsv() : reading the files opened in write only mode ***\n"; - -/* the array is with three elements in it. Each element should be read as - 1st element is delimiter, 2nd element is enclosure - and 3rd element is csv fields -*/ -$csv_lists = array ( - array(',', '"', '"water",fruit'), - array(',', '"', '"water","fruit"'), - array(' ', '^', '^water^ ^fruit^'), - array(':', '&', '&water&:&fruit&'), - array('=', '=', '=water===fruit='), - array('-', '-', '-water--fruit-air'), - array('-', '-', '-water---fruit---air-'), - array(':', '&', '&""""&:&"&:,:":&,&:,,,,') -); - -$filename = __DIR__ . '/fgetcsv_variation26.tmp'; -@unlink($filename); - -$file_modes = array ("w", "wb", "wt", - "a", "ab", "at", - "x", "xb", "xt"); - -$loop_counter = 1; -foreach ($csv_lists as $csv_list) { - for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - // create the file and add the content with has csv fields - $file_handle = fopen($filename, $file_modes[$mode_counter] ); - - if ( !$file_handle ) { - echo "Error: failed to create file $filename!\n"; - exit(); - } - $delimiter = $csv_list[0]; - $enclosure = $csv_list[1]; - $csv_field = $csv_list[2]; - - fwrite($file_handle, $csv_field . "\n"); - // write another line of text and a blank line - // this will be used to test, if the fgetcsv() read more than a line and its - // working when only a blank line is read - fwrite($file_handle, "This is line of text without csv fields\n"); - fwrite($file_handle, "\n"); // blank line - - // rewind the file pointer to bof - rewind($file_handle); - - echo "\n-- Testing fgetcsv() with file opened using $file_modes[$mode_counter] mode --\n"; - - // call fgetcsv() to parse csv fields - - // use the right delimiter and enclosure with max length - var_dump( fgetcsv($file_handle, 1024, $delimiter, $enclosure) ); - // check the file pointer position and if eof - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - // close the file - fclose($file_handle); - //delete file - unlink($filename); - } //end of mode loop -} // end of foreach - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing fgetcsv() : reading the files opened in write only mode *** - --- Testing fgetcsv() with file opened using w mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using wb mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using wt mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using ab mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using at mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using xb mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using xt mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using wb mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using wt mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using ab mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using at mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using xb mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using xt mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using wb mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using wt mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using ab mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using at mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using xb mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using xt mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using wb mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using wt mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using ab mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using at mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using xb mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using xt mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using wb mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using wt mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using ab mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using at mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using xb mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using xt mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using wb mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using wt mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using ab mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using at mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using xb mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using xt mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using wb mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using wt mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using ab mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using at mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using xb mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using xt mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using wb mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using wt mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using ab mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using at mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using xb mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using xt mode -- - -Notice: fgetcsv(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -Done diff --git a/ext/standard/tests/file/fgetcsv_variation27.phpt b/ext/standard/tests/file/fgetcsv_variation27.phpt deleted file mode 100644 index 484ac89472..0000000000 --- a/ext/standard/tests/file/fgetcsv_variation27.phpt +++ /dev/null @@ -1,935 +0,0 @@ ---TEST-- -Test fgetcsv() : usage variations - with negative length value along with delimiter and no enclosure ---FILE-- -<?php -/* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - -/* - Testing fgetcsv() to read from a file when provided with negative length argument - along with delimiter and no enclosure arguments -*/ - -echo "*** Testing fgetcsv() : with negative length value ***\n"; - -/* the array is with three elements in it. Each element should be read as - 1st element is delimiter, 2nd element is enclosure - and 3rd element is csv fields -*/ -$csv_lists = array ( - array(',', '"', '"water",fruit'), - array(',', '"', '"water","fruit"'), - array(' ', '^', '^water^ ^fruit^'), - array(':', '&', '&water&:&fruit&'), - array('=', '=', '=water===fruit='), - array('-', '-', '-water--fruit-air'), - array('-', '-', '-water---fruit---air-'), - array(':', '&', '&""""&:&"&:,:":&,&:,,,,') -); - -$filename = __DIR__ . '/fgetcsv_variation27.tmp'; -@unlink($filename); - -$file_modes = array ("r","rb", "rt", "r+", "r+b", "r+t", - "a+", "a+b", "a+t", - "w+", "w+b", "w+t", - "x+", "x+b", "x+t"); - -$loop_counter = 1; -foreach ($csv_lists as $csv_list) { - for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - // create the file and add the content with has csv fields - if ( strstr($file_modes[$mode_counter], "r") ) { - $file_handle = fopen($filename, "w"); - } else { - $file_handle = fopen($filename, $file_modes[$mode_counter] ); - } - if ( !$file_handle ) { - echo "Error: failed to create file $filename!\n"; - exit(); - } - $delimiter = $csv_list[0]; - $enclosure = $csv_list[1]; - $csv_field = $csv_list[2]; - - fwrite($file_handle, $csv_field . "\n"); - // write another line of text and a blank line - // this will be used to test, if the fgetcsv() read more than a line and its - // working when only a blank line is read - fwrite($file_handle, "This is line of text without csv fields\n"); - fwrite($file_handle, "\n"); // blank line - - // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to beginning of the file - if ( strstr($file_modes[$mode_counter], "r" ) ) { - fclose($file_handle); - $file_handle = fopen($filename, $file_modes[$mode_counter]); - } else { - // rewind the file pointer to bof - rewind($file_handle); - } - - echo "\n-- Testing fgetcsv() with file opened using $file_modes[$mode_counter] mode --\n"; - - // call fgetcsv() to parse csv fields - - // use the right delimiter and enclosure with negative length - var_dump( fgetcsv($file_handle, -10, $delimiter) ); - // check the file pointer position and if eof - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - // close the file - fclose($file_handle); - //delete file - unlink($filename); - } //end of mode loop -} // end of foreach - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing fgetcsv() : with negative length value *** - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) -Done diff --git a/ext/standard/tests/file/fgetcsv_variation28.phpt b/ext/standard/tests/file/fgetcsv_variation28.phpt deleted file mode 100644 index 95d59dcec4..0000000000 --- a/ext/standard/tests/file/fgetcsv_variation28.phpt +++ /dev/null @@ -1,935 +0,0 @@ ---TEST-- -Test fgetcsv() : usage variations - with negative length value along with neither enclosure and nor delimiter ---FILE-- -<?php -/* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - -/* - Testing fgetcsv() to read from a file when provided with negative length argument - along with neither delimiter nor enclosure argument -*/ - -echo "*** Testing fgetcsv() : with negative length value ***\n"; - -/* the array is with three elements in it. Each element should be read as - 1st element is delimiter, 2nd element is enclosure - and 3rd element is csv fields -*/ -$csv_lists = array ( - array(',', '"', '"water",fruit'), - array(',', '"', '"water","fruit"'), - array(' ', '^', '^water^ ^fruit^'), - array(':', '&', '&water&:&fruit&'), - array('=', '=', '=water===fruit='), - array('-', '-', '-water--fruit-air'), - array('-', '-', '-water---fruit---air-'), - array(':', '&', '&""""&:&"&:,:":&,&:,,,,') -); - -$filename = __DIR__ . '/fgetcsv_variation28.tmp'; -@unlink($filename); - -$file_modes = array ("r","rb", "rt", "r+", "r+b", "r+t", - "a+", "a+b", "a+t", - "w+", "w+b", "w+t", - "x+", "x+b", "x+t"); - -$loop_counter = 1; -foreach ($csv_lists as $csv_list) { - for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - // create the file and add the content with has csv fields - if ( strstr($file_modes[$mode_counter], "r") ) { - $file_handle = fopen($filename, "w"); - } else { - $file_handle = fopen($filename, $file_modes[$mode_counter] ); - } - if ( !$file_handle ) { - echo "Error: failed to create file $filename!\n"; - exit(); - } - $delimiter = $csv_list[0]; - $enclosure = $csv_list[1]; - $csv_field = $csv_list[2]; - - fwrite($file_handle, $csv_field . "\n"); - // write another line of text and a blank line - // this will be used to test, if the fgetcsv() read more than a line and its - // working when only a blank line is read - fwrite($file_handle, "This is line of text without csv fields\n"); - fwrite($file_handle, "\n"); // blank line - - // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to beginning of the file - if ( strstr($file_modes[$mode_counter], "r" ) ) { - fclose($file_handle); - $file_handle = fopen($filename, $file_modes[$mode_counter]); - } else { - // rewind the file pointer to bof - rewind($file_handle); - } - - echo "\n-- Testing fgetcsv() with file opened using $file_modes[$mode_counter] mode --\n"; - - // call fgetcsv() to parse csv fields - - // use the right delimiter and enclosure with negative length - var_dump( fgetcsv($file_handle, -10) ); - // check the file pointer position and if eof - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - // close the file - fclose($file_handle); - //delete file - unlink($filename); - } //end of mode loop -} // end of foreach - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing fgetcsv() : with negative length value *** - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Length parameter may not be negative in %s on line %d -bool(false) -int(0) -bool(false) -Done diff --git a/ext/standard/tests/file/fgetcsv_variation29.phpt b/ext/standard/tests/file/fgetcsv_variation29.phpt index de9d4b0e5d..de39f3eb79 100644 --- a/ext/standard/tests/file/fgetcsv_variation29.phpt +++ b/ext/standard/tests/file/fgetcsv_variation29.phpt @@ -3,11 +3,6 @@ Test fgetcsv() : usage variations - with only file handle as argument, file poin --FILE-- <?php /* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - -/* Testing fgetcsv() to read a file whose file pointer is pointing to end of file and fgetcsv() provided with only file handle in its argument */ diff --git a/ext/standard/tests/file/fgetcsv_variation3.phpt b/ext/standard/tests/file/fgetcsv_variation3.phpt deleted file mode 100644 index e94f81d56d..0000000000 --- a/ext/standard/tests/file/fgetcsv_variation3.phpt +++ /dev/null @@ -1,933 +0,0 @@ ---TEST-- -Test fgetcsv() : usage variations - with delimiter as NULL ---FILE-- -<?php -/* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - -/* Testing fgetcsv() to read from a file when provided with delimiter value as NULL */ - -echo "*** Testing fgetcsv() : with delimiter as NULL ***\n"; - -/* the array is with three elements in it. Each element should be read as - 1st element is delimiter, 2nd element is enclosure - and 3rd element is csv fields -*/ -$csv_lists = array ( - array(',', '"', '"water",fruit'), - array(',', '"', '"water","fruit"'), - array(' ', '^', '^water^ ^fruit^'), - array(':', '&', '&water&:&fruit&'), - array('=', '=', '=water===fruit='), - array('-', '-', '-water--fruit-air'), - array('-', '-', '-water---fruit---air-'), - array(':', '&', '&""""&:&"&:,:":&,&:,,,,') -); - -$filename = __DIR__ . '/fgetcsv_variation3.tmp'; -@unlink($filename); - -$file_modes = array ("r","rb", "rt", "r+", "r+b", "r+t", - "a+", "a+b", "a+t", - "w+", "w+b", "w+t", - "x+", "x+b", "x+t"); - -$loop_counter = 1; -foreach ($csv_lists as $csv_list) { - for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - // create the file and add the content with has csv fields - if ( strstr($file_modes[$mode_counter], "r") ) { - $file_handle = fopen($filename, "w"); - } else { - $file_handle = fopen($filename, $file_modes[$mode_counter] ); - } - if ( !$file_handle ) { - echo "Error: failed to create file $filename!\n"; - exit(); - } - $delimiter = $csv_list[0]; - $enclosure = $csv_list[1]; - $csv_field = $csv_list[2]; - - fwrite($file_handle, $csv_field . "\n"); - // write another line of text and a blank line - // this will be used to test, if the fgetcsv() read more than a line and its - // working when only a blank line is read - fwrite($file_handle, "This is line of text without csv fields\n"); - fwrite($file_handle, "\n"); // blank line - - // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to beginning of the file - if ( strstr($file_modes[$mode_counter], "r" ) ) { - fclose($file_handle); - $file_handle = fopen($filename, $file_modes[$mode_counter]); - } else { - // rewind the file pointer to bof - rewind($file_handle); - } - - echo "\n-- Testing fgetcsv() with file opened using $file_modes[$mode_counter] mode --\n"; - - // call fgetcsv() to parse csv fields - - // use length as 0 - fseek($file_handle, 0, SEEK_SET); - var_dump( fgetcsv($file_handle, 1024, NULL, $enclosure) ); - // check the file pointer position and if eof - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - // close the file - fclose($file_handle); - //delete file - unlink($filename); - } //end of mode loop -} // end of foreach - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing fgetcsv() : with delimiter as NULL *** - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) -Done diff --git a/ext/standard/tests/file/fgetcsv_variation30.phpt b/ext/standard/tests/file/fgetcsv_variation30.phpt index 120267849e..7b3c13e108 100644 --- a/ext/standard/tests/file/fgetcsv_variation30.phpt +++ b/ext/standard/tests/file/fgetcsv_variation30.phpt @@ -3,11 +3,6 @@ Test fgetcsv() : usage variations - with file handle and length, file pointer po --FILE-- <?php /* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - -/* Testing fgetcsv() to read a file whose file pointer is pointing to end of file and fgetcsv() provided with file handle and length arguments */ diff --git a/ext/standard/tests/file/fgetcsv_variation31.phpt b/ext/standard/tests/file/fgetcsv_variation31.phpt index c487d2eb28..8edaa5787f 100644 --- a/ext/standard/tests/file/fgetcsv_variation31.phpt +++ b/ext/standard/tests/file/fgetcsv_variation31.phpt @@ -3,11 +3,6 @@ Test fgetcsv() : usage variations - with length and enclosure, file pointer poin --FILE-- <?php /* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - -/* Testing fgetcsv() to read a file whose file pointer is pointing to end of file and fgetcsv() provided with enclosure argument */ diff --git a/ext/standard/tests/file/fgetcsv_variation32.phpt b/ext/standard/tests/file/fgetcsv_variation32.phpt index eac1046c44..839e51734b 100644 --- a/ext/standard/tests/file/fgetcsv_variation32.phpt +++ b/ext/standard/tests/file/fgetcsv_variation32.phpt @@ -15,7 +15,6 @@ while (($data = fgetcsv($stream, 0, ',', '"', '')) !== false) { } fclose($stream); ?> -===DONE=== --EXPECT-- Array ( @@ -29,4 +28,3 @@ Array [0] => \\\line1 line2\\\ ) -===DONE=== diff --git a/ext/standard/tests/file/fgetcsv_variation4.phpt b/ext/standard/tests/file/fgetcsv_variation4.phpt deleted file mode 100644 index 1f32907b53..0000000000 --- a/ext/standard/tests/file/fgetcsv_variation4.phpt +++ /dev/null @@ -1,932 +0,0 @@ ---TEST-- -Test fgetcsv() : usage variations - with enclosure as NULL ---FILE-- -<?php -/* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - -/* Testing fgetcsv() to read from a file when provided with enclosure value as NULL */ - -echo "*** Testing fgetcsv() : with enclosure as NULL ***\n"; - -/* the array is with three elements in it. Each element should be read as - 1st element is delimiter, 2nd element is enclosure - and 3rd element is csv fields -*/ -$csv_lists = array ( - array(',', '"', '"water",fruit'), - array(',', '"', '"water","fruit"'), - array(' ', '^', '^water^ ^fruit^'), - array(':', '&', '&water&:&fruit&'), - array('=', '=', '=water===fruit='), - array('-', '-', '-water--fruit-air'), - array('-', '-', '-water---fruit---air-'), - array(':', '&', '&""""&:&"&:,:":&,&:,,,,') -); - -$filename = __DIR__ . '/fgetcsv_variation4.tmp'; -@unlink($filename); - -$file_modes = array ("r","rb", "rt", "r+", "r+b", "r+t", - "a+", "a+b", "a+t", - "w+", "w+b", "w+t", - "x+", "x+b", "x+t"); - -$loop_counter = 1; -foreach ($csv_lists as $csv_list) { - for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - // create the file and add the content with has csv fields - if ( strstr($file_modes[$mode_counter], "r") ) { - $file_handle = fopen($filename, "w"); - } else { - $file_handle = fopen($filename, $file_modes[$mode_counter] ); - } - if ( !$file_handle ) { - echo "Error: failed to create file $filename!\n"; - exit(); - } - $delimiter = $csv_list[0]; - $enclosure = $csv_list[1]; - $csv_field = $csv_list[2]; - fwrite($file_handle, $csv_field . "\n"); - // write another line of text and a blank line - // this will be used to test, if the fgetcsv() read more than a line and its - // working when only a blan line is read - fwrite($file_handle, "This is line of text without csv fields\n"); - fwrite($file_handle, "\n"); // blank line - - // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to beginning of the file - if ( strstr($file_modes[$mode_counter], "r" ) ) { - fclose($file_handle); - $file_handle = fopen($filename, $file_modes[$mode_counter]); - } else { - // rewind the file pointer to bof - rewind($file_handle); - } - - echo "\n-- Testing fgetcsv() with file opened using $file_modes[$mode_counter] mode --\n"; - - // call fgetcsv() to parse csv fields - - // use length as 0 - fseek($file_handle, 0, SEEK_SET); - var_dump( fgetcsv($file_handle, 0, $delimiter, NULL) ); - // check the file pointer position and if eof - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - // close the file - fclose($file_handle); - //delete file - unlink($filename); - } //end of mode loop -} // end of foreach - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing fgetcsv() : with enclosure as NULL *** - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): enclosure must be a character in %s on line %d -bool(false) -int(0) -bool(false) -Done diff --git a/ext/standard/tests/file/fgetcsv_variation5.phpt b/ext/standard/tests/file/fgetcsv_variation5.phpt deleted file mode 100644 index 4c883abf69..0000000000 --- a/ext/standard/tests/file/fgetcsv_variation5.phpt +++ /dev/null @@ -1,934 +0,0 @@ ---TEST-- -Test fgetcsv() : usage variations - with delimiter & enclosure as NULL ---FILE-- -<?php -/* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - -/* - Testing fgetcsv() to read from a file when provided with delimiter and - enclosure values both as NULL - */ - -echo "*** Testing fgetcsv() : with delimiter & enclosure as NULL ***\n"; - -/* the array is with three elements in it. Each element should be read as - 1st element is delimiter, 2nd element is enclosure - and 3rd element is csv fields -*/ -$csv_lists = array ( - array(',', '"', '"water",fruit'), - array(',', '"', '"water","fruit"'), - array(' ', '^', '^water^ ^fruit^'), - array(':', '&', '&water&:&fruit&'), - array('=', '=', '=water===fruit='), - array('-', '-', '-water--fruit-air'), - array('-', '-', '-water---fruit---air-'), - array(':', '&', '&""""&:&"&:,:":&,&:,,,,') -); - -$filename = __DIR__ . '/fgetcsv_variation5.tmp'; -@unlink($filename); - -$file_modes = array ("r","rb", "rt", "r+", "r+b", "r+t", - "a+", "a+b", "a+t", - "w+", "w+b", "w+t", - "x+", "x+b", "x+t"); - -$loop_counter = 1; -foreach ($csv_lists as $csv_list) { - for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - // create the file and add the content with has csv fields - if ( strstr($file_modes[$mode_counter], "r") ) { - $file_handle = fopen($filename, "w"); - } else { - $file_handle = fopen($filename, $file_modes[$mode_counter] ); - } - if ( !$file_handle ) { - echo "Error: failed to create file $filename!\n"; - exit(); - } - $delimiter = $csv_list[0]; - $enclosure = $csv_list[1]; - $csv_field = $csv_list[2]; - fwrite($file_handle, $csv_field . "\n"); - // write another line of text and a blank line - // this will be used to test, if the fgetcsv() read more than a line and its - // working when only a blank line is read - fwrite($file_handle, "This is line of text without csv fields\n"); - fwrite($file_handle, "\n"); // blank line - - // close the file if the mode to be used is read mode and re-open using read mode - // else rewind the file pointer to beginning of the file - if ( strstr($file_modes[$mode_counter], "r" ) ) { - fclose($file_handle); - $file_handle = fopen($filename, $file_modes[$mode_counter]); - } else { - // rewind the file pointer to bof - rewind($file_handle); - } - - echo "\n-- Testing fgetcsv() with file opened using $file_modes[$mode_counter] mode --\n"; - - // call fgetcsv() to parse csv fields - - fseek($file_handle, 0, SEEK_SET); - var_dump( fgetcsv($file_handle, 1024, NULL, NULL) ); - // check the file pointer position and if eof - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - // close the file - fclose($file_handle); - //delete file - unlink($filename); - } //end of mode loop -} // end of foreach - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing fgetcsv() : with delimiter & enclosure as NULL *** - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): delimiter must be a character in %s on line %d -bool(false) -int(0) -bool(false) -Done diff --git a/ext/standard/tests/file/fgetcsv_variation6.phpt b/ext/standard/tests/file/fgetcsv_variation6.phpt index 23bbfffcf8..bd1442155d 100644 --- a/ext/standard/tests/file/fgetcsv_variation6.phpt +++ b/ext/standard/tests/file/fgetcsv_variation6.phpt @@ -3,11 +3,6 @@ Test fgetcsv() : usage variations - with length less than line size --FILE-- <?php /* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - -/* Testing fgetcsv() to read from a file when provided with the length argument value less than the line size */ diff --git a/ext/standard/tests/file/fgetcsv_variation7.phpt b/ext/standard/tests/file/fgetcsv_variation7.phpt index b351757c91..0d5c6dc113 100644 --- a/ext/standard/tests/file/fgetcsv_variation7.phpt +++ b/ext/standard/tests/file/fgetcsv_variation7.phpt @@ -3,7 +3,6 @@ Test fgetcsv() : usage variations - with default arguments value --FILE-- <?php /* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); Description: Gets line from file pointer and parse for CSV fields */ diff --git a/ext/standard/tests/file/fgetcsv_variation8.phpt b/ext/standard/tests/file/fgetcsv_variation8.phpt index 073a44e4cc..7978e82e31 100644 --- a/ext/standard/tests/file/fgetcsv_variation8.phpt +++ b/ext/standard/tests/file/fgetcsv_variation8.phpt @@ -3,11 +3,6 @@ Test fgetcsv() : usage variations - with different delimiter and enclosure --FILE-- <?php /* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); - Description: Gets line from file pointer and parse for CSV fields -*/ - -/* Testing fgetcsv() to read from a file when provided with values of delimiter and enclosure that are not present in the line read by fgetcsv() */ diff --git a/ext/standard/tests/file/fgetcsv_variation9.phpt b/ext/standard/tests/file/fgetcsv_variation9.phpt index 859d0ef002..b1f14db1c8 100644 --- a/ext/standard/tests/file/fgetcsv_variation9.phpt +++ b/ext/standard/tests/file/fgetcsv_variation9.phpt @@ -3,7 +3,6 @@ Test fgetcsv() : usage variations - with different delimiter but same enclosure --FILE-- <?php /* - Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); Description: Gets line from file pointer and parse for CSV fields */ diff --git a/ext/standard/tests/file/fgets_basic.phpt b/ext/standard/tests/file/fgets_basic.phpt index 9b2cd715cc..4cf2f8250e 100644 --- a/ext/standard/tests/file/fgets_basic.phpt +++ b/ext/standard/tests/file/fgets_basic.phpt @@ -2,12 +2,7 @@ Test fgets() function : basic functionality --FILE-- <?php -/* - Prototype: string fgets ( resource $handle [, int $length] ); - Description: Gets a line from file pointer -*/ - -// include the file.inc for common test funcitons +// include the file.inc for common test functions include ("file.inc"); $file_modes = array("r", "rb", "rt", "r+", "r+b", "r+t"); @@ -31,13 +26,13 @@ foreach($file_modes as $file_mode) { echo "-- fgets() with default length, file pointer at 0 --\n"; var_dump( fgets($file_handle) ); // with default length var_dump( ftell($file_handle) ); // ensure the file pointer position - var_dump( feof($file_handle) ); // enusre if eof set + var_dump( feof($file_handle) ); // ensure if eof set echo "-- fgets() with length = 23, Expected: 22 chars, file pointer at 0 --\n"; var_dump( rewind($file_handle) ); var_dump( fgets($file_handle, 23) ); // expected: 22 chars var_dump( ftell($file_handle) ); // ensure the file pointer position - var_dump( feof($file_handle) ); // enusre if eof set + var_dump( feof($file_handle) ); // ensure if eof set //close file fclose($file_handle); diff --git a/ext/standard/tests/file/fgets_error.phpt b/ext/standard/tests/file/fgets_error.phpt index 919343aa87..fefbd723bc 100644 --- a/ext/standard/tests/file/fgets_error.phpt +++ b/ext/standard/tests/file/fgets_error.phpt @@ -2,106 +2,32 @@ Test fgets() function : error conditions --FILE-- <?php -/* - Prototype: string fgets ( resource $handle [, int $length] ); - Description: Gets line from file pointer -*/ - echo "*** Testing error conditions ***\n"; -// zero argument -echo "-- Testing fgets() with zero argument --\n"; -var_dump( fgets() ); -// more than expected no. of args -echo "-- Testing fgets() with more than expected number of arguments --\n"; $fp = fopen(__FILE__, "r"); -var_dump( fgets($fp, 10, $fp) ); // invalid length argument echo "-- Testing fgets() with invalid length arguments --\n"; $len = 0; -var_dump( fgets($fp, $len) ); +try { + var_dump( fgets($fp, $len) ); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} + $len = -10; -var_dump( fgets($fp, $len) ); +try { + var_dump( fgets($fp, $len) ); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} $len = 1; var_dump( fgets($fp, $len) ); // return length - 1 always, expect false - -// test invalid arguments : non-resources -echo "-- Testing fgets() with invalid arguments --\n"; -$invalid_args = array ( - "string", - 10, - 10.5, - true, - array(1,2,3), - new stdclass, -); -/* loop to test fgets() with different invalid type of args */ -for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++) { - echo "-- Iteration $loop_counter --\n"; - var_dump( fgets($invalid_args[$loop_counter - 1], 10) ); -} - -// fgets() on a file handle which is already closed -echo "-- Testing fgets() with closed/unset file handle --"; -fclose($fp); -var_dump(fgets($fp,10)); - -// fgets() on a file handle which is unset -$file_handle = fopen(__FILE__, "r"); -unset($file_handle); //unset file handle -var_dump( fgets(@$file_handle,10)); - -echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing error conditions *** --- Testing fgets() with zero argument -- - -Warning: fgets() expects at least 1 parameter, 0 given in %s on line %d -bool(false) --- Testing fgets() with more than expected number of arguments -- - -Warning: fgets() expects at most 2 parameters, 3 given in %s on line %d -bool(false) -- Testing fgets() with invalid length arguments -- - -Warning: fgets(): Length parameter must be greater than 0 in %s on line %d -bool(false) - -Warning: fgets(): Length parameter must be greater than 0 in %s on line %d -bool(false) -bool(false) --- Testing fgets() with invalid arguments -- --- Iteration 1 -- - -Warning: fgets() expects parameter 1 to be resource, string given in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: fgets() expects parameter 1 to be resource, int given in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: fgets() expects parameter 1 to be resource, float given in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: fgets() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: fgets() expects parameter 1 to be resource, array given in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: fgets() expects parameter 1 to be resource, object given in %s on line %d -bool(false) --- Testing fgets() with closed/unset file handle -- -Warning: fgets(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: fgets() expects parameter 1 to be resource, null given in %s on line %d +fgets(): Argument #2 ($length) must be greater than 0 +fgets(): Argument #2 ($length) must be greater than 0 bool(false) -Done diff --git a/ext/standard/tests/file/fgets_socket_variation1.phpt b/ext/standard/tests/file/fgets_socket_variation1.phpt index 429ad67d69..ac1086ef56 100644 --- a/ext/standard/tests/file/fgets_socket_variation1.phpt +++ b/ext/standard/tests/file/fgets_socket_variation1.phpt @@ -18,7 +18,7 @@ for ($i=0; $i<100; $i++) { $client = fsockopen("tcp://127.0.0.1:$port"); if (!$client) { - die("Unable to create socket"); + die("Unable to create socket"); } /* Accept that connection */ @@ -38,7 +38,7 @@ echo "\n\nClose the server side socket and read the remaining data from the clie fclose($socket); fclose($server); while(!feof($client)) { - fread($client, 1); + fread($client, 1); } echo "done\n"; diff --git a/ext/standard/tests/file/fgets_socket_variation2.phpt b/ext/standard/tests/file/fgets_socket_variation2.phpt index da1f0b47ad..88fbbd45b9 100644 --- a/ext/standard/tests/file/fgets_socket_variation2.phpt +++ b/ext/standard/tests/file/fgets_socket_variation2.phpt @@ -12,7 +12,7 @@ $fd = fopen($filename, "w+"); // populate the file with lines of data define("LINE_OF_DATA", "12345678\n"); for ($i = 0; $i < 1000; $i++) { - fwrite($fd, LINE_OF_DATA); + fwrite($fd, LINE_OF_DATA); } fclose($fd); @@ -29,7 +29,7 @@ for ($i=0; $i<100; $i++) { $client = fsockopen("tcp://127.0.0.1:$port"); if (!$client) { - die("Unable to create socket"); + die("Unable to create socket"); } /* Accept that connection */ @@ -44,16 +44,16 @@ fclose($socket); echo "\nRead lines from the client\n"; while ($line = fgets($client,256)) { - if (strcmp($line, LINE_OF_DATA) != 0) { - echo "Error - $line does not match " . LINE_OF_DATA; - break; - } + if (strcmp($line, LINE_OF_DATA) != 0) { + echo "Error - $line does not match " . LINE_OF_DATA; + break; + } } echo "\nClose the server side socket and read the remaining data from the client\n"; fclose($server); while(!feof($client)) { - fread($client, 1); + fread($client, 1); } echo "done\n"; diff --git a/ext/standard/tests/file/fgets_variation1.phpt b/ext/standard/tests/file/fgets_variation1.phpt index 50856df2e0..0c07c7a76c 100644 --- a/ext/standard/tests/file/fgets_variation1.phpt +++ b/ext/standard/tests/file/fgets_variation1.phpt @@ -2,10 +2,6 @@ Test fgets() function : usage variations - write only modes (Bug #42036) --FILE-- <?php -/* - Prototype: string fgets ( resource $handle [, int $length] ); - Description: Gets a line from file pointer -*/ /* try fgets on files which are opened in non readable modes w, wb, wt, a, ab, at, @@ -55,7 +51,7 @@ bool(true) int(0) bool(false) -Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fgets(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -64,7 +60,7 @@ bool(true) int(0) bool(false) -Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fgets(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -73,7 +69,7 @@ bool(true) int(0) bool(false) -Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fgets(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -82,7 +78,7 @@ bool(true) int(0) bool(false) -Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fgets(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -91,7 +87,7 @@ bool(true) int(0) bool(false) -Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fgets(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -100,7 +96,7 @@ bool(true) int(0) bool(false) -Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fgets(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -109,7 +105,7 @@ bool(true) int(0) bool(false) -Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fgets(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -118,7 +114,7 @@ bool(true) int(0) bool(false) -Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fgets(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -127,7 +123,7 @@ bool(true) int(0) bool(false) -Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fgets(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) diff --git a/ext/standard/tests/file/fgets_variation2.phpt b/ext/standard/tests/file/fgets_variation2.phpt index 0bbcf22039..28cba347d5 100644 --- a/ext/standard/tests/file/fgets_variation2.phpt +++ b/ext/standard/tests/file/fgets_variation2.phpt @@ -2,11 +2,6 @@ Test fgets() function : usage variations - closed handle --FILE-- <?php -/* - Prototype: string fgets ( resource $handle [, int $length] ); - Description: Gets a line from file pointer -*/ - /* try reading a line using fgets() using invalid handles - closed file handle - unset file handle @@ -24,39 +19,22 @@ $file_handle = fopen(__FILE__, "r"); fclose($file_handle); // read from closed file -var_dump( fgets($file_handle) ); // default length -var_dump( fgets($file_handle, 10) ); // with specific length - -echo "-- Testing fgets() with unset handle --\n"; -// open the file for reading -$file_handle = fopen(__FILE__, "r"); -// unset the file handle -unset($file_handle); - -//fgets using unset handle -var_dump( fgets($file_handle) ); // default length -var_dump( fgets($file_handle, 10) ); // with specific length +try { + var_dump( fgets($file_handle) ); // default length +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump( fgets($file_handle, 10) ); // with specific length +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fgets() : usage variations *** -- Testing fgets() with closed handle -- - -Warning: fgets(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: fgets(): supplied resource is not a valid stream resource in %s on line %d -bool(false) --- Testing fgets() with unset handle -- - -Notice: Undefined variable: file_handle in %s on line %d - -Warning: fgets() expects parameter 1 to be resource, null given in %s on line %d -bool(false) - -Notice: Undefined variable: file_handle in %s on line %d - -Warning: fgets() expects parameter 1 to be resource, null given in %s on line %d -bool(false) +fgets(): supplied resource is not a valid stream resource +fgets(): supplied resource is not a valid stream resource Done diff --git a/ext/standard/tests/file/fgets_variation3.phpt b/ext/standard/tests/file/fgets_variation3.phpt index ee3f8996ab..b7061732c0 100644 --- a/ext/standard/tests/file/fgets_variation3.phpt +++ b/ext/standard/tests/file/fgets_variation3.phpt @@ -2,12 +2,7 @@ Test fgets() function : usage variations - read with/without length --FILE-- <?php -/* - Prototype: string fgets ( resource $handle [, int $length] ); - Description: Gets a line from file pointer -*/ - -// include the file.inc for common test funcitons +// include the file.inc for common test functions include ("file.inc"); $file_modes = array("w+", "w+b", "w+t", @@ -42,7 +37,7 @@ foreach($file_modes as $file_mode) { var_dump( ftell($file_handle) ); var_dump( fgets($file_handle) ); // with default length var_dump( ftell($file_handle) ); // ensure the file pointer position - var_dump( feof($file_handle) ); // enusre if eof set + var_dump( feof($file_handle) ); // ensure if eof set echo "-- fgets() with length = 23, Expected: 22 chars, file pointer at 0 --\n"; // get the file pointer to beginning of the file @@ -51,7 +46,7 @@ foreach($file_modes as $file_mode) { var_dump( ftell($file_handle) ); var_dump( fgets($file_handle, 23) ); // expected: 22 chars var_dump( ftell($file_handle) ); // ensure the file pointer position - var_dump( feof($file_handle) ); // enusre if eof set + var_dump( feof($file_handle) ); // ensure if eof set //close file fclose($file_handle); diff --git a/ext/standard/tests/file/fgets_variation4-win32-mb.phpt b/ext/standard/tests/file/fgets_variation4-win32-mb.phpt index 629af64ad1..e572c3a25f 100644 --- a/ext/standard/tests/file/fgets_variation4-win32-mb.phpt +++ b/ext/standard/tests/file/fgets_variation4-win32-mb.phpt @@ -8,12 +8,7 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* - Prototype: string fgets ( resource $handle [, int $length] ); - Description: Gets a line from file pointer -*/ - -// include the file.inc for common test funcitons +// include the file.inc for common test functions include ("file.inc"); $file_modes = array("w+", "w+b", "w+t", @@ -46,14 +41,14 @@ foreach($file_modes as $file_mode) { var_dump( ftell($file_handle) ); var_dump( fgets($file_handle ) ); var_dump( ftell($file_handle) ); // ensure the file pointer position - var_dump( feof($file_handle) ); // enusre if eof set + var_dump( feof($file_handle) ); // ensure if eof set echo "-- fgets() with location set by fseek() with length = 20 --\n"; var_dump( fseek($file_handle, 25, SEEK_SET) ); var_dump( ftell($file_handle) ); var_dump( fgets($file_handle, 20 ) ); // expected 19 chars var_dump( ftell($file_handle) ); // ensure the file pointer position - var_dump( feof($file_handle) ); // enusre if eof set + var_dump( feof($file_handle) ); // ensure if eof set //close file fclose($file_handle); diff --git a/ext/standard/tests/file/fgets_variation4-win32.phpt b/ext/standard/tests/file/fgets_variation4-win32.phpt index ed8378d357..a617759738 100644 --- a/ext/standard/tests/file/fgets_variation4-win32.phpt +++ b/ext/standard/tests/file/fgets_variation4-win32.phpt @@ -8,12 +8,7 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* - Prototype: string fgets ( resource $handle [, int $length] ); - Description: Gets a line from file pointer -*/ - -// include the file.inc for common test funcitons +// include the file.inc for common test functions include ("file.inc"); $file_modes = array("w+", "w+b", "w+t", @@ -46,14 +41,14 @@ foreach($file_modes as $file_mode) { var_dump( ftell($file_handle) ); var_dump( fgets($file_handle ) ); var_dump( ftell($file_handle) ); // ensure the file pointer position - var_dump( feof($file_handle) ); // enusre if eof set + var_dump( feof($file_handle) ); // ensure if eof set echo "-- fgets() with location set by fseek() with length = 20 --\n"; var_dump( fseek($file_handle, 25, SEEK_SET) ); var_dump( ftell($file_handle) ); var_dump( fgets($file_handle, 20 ) ); // expected 19 chars var_dump( ftell($file_handle) ); // ensure the file pointer position - var_dump( feof($file_handle) ); // enusre if eof set + var_dump( feof($file_handle) ); // ensure if eof set //close file fclose($file_handle); diff --git a/ext/standard/tests/file/fgets_variation4.phpt b/ext/standard/tests/file/fgets_variation4.phpt index cc29e2a620..de3769c323 100644 --- a/ext/standard/tests/file/fgets_variation4.phpt +++ b/ext/standard/tests/file/fgets_variation4.phpt @@ -8,12 +8,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* - Prototype: string fgets ( resource $handle [, int $length] ); - Description: Gets a line from file pointer -*/ - -// include the file.inc for common test funcitons +// include the file.inc for common test functions include ("file.inc"); $file_modes = array("w+", "w+b", "w+t", @@ -46,14 +41,14 @@ foreach($file_modes as $file_mode) { var_dump( ftell($file_handle) ); var_dump( fgets($file_handle ) ); var_dump( ftell($file_handle) ); // ensure the file pointer position - var_dump( feof($file_handle) ); // enusre if eof set + var_dump( feof($file_handle) ); // ensure if eof set echo "-- fgets() with location set by fseek() with length = 20 --\n"; var_dump( fseek($file_handle, 25, SEEK_SET) ); var_dump( ftell($file_handle) ); var_dump( fgets($file_handle, 20 ) ); // expected 19 chars var_dump( ftell($file_handle) ); // ensure the file pointer position - var_dump( feof($file_handle) ); // enusre if eof set + var_dump( feof($file_handle) ); // ensure if eof set //close file fclose($file_handle); diff --git a/ext/standard/tests/file/fgets_variation5.phpt b/ext/standard/tests/file/fgets_variation5.phpt index e0eaa9fe5d..492b919bdc 100644 --- a/ext/standard/tests/file/fgets_variation5.phpt +++ b/ext/standard/tests/file/fgets_variation5.phpt @@ -2,12 +2,7 @@ Test fgets() function : usage variations - read beyond filesize --FILE-- <?php -/* - Prototype: string fgets ( resource $handle [, int $length] ); - Description: Gets a line from file pointer -*/ - -// include the file.inc for common test funcitons +// include the file.inc for common test functions include ("file.inc"); $file_modes = array("w+", "w+b", "w+t", @@ -35,14 +30,14 @@ foreach($file_modes as $file_mode) { exit(); } - /* read with length beyong file size */ + /* read with length beyond file size */ echo "-- fgets() with length > filesize --\n"; rewind($file_handle); var_dump( ftell($file_handle) ); var_dump( fgets($file_handle, 50 + 23) ); // expected: 50 var_dump( ftell($file_handle) ); // ensure the file pointer position - var_dump( feof($file_handle) ); // enusre if eof set + var_dump( feof($file_handle) ); // ensure if eof set //close file fclose($file_handle); diff --git a/ext/standard/tests/file/fgets_variation6-win32.phpt b/ext/standard/tests/file/fgets_variation6-win32.phpt index f736d1ce74..b9bef14549 100644 --- a/ext/standard/tests/file/fgets_variation6-win32.phpt +++ b/ext/standard/tests/file/fgets_variation6-win32.phpt @@ -8,12 +8,7 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* - Prototype: string fgets ( resource $handle [, int $length] ); - Description: Gets a line from file pointer -*/ - -// include the file.inc for common test funcitons +// include the file.inc for common test functions include ("file.inc"); $file_modes = array("w+", "w+b", "w+t", diff --git a/ext/standard/tests/file/fgets_variation6.phpt b/ext/standard/tests/file/fgets_variation6.phpt index 78af58c82d..764e3613af 100644 --- a/ext/standard/tests/file/fgets_variation6.phpt +++ b/ext/standard/tests/file/fgets_variation6.phpt @@ -8,12 +8,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* - Prototype: string fgets ( resource $handle [, int $length] ); - Description: Gets a line from file pointer -*/ - -// include the file.inc for common test funcitons +// include the file.inc for common test functions include ("file.inc"); $file_modes = array("w+", "w+b", "w+t", diff --git a/ext/standard/tests/file/fgetss.phpt b/ext/standard/tests/file/fgetss.phpt deleted file mode 100644 index 7ca6169762..0000000000 --- a/ext/standard/tests/file/fgetss.phpt +++ /dev/null @@ -1,144 +0,0 @@ ---TEST-- -fgetss() tests ---FILE-- -<?php - -$filename = __DIR__."/fgetss.html"; - -$array = array( - "askasdfasdf<b>aaaaaa\n</b>dddddd", - "asdqw<i onClick=\"hello();\">\naaaa<>qqqq", - "aaa<script>function foo() {}</script>qqq", - "asdasd<a\n asdjeje", - "", - "some text \n<b>blah</i>", - "some another text <> hoho </>" - ); - -foreach ($array as $str) { - file_put_contents($filename, $str); - $fp = fopen($filename, "r"); - var_dump(fgetss($fp)); - var_dump(fgetss($fp)); -} - -foreach ($array as $str) { - file_put_contents($filename, $str); - $fp = fopen($filename, "r"); - var_dump(fgetss($fp, 10)); - var_dump(fgetss($fp, 10)); -} - -var_dump(fgetss($fp, -10)); -var_dump(fgetss($fp, 0)); -fclose($fp); -var_dump(fgetss($fp, 0)); - -@unlink($filename); - -echo "Done\n"; -?> ---EXPECTF-- -Deprecated: Function fgetss() is deprecated in %s on line %d -string(18) "askasdfasdfaaaaaa -" - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(6) "dddddd" - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(6) "asdqw -" - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(8) "aaaaqqqq" - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(23) "aaafunction foo() {}qqq" - -Deprecated: Function fgetss() is deprecated in %s on line %d -bool(false) - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(6) "asdasd" - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(0) "" - -Deprecated: Function fgetss() is deprecated in %s on line %d -bool(false) - -Deprecated: Function fgetss() is deprecated in %s on line %d -bool(false) - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(11) "some text -" - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(4) "blah" - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(24) "some another text hoho " - -Deprecated: Function fgetss() is deprecated in %s on line %d -bool(false) - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(9) "askasdfas" - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(6) "dfaaaa" - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(5) "asdqw" - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(0) "" - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(3) "aaa" - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(7) "functio" - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(6) "asdasd" - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(0) "" - -Deprecated: Function fgetss() is deprecated in %s on line %d -bool(false) - -Deprecated: Function fgetss() is deprecated in %s on line %d -bool(false) - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(9) "some text" - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(2) " -" - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(9) "some anot" - -Deprecated: Function fgetss() is deprecated in %s on line %d -string(9) "her text " - -Deprecated: Function fgetss() is deprecated in %s on line %d - -Warning: fgetss(): Length parameter must be greater than 0 in %s on line %d -bool(false) - -Deprecated: Function fgetss() is deprecated in %s on line %d - -Warning: fgetss(): Length parameter must be greater than 0 in %s on line %d -bool(false) - -Deprecated: Function fgetss() is deprecated in %s on line %d - -Warning: fgetss(): supplied resource is not a valid stream resource in %s on line %d -bool(false) -Done diff --git a/ext/standard/tests/file/fgetss1.phpt b/ext/standard/tests/file/fgetss1.phpt deleted file mode 100644 index 55b6adbe6b..0000000000 --- a/ext/standard/tests/file/fgetss1.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -more fgetss() tests ---FILE-- -<?php -error_reporting(E_ALL & ~E_DEPRECATED); - -$filename = __DIR__."/fgetss1.html"; - -$array = array( - "askasdfasdf<b>aaaaaa\n</b>dddddd", - "asdqw<i onClick=\"hello();\">\naaaa<>qqqq", - "aaa<script>function foo() {}</script>qqq", - "asdasd<a\n asdjeje", - "", - "some text \n<b>blah</i>", - "some another text <> hoho </>" - ); - -foreach ($array as $str) { - file_put_contents($filename, $str); - $fp = fopen($filename, "r"); - var_dump(fgetss($fp, 1000, "<i>,<b>,<a>")); - var_dump(fgetss($fp)); -} - -foreach ($array as $str) { - file_put_contents($filename, $str); - $fp = fopen($filename, "r"); - var_dump(fgetss($fp, 10)); - var_dump(fgetss($fp, 10, "<script>,<a>")); -} - -echo "Done\n"; -?> ---CLEAN-- -<?php -$filename = __DIR__."/fgetss1.html"; -unlink($filename); -?> ---EXPECT-- -string(21) "askasdfasdf<b>aaaaaa -" -string(6) "dddddd" -string(28) "asdqw<i onClick="hello();"> -" -string(8) "aaaaqqqq" -string(23) "aaafunction foo() {}qqq" -bool(false) -string(6) "asdasd" -string(0) "" -bool(false) -bool(false) -string(11) "some text -" -string(4) "blah" -string(24) "some another text hoho " -bool(false) -string(9) "askasdfas" -string(6) "dfaaaa" -string(5) "asdqw" -string(0) "" -string(3) "aaa" -string(9) "t>functio" -string(6) "asdasd" -string(0) "" -bool(false) -bool(false) -string(9) "some text" -string(2) " -" -string(9) "some anot" -string(9) "her text " -Done diff --git a/ext/standard/tests/file/fgetss_basic1.phpt b/ext/standard/tests/file/fgetss_basic1.phpt deleted file mode 100644 index 80d1b74f3c..0000000000 --- a/ext/standard/tests/file/fgetss_basic1.phpt +++ /dev/null @@ -1,137 +0,0 @@ ---TEST-- -Test fgetss() function : Basic functionality - read modes only ---FILE-- -<?php -error_reporting(E_ALL & ~E_DEPRECATED); - -/* - Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); - Description: Gets line from file pointer and strip HTML tags -*/ - -/* test fgetss with all read modes */ - -// include the common file related test functions -include ("file.inc"); - -echo "*** Testing fgetss() : Basic operations ***\n"; - -/* string with html and php tags */ -$string_with_tags = <<<EOT -<test>Testing fgetss() functions</test> -<?php echo "this string is within php tag"; ?> {;}<{> this -is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg> -<html> html </html> <?php echo "php"; ?> -EOT; - -if(substr(PHP_OS, 0, 3) == "WIN") { - $string_with_tags = str_replace("\r",'', $string_with_tags); -} -/* try reading the file opened in different modes of reading */ -$file_modes = array("r","rb", "rt","r+", "r+b", "r+t"); - -for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - echo "\n-- Testing fgetss() with file opened using $file_modes[$mode_counter] mode --\n"; - - /* create an empty file and write the strings with tags */ - $filename = __DIR__."/fgetss_basic1.tmp"; - create_file ($filename); //create an empty file - file_put_contents($filename, $string_with_tags); - $file_handle = fopen($filename, $file_modes[$mode_counter]); - if(!$file_handle) { - echo "Error: failed to open file $filename!\n"; - exit(); - } - - rewind($file_handle); - /* read entire file and strip tags */ - echo "-- fgetss() with default length, file pointer at 0 --\n"; - var_dump( fgetss($file_handle) ); // no length and allowable tags provided, reads entire file - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - rewind($file_handle); - /* read entire file and strip tags tags */ - echo "-- fgets() with length = 30, file pointer at 0 --\n"; - var_dump( fgetss($file_handle ,30) ); // length parameter given,not reading entire file - var_dump( ftell($file_handle) ); // checking file pointer position initially - var_dump( feof($file_handle) ); // confirm file pointer is not at eof - - // close the file - fclose($file_handle); - - // delete the file - delete_file($filename); -} // end of for - mode_counter - -echo "Done\n"; -?> ---EXPECT-- -*** Testing fgetss() : Basic operations *** - --- Testing fgetss() with file opened using r mode -- --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using rb mode -- --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using rt mode -- --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using r+ mode -- --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using r+b mode -- --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using r+t mode -- --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) -Done diff --git a/ext/standard/tests/file/fgetss_basic2-win32-mb.phpt b/ext/standard/tests/file/fgetss_basic2-win32-mb.phpt deleted file mode 100644 index 68fd7059d0..0000000000 --- a/ext/standard/tests/file/fgetss_basic2-win32-mb.phpt +++ /dev/null @@ -1,218 +0,0 @@ ---TEST-- -Test fgetss() function : Basic functionality - read/write modes ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die('skip.. only on Windows'); -} -?> ---FILE-- -<?php -error_reporting(E_ALL & ~E_DEPRECATED); - -/* - Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); - Description: Gets line from file pointer and strip HTML tags -*/ - -/* try fgetss on files which are opened in read/write modes - w+, w+b, w+t, - a+, a+b, a+t, - x+, x+b, x+t -*/ - - -echo "*** Testing fgetss() : basic operations ***\n"; - -/* string with html and php tags */ -$string_with_tags = <<<EOT -<test>Testing fgetss() functions</test> -<?php echo "this string is within php tag"; ?> {;}<{> this -is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg> -<html> html </html> <?php echo "php"; ?> -EOT; -if(substr(PHP_OS, 0, 3) == "WIN") { - $string_with_tags = str_replace("\r",'', $string_with_tags); -} -$filename = __DIR__."/fgetss_basic2ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.tmp"; - -/* try reading the file opened in different modes of reading */ -$file_modes = array("w+","w+b", "w+t","a+", "a+b", "a+t","x+","x+b","x+t"); - -for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - echo "\n-- Testing fgetss() with file opened using $file_modes[$mode_counter] mode --\n"; - - /* create an empty file and write the strings with tags */ - $file_handle = fopen($filename, $file_modes[$mode_counter]); - fwrite($file_handle,$string_with_tags); //writing data to the file - if(!$file_handle) { - echo "Error: failed to open file $filename!\n"; - exit(); - } - - // rewind the file pointer to beginning of the file - var_dump( filesize($filename) ); - var_dump( rewind($file_handle) ); - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - /* read entire file and strip tags */ - echo "-- fgetss() with default length, file pointer at 0 --\n"; - var_dump( fgetss($file_handle) ); // no length and allowable tags provided, reads entire file - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - rewind($file_handle); - /* read entire file and strip tags tags */ - echo "-- fgets() with length = 30, file pointer at 0 --\n"; - var_dump( fgetss($file_handle ,30) ); // length parameter given,not reading entire file - var_dump( ftell($file_handle) ); // checking file pointer position initially - var_dump( feof($file_handle) ); // confirm file pointer is not at eof - - // close the file - fclose($file_handle); - - // delete the file - unlink($filename); -} // end of for - mode_counter - -echo "Done\n"; -?> ---EXPECT-- -*** Testing fgetss() : basic operations *** - --- Testing fgetss() with file opened using w+ mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using w+b mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using w+t mode -- -int(195) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using a+ mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using a+b mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using a+t mode -- -int(195) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using x+ mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using x+b mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using x+t mode -- -int(195) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) -Done diff --git a/ext/standard/tests/file/fgetss_basic2-win32.phpt b/ext/standard/tests/file/fgetss_basic2-win32.phpt deleted file mode 100644 index 9e9ab50788..0000000000 --- a/ext/standard/tests/file/fgetss_basic2-win32.phpt +++ /dev/null @@ -1,218 +0,0 @@ ---TEST-- -Test fgetss() function : Basic functionality - read/write modes ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die('skip.. only on Windows'); -} -?> ---FILE-- -<?php -error_reporting(E_ALL & ~E_DEPRECATED); - -/* - Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); - Description: Gets line from file pointer and strip HTML tags -*/ - -/* try fgetss on files which are opened in read/write modes - w+, w+b, w+t, - a+, a+b, a+t, - x+, x+b, x+t -*/ - - -echo "*** Testing fgetss() : basic operations ***\n"; - -/* string with html and php tags */ -$string_with_tags = <<<EOT -<test>Testing fgetss() functions</test> -<?php echo "this string is within php tag"; ?> {;}<{> this -is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg> -<html> html </html> <?php echo "php"; ?> -EOT; -if(substr(PHP_OS, 0, 3) == "WIN") { - $string_with_tags = str_replace("\r",'', $string_with_tags); -} -$filename = __DIR__."/fgetss_basic2.tmp"; - -/* try reading the file opened in different modes of reading */ -$file_modes = array("w+","w+b", "w+t","a+", "a+b", "a+t","x+","x+b","x+t"); - -for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - echo "\n-- Testing fgetss() with file opened using $file_modes[$mode_counter] mode --\n"; - - /* create an empty file and write the strings with tags */ - $file_handle = fopen($filename, $file_modes[$mode_counter]); - fwrite($file_handle,$string_with_tags); //writing data to the file - if(!$file_handle) { - echo "Error: failed to open file $filename!\n"; - exit(); - } - - // rewind the file pointer to beginning of the file - var_dump( filesize($filename) ); - var_dump( rewind($file_handle) ); - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - /* read entire file and strip tags */ - echo "-- fgetss() with default length, file pointer at 0 --\n"; - var_dump( fgetss($file_handle) ); // no length and allowable tags provided, reads entire file - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - rewind($file_handle); - /* read entire file and strip tags tags */ - echo "-- fgets() with length = 30, file pointer at 0 --\n"; - var_dump( fgetss($file_handle ,30) ); // length parameter given,not reading entire file - var_dump( ftell($file_handle) ); // checking file pointer position initially - var_dump( feof($file_handle) ); // confirm file pointer is not at eof - - // close the file - fclose($file_handle); - - // delete the file - unlink($filename); -} // end of for - mode_counter - -echo "Done\n"; -?> ---EXPECT-- -*** Testing fgetss() : basic operations *** - --- Testing fgetss() with file opened using w+ mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using w+b mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using w+t mode -- -int(195) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using a+ mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using a+b mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using a+t mode -- -int(195) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using x+ mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using x+b mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using x+t mode -- -int(195) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) -Done diff --git a/ext/standard/tests/file/fgetss_basic2.phpt b/ext/standard/tests/file/fgetss_basic2.phpt deleted file mode 100644 index 887a752435..0000000000 --- a/ext/standard/tests/file/fgetss_basic2.phpt +++ /dev/null @@ -1,216 +0,0 @@ ---TEST-- -Test fgetss() function : Basic functionality - read/write modes ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. Not valid for Windows'); -} -?> ---FILE-- -<?php -error_reporting(E_ALL & ~E_DEPRECATED); - -/* - Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); - Description: Gets line from file pointer and strip HTML tags -*/ - -/* try fgetss on files which are opened in read/write modes - w+, w+b, w+t, - a+, a+b, a+t, - x+, x+b, x+t -*/ - - -echo "*** Testing fgetss() : basic operations ***\n"; - -/* string with html and php tags */ -$string_with_tags = <<<EOT -<test>Testing fgetss() functions</test> -<?php echo "this string is within php tag"; ?> {;}<{> this -is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg> -<html> html </html> <?php echo "php"; ?> -EOT; - -$filename = __DIR__."/fgetss_basic2.tmp"; - -/* try reading the file opened in different modes of reading */ -$file_modes = array("w+","w+b", "w+t","a+", "a+b", "a+t","x+","x+b","x+t"); - -for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - echo "\n-- Testing fgetss() with file opened using $file_modes[$mode_counter] mode --\n"; - - /* create an empty file and write the strings with tags */ - $file_handle = fopen($filename, $file_modes[$mode_counter]); - fwrite($file_handle,$string_with_tags); //writing data to the file - if(!$file_handle) { - echo "Error: failed to open file $filename!\n"; - exit(); - } - - // rewind the file pointer to beginning of the file - var_dump( filesize($filename) ); - var_dump( rewind($file_handle) ); - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - /* read entire file and strip tags */ - echo "-- fgetss() with default length, file pointer at 0 --\n"; - var_dump( fgetss($file_handle) ); // no length and allowable tags provided, reads entire file - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - rewind($file_handle); - /* read entire file and strip tags tags */ - echo "-- fgets() with length = 30, file pointer at 0 --\n"; - var_dump( fgetss($file_handle ,30) ); // length parameter given,not reading entire file - var_dump( ftell($file_handle) ); // checking file pointer position initially - var_dump( feof($file_handle) ); // confirm file pointer is not at eof - - // close the file - fclose($file_handle); - - // delete the file - unlink($filename); -} // end of for - mode_counter - -echo "Done\n"; -?> ---EXPECT-- -*** Testing fgetss() : basic operations *** - --- Testing fgetss() with file opened using w+ mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using w+b mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using w+t mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using a+ mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using a+b mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using a+t mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using x+ mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using x+b mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) - --- Testing fgetss() with file opened using x+t mode -- -int(192) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 -- -string(27) "Testing fgetss() functions -" -int(40) -bool(false) --- fgets() with length = 30, file pointer at 0 -- -string(23) "Testing fgetss() functi" -int(29) -bool(false) -Done diff --git a/ext/standard/tests/file/fgetss_error.phpt b/ext/standard/tests/file/fgetss_error.phpt deleted file mode 100644 index 13a5399406..0000000000 --- a/ext/standard/tests/file/fgetss_error.phpt +++ /dev/null @@ -1,108 +0,0 @@ ---TEST-- -Test fgetss() function : error conditions ---FILE-- -<?php -error_reporting(E_ALL & ~E_DEPRECATED); - -/* - Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); - Description: Gets line from file pointer and strip HTML tags -*/ - -echo "*** Testing error conditions ***\n"; -// zero argument -echo "-- Testing fgetss() with zero argument --\n"; -var_dump( fgetss() ); - -// more than expected no. of args -echo "-- Testing fgetss() with more than expected number of arguments --\n"; -$fp = fopen(__FILE__, "r"); -var_dump( fgetss($fp, 100, '<p><a>', $fp) ); - -// invalid length argument -echo "-- Testing fgetss() with invalid length arguments --\n"; -$len = 0; -$allowable_tags = '<p><a>'; -var_dump( fgetss($fp, $len, $allowable_tags) ); -$len = -10; -var_dump( fgetss($fp, $len, $allowable_tags) ); -$len = 1; -var_dump( fgetss($fp, $len, $allowable_tags) ); // return length - 1 always, expect false - -// test invalid arguments : non-resources -echo "-- Testing fgetss() with invalid arguments --\n"; -$invalid_args = array ( - "string", - 10, - 10.5, - true, - array(1,2,3), - new stdclass, -); -/* loop to test fgetss() with different invalid type of args */ -for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++) { - echo "-- Iteration $loop_counter --\n"; - var_dump( fgetss($invalid_args[$loop_counter - 1], 10, $allowable_tags) ); -} -// fgetss() on a file handle which is already closed -echo "-- Testing fgetss() with closed/unset file handle --"; -fclose($fp); -var_dump(fgetss($fp,10,$allowable_tags)); - -// fgetss() on a file handle which is unset -$file_handle = fopen(__FILE__, "r"); -unset($file_handle); //unset file handle -var_dump( fgetss(@$file_handle,10)); - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing error conditions *** --- Testing fgetss() with zero argument -- - -Warning: fgetss() expects at least 1 parameter, 0 given in %s on line %d -bool(false) --- Testing fgetss() with more than expected number of arguments -- - -Warning: fgetss() expects at most 3 parameters, 4 given in %s on line %d -bool(false) --- Testing fgetss() with invalid length arguments -- - -Warning: fgetss(): Length parameter must be greater than 0 in %s on line %d -bool(false) - -Warning: fgetss(): Length parameter must be greater than 0 in %s on line %d -bool(false) -bool(false) --- Testing fgetss() with invalid arguments -- --- Iteration 1 -- - -Warning: fgetss() expects parameter 1 to be resource, string given in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: fgetss() expects parameter 1 to be resource, int given in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: fgetss() expects parameter 1 to be resource, float given in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: fgetss() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: fgetss() expects parameter 1 to be resource, array given in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: fgetss() expects parameter 1 to be resource, object given in %s on line %d -bool(false) --- Testing fgetss() with closed/unset file handle -- -Warning: fgetss(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: fgetss() expects parameter 1 to be resource, null given in %s on line %d -bool(false) -Done diff --git a/ext/standard/tests/file/fgetss_variation1-win32.phpt b/ext/standard/tests/file/fgetss_variation1-win32.phpt deleted file mode 100644 index 72e19c293f..0000000000 --- a/ext/standard/tests/file/fgetss_variation1-win32.phpt +++ /dev/null @@ -1,192 +0,0 @@ ---TEST-- -Test fgetss() function : usage variations - write only modes ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die('skip.. only on Windows'); -} -?> ---FILE-- -<?php -error_reporting(E_ALL & ~E_DEPRECATED); - -/* - Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); - Description: Gets line from file pointer and strip HTML tags -*/ - -/* try fgets on files which are opened in non readable modes - w, wb, wt, - a, ab, at, - x, xb, xt -*/ - -// include the common file related test functions -include ("file.inc"); - -echo "*** Testing fgetss() : usage variations ***\n"; - -/* string with html and php tags */ -$string_with_tags = <<<EOT -<test>Testing fgetss() functions</test> -<?php echo "this string is within php tag"; ?> {;}<{> this -is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg> -<html> html </html> <?php echo "php"; ?> -this line is without any html and php tags -this is a line with more than eighty character,want to check line splitting correctly after 80 characters -this text contains some html tags <body> body </body> <br> br </br> -this is the line with \n character. -EOT; - -if(substr(PHP_OS, 0, 3) == "WIN") { - $string_with_tags = str_replace("\r",'', $string_with_tags); -} - -$filename = __DIR__."/fgetss_variation1.tmp"; - -/* try reading the file opened in different modes of reading */ -$file_modes = array("w","wb", "wt","a", "ab", "at","x","xb","xt"); - -for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - echo "\n-- Testing fgetss() with file opened using $file_modes[$mode_counter] mode --\n"; - - /* create an empty file and write the strings with tags */ - $file_handle = fopen($filename, $file_modes[$mode_counter]); - fwrite($file_handle,$string_with_tags); - if(!$file_handle) { - echo "Error: failed to open file $filename!\n"; - exit(); - } - - // rewind the file pointer to beginning of the file - var_dump( filesize($filename) ); - var_dump( rewind($file_handle) ); - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - /* read entire file and strip tags */ - echo "-- fgetss() with default length, file pointer at 0 , expected : no character should be read --\n"; - var_dump( fgetss($file_handle) ); // expected : no character should be read - var_dump( ftell($file_handle) ); //ensure that file pointer position is not changed - var_dump( feof($file_handle) ); // check if end of file pointer is set - - // close the file - fclose($file_handle); - - // delete the file - delete_file($filename); -} // end of for - mode_counter - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing fgetss() : usage variations *** - --- Testing fgetss() with file opened using w mode -- -int(445) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 , expected : no character should be read -- - -Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetss() with file opened using wb mode -- -int(445) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 , expected : no character should be read -- - -Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetss() with file opened using wt mode -- -int(453) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 , expected : no character should be read -- - -Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetss() with file opened using a mode -- -int(445) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 , expected : no character should be read -- - -Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetss() with file opened using ab mode -- -int(445) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 , expected : no character should be read -- - -Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetss() with file opened using at mode -- -int(453) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 , expected : no character should be read -- - -Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetss() with file opened using x mode -- -int(445) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 , expected : no character should be read -- - -Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetss() with file opened using xb mode -- -int(445) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 , expected : no character should be read -- - -Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetss() with file opened using xt mode -- -int(453) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 , expected : no character should be read -- - -Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -Done diff --git a/ext/standard/tests/file/fgetss_variation1.phpt b/ext/standard/tests/file/fgetss_variation1.phpt deleted file mode 100644 index e1a202388c..0000000000 --- a/ext/standard/tests/file/fgetss_variation1.phpt +++ /dev/null @@ -1,188 +0,0 @@ ---TEST-- -Test fgetss() function : usage variations - write only modes ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. Not valid for Windows'); -} -?> ---FILE-- -<?php -error_reporting(E_ALL & ~E_DEPRECATED); - -/* - Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); - Description: Gets line from file pointer and strip HTML tags -*/ - -/* try fgets on files which are opened in non readable modes - w, wb, wt, - a, ab, at, - x, xb, xt -*/ - -// include the common file related test functions -include ("file.inc"); - -echo "*** Testing fgetss() : usage variations ***\n"; - -/* string with html and php tags */ -$string_with_tags = <<<EOT -<test>Testing fgetss() functions</test> -<?php echo "this string is within php tag"; ?> {;}<{> this -is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg> -<html> html </html> <?php echo "php"; ?> -this line is without any html and php tags -this is a line with more than eighty character,want to check line splitting correctly after 80 characters -this text contains some html tags <body> body </body> <br> br </br> -this is the line with \n character. -EOT; - -$filename = __DIR__."/fgetss_variation1.tmp"; - -/* try reading the file opened in different modes of reading */ -$file_modes = array("w","wb", "wt","a", "ab", "at","x","xb","xt"); - -for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - echo "\n-- Testing fgetss() with file opened using $file_modes[$mode_counter] mode --\n"; - - /* create an empty file and write the strings with tags */ - $file_handle = fopen($filename, $file_modes[$mode_counter]); - fwrite($file_handle,$string_with_tags); - if(!$file_handle) { - echo "Error: failed to open file $filename!\n"; - exit(); - } - - // rewind the file pointer to beginning of the file - var_dump( filesize($filename) ); - var_dump( rewind($file_handle) ); - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - /* read entire file and strip tags */ - echo "-- fgetss() with default length, file pointer at 0 , expected : no character should be read --\n"; - var_dump( fgetss($file_handle) ); // expected : no character should be read - var_dump( ftell($file_handle) ); //ensure that file pointer position is not changed - var_dump( feof($file_handle) ); // check if end of file pointer is set - - // close the file - fclose($file_handle); - - // delete the file - delete_file($filename); -} // end of for - mode_counter - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing fgetss() : usage variations *** - --- Testing fgetss() with file opened using w mode -- -int(445) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 , expected : no character should be read -- - -Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetss() with file opened using wb mode -- -int(445) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 , expected : no character should be read -- - -Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetss() with file opened using wt mode -- -int(445) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 , expected : no character should be read -- - -Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetss() with file opened using a mode -- -int(445) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 , expected : no character should be read -- - -Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetss() with file opened using ab mode -- -int(445) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 , expected : no character should be read -- - -Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetss() with file opened using at mode -- -int(445) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 , expected : no character should be read -- - -Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetss() with file opened using x mode -- -int(445) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 , expected : no character should be read -- - -Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetss() with file opened using xb mode -- -int(445) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 , expected : no character should be read -- - -Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) - --- Testing fgetss() with file opened using xt mode -- -int(445) -bool(true) -int(0) -bool(false) --- fgetss() with default length, file pointer at 0 , expected : no character should be read -- - -Notice: fgetss(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -Done diff --git a/ext/standard/tests/file/fgetss_variation2.phpt b/ext/standard/tests/file/fgetss_variation2.phpt deleted file mode 100644 index 7c581793c2..0000000000 --- a/ext/standard/tests/file/fgetss_variation2.phpt +++ /dev/null @@ -1,436 +0,0 @@ ---TEST-- -Test fgetss() function : usage variations - read modes ---FILE-- -<?php -error_reporting(E_ALL & ~E_DEPRECATED); - -/* - Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); - Description: Gets line from file pointer and strip HTML tags -*/ - -// include the common file related test functions -include ("file.inc"); - -/*Test fgetss() with all read modes , reading line by line with allowable tags: <test>, <html>, <?> */ - -echo "*** Testing fgetss() : usage variations ***\n"; - -/* string with html and php tags */ -$string_with_tags = <<<EOT -<test>Testing fgetss() functions</test> -<?php echo "this string is within php tag"; ?> {;}<{> this -is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg> -<html> html </html> <?php echo "php"; ?> -this line is without any html and php tags -this is a line with more than eighty character,want to check line splitting correctly after 80 characters -this is the text containing \r character -this text contains some html tags <body> body </body> <br> br </br> -this is the line with \n character. -EOT; - -$filename = __DIR__."/fgetss_variation2.tmp"; - -/* try reading the file opened in different modes of reading */ -$file_modes = array("r","rb", "rt","r+", "r+b", "r+t"); - -for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - echo "\n-- Testing fgetss() with file opened using $file_modes[$mode_counter] mode --\n"; - - /* create an empty file and write the strings with tags */ - create_file ($filename); //create an empty file - file_put_contents($filename, $string_with_tags); - $file_handle = fopen($filename, $file_modes[$mode_counter]); - if(!$file_handle) { - echo "Error: failed to open file $filename!\n"; - exit(); - } - - // rewind the file pointer to beginning of the file - var_dump( filesize($filename) ); - var_dump( rewind($file_handle) ); - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - /* rewind the file and read the file line by line with allowable tags */ - echo "-- Reading line by line with allowable tags: <test>, <html>, <?> --\n"; - rewind($file_handle); - $line = 1; - while( !feof($file_handle) ) { - echo "-- Line $line --\n"; $line++; - var_dump( fgetss($file_handle, 80, "<test>, <html>, <?>") ); - var_dump( ftell($file_handle) ); // check the file pointer position - var_dump( feof($file_handle) ); // check if eof reached - } - - // close the file - fclose($file_handle); - // delete the file - delete_file($filename); -} // end of for - mode_counter - -echo "Done\n"; -?> ---EXPECT-- -*** Testing fgetss() : usage variations *** - --- Testing fgetss() with file opened using r mode -- -int(486) -bool(true) -int(0) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(41) "this is the text containing
character -" -int(383) -bool(false) --- Line 9 -- -string(46) "this text contains some html tags body br -" -int(451) -bool(false) --- Line 10 -- -string(23) "this is the line with -" -int(474) -bool(false) --- Line 11 -- -string(12) " character. " -int(486) -bool(true) - --- Testing fgetss() with file opened using rb mode -- -int(486) -bool(true) -int(0) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(41) "this is the text containing
character -" -int(383) -bool(false) --- Line 9 -- -string(46) "this text contains some html tags body br -" -int(451) -bool(false) --- Line 10 -- -string(23) "this is the line with -" -int(474) -bool(false) --- Line 11 -- -string(12) " character. " -int(486) -bool(true) - --- Testing fgetss() with file opened using rt mode -- -int(486) -bool(true) -int(0) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(41) "this is the text containing
character -" -int(383) -bool(false) --- Line 9 -- -string(46) "this text contains some html tags body br -" -int(451) -bool(false) --- Line 10 -- -string(23) "this is the line with -" -int(474) -bool(false) --- Line 11 -- -string(12) " character. " -int(486) -bool(true) - --- Testing fgetss() with file opened using r+ mode -- -int(486) -bool(true) -int(0) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(41) "this is the text containing
character -" -int(383) -bool(false) --- Line 9 -- -string(46) "this text contains some html tags body br -" -int(451) -bool(false) --- Line 10 -- -string(23) "this is the line with -" -int(474) -bool(false) --- Line 11 -- -string(12) " character. " -int(486) -bool(true) - --- Testing fgetss() with file opened using r+b mode -- -int(486) -bool(true) -int(0) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(41) "this is the text containing
character -" -int(383) -bool(false) --- Line 9 -- -string(46) "this text contains some html tags body br -" -int(451) -bool(false) --- Line 10 -- -string(23) "this is the line with -" -int(474) -bool(false) --- Line 11 -- -string(12) " character. " -int(486) -bool(true) - --- Testing fgetss() with file opened using r+t mode -- -int(486) -bool(true) -int(0) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(41) "this is the text containing
character -" -int(383) -bool(false) --- Line 9 -- -string(46) "this text contains some html tags body br -" -int(451) -bool(false) --- Line 10 -- -string(23) "this is the line with -" -int(474) -bool(false) --- Line 11 -- -string(12) " character. " -int(486) -bool(true) -Done diff --git a/ext/standard/tests/file/fgetss_variation3-win32.phpt b/ext/standard/tests/file/fgetss_variation3-win32.phpt deleted file mode 100644 index f53d76ce27..0000000000 --- a/ext/standard/tests/file/fgetss_variation3-win32.phpt +++ /dev/null @@ -1,573 +0,0 @@ ---TEST-- -Test fgetss() function : usage variations - read/write modes ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die('skip.. only valid for Windows'); -} -?> ---FILE-- -<?php -error_reporting(E_ALL & ~E_DEPRECATED); - -/* - Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); - Description: Gets line from file pointer and strip HTML tags -*/ - -/* try fgetss on files which are opened in read/write modes - w+, w+b, w+t, - a+, a+b, a+t, - x+, x+b, x+t - reading line by line with allowable tags: <test>, <html>, <?> -*/ - - -echo "*** Testing fgetss() : usage variations ***\n"; - -/* string with html and php tags */ -$string_with_tags = <<<EOT -<test>Testing fgetss() functions</test> -<?php echo "this string is within php tag"; ?> {;}<{> this -is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg> -<html> html </html> <?php echo "php"; ?> -this line is without any html and php tags -this is a line with more than eighty character,want to check line splitting correctly after 80 characters -this text contains some html tags <body> body </body> <br> br </br> -this is the line with \n character. -EOT; - -if(substr(PHP_OS, 0, 3) == "WIN") { - $string_with_tags = str_replace("\r",'', $string_with_tags); -} - -$filename = __DIR__."/fgetss_variation3.tmp"; - -/* try reading the file opened in different modes of reading */ -$file_modes = array("w+","w+b", "w+t","a+", "a+b", "a+t","x+","x+b","x+t"); - -for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - echo "\n-- Testing fgetss() with file opened using $file_modes[$mode_counter] mode --\n"; - - /* create an empty file and write the strings with tags */ - $file_handle = fopen($filename, $file_modes[$mode_counter]); - fwrite($file_handle,$string_with_tags); //writing data to the file - if(!$file_handle) { - echo "Error: failed to open file $filename!\n"; - exit(); - } - - // rewind the file pointer to beginning of the file - rewind($file_handle); - var_dump( ftell($file_handle) ); - var_dump( filesize($filename) ); - var_dump( feof($file_handle) ); - - /* rewind the file and read the file line by line with allowable tags */ - echo "-- Reading line by line with allowable tags: <test>, <html>, <?> --\n"; - $line = 1; - while( !feof($file_handle) ) { - echo "-- Line $line --\n"; $line++; - var_dump( fgetss($file_handle, 80, "<test>, <html>, <?>") ); - var_dump( ftell($file_handle) ); // check the file pointer position - var_dump( feof($file_handle) ); // check if eof reached - } - - // close the file - fclose($file_handle); - - // delete the file - unlink($filename); -} // end of for - mode_counter - -echo "Done\n"; -?> ---EXPECT-- -*** Testing fgetss() : usage variations *** - --- Testing fgetss() with file opened using w+ mode -- -int(0) -int(445) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(46) "this text contains some html tags body br -" -int(410) -bool(false) --- Line 9 -- -string(23) "this is the line with -" -int(433) -bool(false) --- Line 10 -- -string(12) " character. " -int(445) -bool(true) - --- Testing fgetss() with file opened using w+b mode -- -int(0) -int(445) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(46) "this text contains some html tags body br -" -int(410) -bool(false) --- Line 9 -- -string(23) "this is the line with -" -int(433) -bool(false) --- Line 10 -- -string(12) " character. " -int(445) -bool(true) - --- Testing fgetss() with file opened using w+t mode -- -int(0) -int(453) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(46) "this text contains some html tags body br -" -int(410) -bool(false) --- Line 9 -- -string(23) "this is the line with -" -int(433) -bool(false) --- Line 10 -- -string(12) " character. " -int(445) -bool(true) - --- Testing fgetss() with file opened using a+ mode -- -int(0) -int(445) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(46) "this text contains some html tags body br -" -int(410) -bool(false) --- Line 9 -- -string(23) "this is the line with -" -int(433) -bool(false) --- Line 10 -- -string(12) " character. " -int(445) -bool(true) - --- Testing fgetss() with file opened using a+b mode -- -int(0) -int(445) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(46) "this text contains some html tags body br -" -int(410) -bool(false) --- Line 9 -- -string(23) "this is the line with -" -int(433) -bool(false) --- Line 10 -- -string(12) " character. " -int(445) -bool(true) - --- Testing fgetss() with file opened using a+t mode -- -int(0) -int(453) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(46) "this text contains some html tags body br -" -int(410) -bool(false) --- Line 9 -- -string(23) "this is the line with -" -int(433) -bool(false) --- Line 10 -- -string(12) " character. " -int(445) -bool(true) - --- Testing fgetss() with file opened using x+ mode -- -int(0) -int(445) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(46) "this text contains some html tags body br -" -int(410) -bool(false) --- Line 9 -- -string(23) "this is the line with -" -int(433) -bool(false) --- Line 10 -- -string(12) " character. " -int(445) -bool(true) - --- Testing fgetss() with file opened using x+b mode -- -int(0) -int(445) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(46) "this text contains some html tags body br -" -int(410) -bool(false) --- Line 9 -- -string(23) "this is the line with -" -int(433) -bool(false) --- Line 10 -- -string(12) " character. " -int(445) -bool(true) - --- Testing fgetss() with file opened using x+t mode -- -int(0) -int(453) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(46) "this text contains some html tags body br -" -int(410) -bool(false) --- Line 9 -- -string(23) "this is the line with -" -int(433) -bool(false) --- Line 10 -- -string(12) " character. " -int(445) -bool(true) -Done diff --git a/ext/standard/tests/file/fgetss_variation3.phpt b/ext/standard/tests/file/fgetss_variation3.phpt deleted file mode 100644 index d4120f7fc9..0000000000 --- a/ext/standard/tests/file/fgetss_variation3.phpt +++ /dev/null @@ -1,569 +0,0 @@ ---TEST-- -Test fgetss() function : usage variations - read/write modes ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. Not valid for Windows'); -} -?> ---FILE-- -<?php -error_reporting(E_ALL & ~E_DEPRECATED); - -/* - Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); - Description: Gets line from file pointer and strip HTML tags -*/ - -/* try fgetss on files which are opened in read/write modes - w+, w+b, w+t, - a+, a+b, a+t, - x+, x+b, x+t - reading line by line with allowable tags: <test>, <html>, <?> -*/ - - -echo "*** Testing fgetss() : usage variations ***\n"; - -/* string with html and php tags */ -$string_with_tags = <<<EOT -<test>Testing fgetss() functions</test> -<?php echo "this string is within php tag"; ?> {;}<{> this -is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg> -<html> html </html> <?php echo "php"; ?> -this line is without any html and php tags -this is a line with more than eighty character,want to check line splitting correctly after 80 characters -this text contains some html tags <body> body </body> <br> br </br> -this is the line with \n character. -EOT; - -$filename = __DIR__."/fgetss_variation3.tmp"; - -/* try reading the file opened in different modes of reading */ -$file_modes = array("w+","w+b", "w+t","a+", "a+b", "a+t","x+","x+b","x+t"); - -for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - echo "\n-- Testing fgetss() with file opened using $file_modes[$mode_counter] mode --\n"; - - /* create an empty file and write the strings with tags */ - $file_handle = fopen($filename, $file_modes[$mode_counter]); - fwrite($file_handle,$string_with_tags); //writing data to the file - if(!$file_handle) { - echo "Error: failed to open file $filename!\n"; - exit(); - } - - // rewind the file pointer to beginning of the file - rewind($file_handle); - var_dump( ftell($file_handle) ); - var_dump( filesize($filename) ); - var_dump( feof($file_handle) ); - - /* rewind the file and read the file line by line with allowable tags */ - echo "-- Reading line by line with allowable tags: <test>, <html>, <?> --\n"; - $line = 1; - while( !feof($file_handle) ) { - echo "-- Line $line --\n"; $line++; - var_dump( fgetss($file_handle, 80, "<test>, <html>, <?>") ); - var_dump( ftell($file_handle) ); // check the file pointer position - var_dump( feof($file_handle) ); // check if eof reached - } - - // close the file - fclose($file_handle); - - // delete the file - unlink($filename); -} // end of for - mode_counter - -echo "Done\n"; -?> ---EXPECT-- -*** Testing fgetss() : usage variations *** - --- Testing fgetss() with file opened using w+ mode -- -int(0) -int(445) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(46) "this text contains some html tags body br -" -int(410) -bool(false) --- Line 9 -- -string(23) "this is the line with -" -int(433) -bool(false) --- Line 10 -- -string(12) " character. " -int(445) -bool(true) - --- Testing fgetss() with file opened using w+b mode -- -int(0) -int(445) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(46) "this text contains some html tags body br -" -int(410) -bool(false) --- Line 9 -- -string(23) "this is the line with -" -int(433) -bool(false) --- Line 10 -- -string(12) " character. " -int(445) -bool(true) - --- Testing fgetss() with file opened using w+t mode -- -int(0) -int(445) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(46) "this text contains some html tags body br -" -int(410) -bool(false) --- Line 9 -- -string(23) "this is the line with -" -int(433) -bool(false) --- Line 10 -- -string(12) " character. " -int(445) -bool(true) - --- Testing fgetss() with file opened using a+ mode -- -int(0) -int(445) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(46) "this text contains some html tags body br -" -int(410) -bool(false) --- Line 9 -- -string(23) "this is the line with -" -int(433) -bool(false) --- Line 10 -- -string(12) " character. " -int(445) -bool(true) - --- Testing fgetss() with file opened using a+b mode -- -int(0) -int(445) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(46) "this text contains some html tags body br -" -int(410) -bool(false) --- Line 9 -- -string(23) "this is the line with -" -int(433) -bool(false) --- Line 10 -- -string(12) " character. " -int(445) -bool(true) - --- Testing fgetss() with file opened using a+t mode -- -int(0) -int(445) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(46) "this text contains some html tags body br -" -int(410) -bool(false) --- Line 9 -- -string(23) "this is the line with -" -int(433) -bool(false) --- Line 10 -- -string(12) " character. " -int(445) -bool(true) - --- Testing fgetss() with file opened using x+ mode -- -int(0) -int(445) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(46) "this text contains some html tags body br -" -int(410) -bool(false) --- Line 9 -- -string(23) "this is the line with -" -int(433) -bool(false) --- Line 10 -- -string(12) " character. " -int(445) -bool(true) - --- Testing fgetss() with file opened using x+b mode -- -int(0) -int(445) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(46) "this text contains some html tags body br -" -int(410) -bool(false) --- Line 9 -- -string(23) "this is the line with -" -int(433) -bool(false) --- Line 10 -- -string(12) " character. " -int(445) -bool(true) - --- Testing fgetss() with file opened using x+t mode -- -int(0) -int(445) -bool(false) --- Reading line by line with allowable tags: <test>, <html>, <?> -- --- Line 1 -- -string(40) "<test>Testing fgetss() functions</test> -" -int(40) -bool(false) --- Line 2 -- -string(10) " {;} this -" -int(99) -bool(false) --- Line 3 -- -string(44) "is a heredoc string. ksklnm@@$$&$&^%&^%&^%& -" -int(152) -bool(false) --- Line 4 -- -string(21) "<html> html </html> -" -int(193) -bool(false) --- Line 5 -- -string(43) "this line is without any html and php tags -" -int(236) -bool(false) --- Line 6 -- -string(79) "this is a line with more than eighty character,want to check line splitting cor" -int(315) -bool(false) --- Line 7 -- -string(27) "rectly after 80 characters -" -int(342) -bool(false) --- Line 8 -- -string(46) "this text contains some html tags body br -" -int(410) -bool(false) --- Line 9 -- -string(23) "this is the line with -" -int(433) -bool(false) --- Line 10 -- -string(12) " character. " -int(445) -bool(true) -Done diff --git a/ext/standard/tests/file/fgetss_variation4.phpt b/ext/standard/tests/file/fgetss_variation4.phpt deleted file mode 100644 index 585f277e72..0000000000 --- a/ext/standard/tests/file/fgetss_variation4.phpt +++ /dev/null @@ -1,170 +0,0 @@ ---TEST-- -Test fgetss() function : usage variations - read modes, file pointer at EOF ---SKIPIF-- -<?php -if(substr(PHP_OS, 0, 3) == "WIN") - die("skip not for Windows"); -?> ---FILE-- -<?php -error_reporting(E_ALL & ~E_DEPRECATED); - -/* - Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); - Description: Gets line from file pointer and strip HTML tags -*/ - -// include the common file related test functions -include ("file.inc"); - -echo "*** Testing fgetss() : usage variations ***\n"; - -/* string with html and php tags */ -$string_with_tags = <<<EOT -<test>Testing fgetss() functions</test> -<?php echo "this string is within php tag"; ?> {;}<{> this -is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg> -<html> html </html> <?php echo "php"; ?> -this line is without any html and php tags -this is a line with more than eighty character,want to check line splitting correctly after 80 characters -this is the text containing \r character -this text contains some html tags <body> body </body> <br> br </br> -this is the line with \n character. -EOT; - -$filename = __DIR__."/fgetss_variation4.tmp"; - -/* try reading the file opened in different modes of reading */ -$file_modes = array("r","rb", "rt","r+", "r+b", "r+t"); - -for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - echo "\n-- Testing fgetss() with file opened using $file_modes[$mode_counter] mode --\n"; - - /* create an empty file and write the strings with tags */ - create_file ($filename); //create an empty file - file_put_contents($filename, $string_with_tags); - $file_handle = fopen($filename, $file_modes[$mode_counter]); - if(!$file_handle) { - echo "Error: failed to open file $filename!\n"; - exit(); - } - - // rewind the file pointer to beginning of the file - var_dump( filesize($filename) ); - var_dump( rewind($file_handle) ); - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - echo "-- Reading when file pointer points to EOF --\n"; - var_dump( fseek($file_handle,0,SEEK_END) ); // now file pointer at end - var_dump( ftell($file_handle) ); //ensure file pointer at end - var_dump( fgetss($file_handle) ); // try to read - var_dump( ftell($file_handle) ); // find out file position - var_dump( feof($file_handle) ); // ensure that file pointer is at eof - - // now file is at the end try reading with length and allowable tags,expecting false - var_dump( fgetss($file_handle, 80, "<test>, <html>, <?>") ); - var_dump( ftell($file_handle) ); // find out file position - var_dump( feof($file_handle) ); // ensure that file pointer is at eof - - // close the file - fclose($file_handle); - // delete the file - delete_file($filename); -} // end of for - mode_counter - -echo "Done\n"; -?> ---EXPECT-- -*** Testing fgetss() : usage variations *** - --- Testing fgetss() with file opened using r mode -- -int(486) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(486) -bool(false) -int(486) -bool(true) -bool(false) -int(486) -bool(true) - --- Testing fgetss() with file opened using rb mode -- -int(486) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(486) -bool(false) -int(486) -bool(true) -bool(false) -int(486) -bool(true) - --- Testing fgetss() with file opened using rt mode -- -int(486) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(486) -bool(false) -int(486) -bool(true) -bool(false) -int(486) -bool(true) - --- Testing fgetss() with file opened using r+ mode -- -int(486) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(486) -bool(false) -int(486) -bool(true) -bool(false) -int(486) -bool(true) - --- Testing fgetss() with file opened using r+b mode -- -int(486) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(486) -bool(false) -int(486) -bool(true) -bool(false) -int(486) -bool(true) - --- Testing fgetss() with file opened using r+t mode -- -int(486) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(486) -bool(false) -int(486) -bool(true) -bool(false) -int(486) -bool(true) -Done diff --git a/ext/standard/tests/file/fgetss_variation5-win32.phpt b/ext/standard/tests/file/fgetss_variation5-win32.phpt deleted file mode 100644 index 035186fd09..0000000000 --- a/ext/standard/tests/file/fgetss_variation5-win32.phpt +++ /dev/null @@ -1,222 +0,0 @@ ---TEST-- -Test fgetss() function : usage variations - read/write modes, file pointer at EOF ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die('skip.. only valid for Windows'); -} -?> ---FILE-- -<?php -error_reporting(E_ALL & ~E_DEPRECATED); - -/* - Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); - Description: Gets line from file pointer and strip HTML tags -*/ - -/* try fgetss on files which are opened in read/write modes - w+, w+b, w+t, - a+, a+b, a+t, - x+, x+b, x+t -*/ - - -echo "*** Testing fgetss() : usage variations ***\n"; - -/* string with html and php tags */ -$string_with_tags = <<<EOT -<test>Testing fgetss() functions</test> -<?php echo "this string is within php tag"; ?> {;}<{> this -is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg> -<html> html </html> <?php echo "php"; ?> -this line is without any html and php tags -this is a line with more than eighty character,want to check line splitting correctly after 80 characters -this text contains some html tags <body> body </body> <br> br </br> -this is the line with \n character. -EOT; -if(substr(PHP_OS, 0, 3) == "WIN") { - $string_with_tags = str_replace("\r",'', $string_with_tags); -} - -$filename = __DIR__."/fgetss_variation5.tmp"; - -/* try reading the file opened in different modes of reading */ -$file_modes = array("w+","w+b", "w+t","a+", "a+b", "a+t","x+","x+b","x+t"); - -for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - echo "\n-- Testing fgetss() with file opened using $file_modes[$mode_counter] mode --\n"; - - /* create an empty file and write the strings with tags */ - $file_handle = fopen($filename, $file_modes[$mode_counter]); - fwrite($file_handle,$string_with_tags); //writing data to the file - if(!$file_handle) { - echo "Error: failed to open file $filename!\n"; - exit(); - } - // rewind the file pointer to beginning of the file - var_dump( filesize($filename) ); - var_dump( rewind($file_handle) ); - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - echo "-- Reading when file pointer points to EOF --\n"; - var_dump( fseek($file_handle,0,SEEK_END) ); // now file pointer at end - var_dump( ftell($file_handle) ); //ensure file pointer at end - var_dump( fgetss($file_handle) ); // try to read - var_dump( ftell($file_handle) ); // find out file position - var_dump( feof($file_handle) ); // ensure that file pointer is at eof - - // now file is at the end try reading with length and allowable tags,expecting false - var_dump( fgetss($file_handle, 80, "<test>, <html>, <?>") ); - var_dump( ftell($file_handle) ); // find out file position - var_dump( feof($file_handle) ); // ensure that file pointer is at eof - - - // close the file - fclose($file_handle); - - // delete the file - unlink($filename); -} // end of for - mode_counter - -echo "Done\n"; -?> ---EXPECT-- -*** Testing fgetss() : usage variations *** - --- Testing fgetss() with file opened using w+ mode -- -int(445) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(445) -bool(false) -int(445) -bool(true) -bool(false) -int(445) -bool(true) - --- Testing fgetss() with file opened using w+b mode -- -int(445) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(445) -bool(false) -int(445) -bool(true) -bool(false) -int(445) -bool(true) - --- Testing fgetss() with file opened using w+t mode -- -int(453) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(453) -bool(false) -int(453) -bool(true) -bool(false) -int(453) -bool(true) - --- Testing fgetss() with file opened using a+ mode -- -int(445) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(445) -bool(false) -int(445) -bool(true) -bool(false) -int(445) -bool(true) - --- Testing fgetss() with file opened using a+b mode -- -int(445) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(445) -bool(false) -int(445) -bool(true) -bool(false) -int(445) -bool(true) - --- Testing fgetss() with file opened using a+t mode -- -int(453) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(453) -bool(false) -int(453) -bool(true) -bool(false) -int(453) -bool(true) - --- Testing fgetss() with file opened using x+ mode -- -int(445) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(445) -bool(false) -int(445) -bool(true) -bool(false) -int(445) -bool(true) - --- Testing fgetss() with file opened using x+b mode -- -int(445) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(445) -bool(false) -int(445) -bool(true) -bool(false) -int(445) -bool(true) - --- Testing fgetss() with file opened using x+t mode -- -int(453) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(453) -bool(false) -int(453) -bool(true) -bool(false) -int(453) -bool(true) -Done diff --git a/ext/standard/tests/file/fgetss_variation5.phpt b/ext/standard/tests/file/fgetss_variation5.phpt deleted file mode 100644 index 928fdeadf5..0000000000 --- a/ext/standard/tests/file/fgetss_variation5.phpt +++ /dev/null @@ -1,219 +0,0 @@ ---TEST-- -Test fgetss() function : usage variations - read/write modes, file pointer at EOF ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. Not valid for Windows'); -} -?> ---FILE-- -<?php -error_reporting(E_ALL & ~E_DEPRECATED); - -/* - Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); - Description: Gets line from file pointer and strip HTML tags -*/ - -/* try fgetss on files which are opened in read/write modes - w+, w+b, w+t, - a+, a+b, a+t, - x+, x+b, x+t -*/ - - -echo "*** Testing fgetss() : usage variations ***\n"; - -/* string with html and php tags */ -$string_with_tags = <<<EOT -<test>Testing fgetss() functions</test> -<?php echo "this string is within php tag"; ?> {;}<{> this -is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg> -<html> html </html> <?php echo "php"; ?> -this line is without any html and php tags -this is a line with more than eighty character,want to check line splitting correctly after 80 characters -this text contains some html tags <body> body </body> <br> br </br> -this is the line with \n character. -EOT; - -$filename = __DIR__."/fgetss_variation5.tmp"; - -/* try reading the file opened in different modes of reading */ -$file_modes = array("w+","w+b", "w+t","a+", "a+b", "a+t","x+","x+b","x+t"); - -for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - echo "\n-- Testing fgetss() with file opened using $file_modes[$mode_counter] mode --\n"; - - /* create an empty file and write the strings with tags */ - $file_handle = fopen($filename, $file_modes[$mode_counter]); - fwrite($file_handle,$string_with_tags); //writing data to the file - if(!$file_handle) { - echo "Error: failed to open file $filename!\n"; - exit(); - } - // rewind the file pointer to beginning of the file - var_dump( filesize($filename) ); - var_dump( rewind($file_handle) ); - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - - echo "-- Reading when file pointer points to EOF --\n"; - var_dump( fseek($file_handle,0,SEEK_END) ); // now file pointer at end - var_dump( ftell($file_handle) ); //ensure file pointer at end - var_dump( fgetss($file_handle) ); // try to read - var_dump( ftell($file_handle) ); // find out file position - var_dump( feof($file_handle) ); // ensure that file pointer is at eof - - // now file is at the end try reading with length and allowable tags,expecting false - var_dump( fgetss($file_handle, 80, "<test>, <html>, <?>") ); - var_dump( ftell($file_handle) ); // find out file position - var_dump( feof($file_handle) ); // ensure that file pointer is at eof - - - // close the file - fclose($file_handle); - - // delete the file - unlink($filename); -} // end of for - mode_counter - -echo "Done\n"; -?> ---EXPECT-- -*** Testing fgetss() : usage variations *** - --- Testing fgetss() with file opened using w+ mode -- -int(445) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(445) -bool(false) -int(445) -bool(true) -bool(false) -int(445) -bool(true) - --- Testing fgetss() with file opened using w+b mode -- -int(445) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(445) -bool(false) -int(445) -bool(true) -bool(false) -int(445) -bool(true) - --- Testing fgetss() with file opened using w+t mode -- -int(445) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(445) -bool(false) -int(445) -bool(true) -bool(false) -int(445) -bool(true) - --- Testing fgetss() with file opened using a+ mode -- -int(445) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(445) -bool(false) -int(445) -bool(true) -bool(false) -int(445) -bool(true) - --- Testing fgetss() with file opened using a+b mode -- -int(445) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(445) -bool(false) -int(445) -bool(true) -bool(false) -int(445) -bool(true) - --- Testing fgetss() with file opened using a+t mode -- -int(445) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(445) -bool(false) -int(445) -bool(true) -bool(false) -int(445) -bool(true) - --- Testing fgetss() with file opened using x+ mode -- -int(445) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(445) -bool(false) -int(445) -bool(true) -bool(false) -int(445) -bool(true) - --- Testing fgetss() with file opened using x+b mode -- -int(445) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(445) -bool(false) -int(445) -bool(true) -bool(false) -int(445) -bool(true) - --- Testing fgetss() with file opened using x+t mode -- -int(445) -bool(true) -int(0) -bool(false) --- Reading when file pointer points to EOF -- -int(0) -int(445) -bool(false) -int(445) -bool(true) -bool(false) -int(445) -bool(true) -Done diff --git a/ext/standard/tests/file/file.inc b/ext/standard/tests/file/file.inc index eda2b32c78..08825f4502 100644 --- a/ext/standard/tests/file/file.inc +++ b/ext/standard/tests/file/file.inc @@ -202,7 +202,7 @@ function change_file_perms($file_path, permissions. File is filled with content of size specified. $file_path = dir where files will be created $name_prefix = prefix to be used for names, name is suffix with a - unqiue numeric value to make the file name unique, default = file + unique numeric value to make the file name unique, default = file $name_suffix = suffix to be used for the name, default = 1 $count = total no. of files to be created, default = 1 $mode = file open mode as specified in fopen() call. Do not use @@ -215,7 +215,7 @@ function change_file_perms($file_path, "empty" = empty file "text_with_new_line" = similar to text fill type, but writes with new line char "alphanumeric" = fill file with alpha numeric text - If imporper $content type is specified, file is created as empty + If improper $content type is specified, file is created as empty $size = size of the fill in terms of kilobyte, i.e size of the file. if $flag is specified as "byte", then then given size is taken in bytes $flag = specify if size has to be treated as no of total bytes or @@ -309,7 +309,7 @@ function create_files( $file_path, /* Function: function create_links( $file_path, - $filename, + $filename, $link_count = 1, $link_type = "soft", $link_size = 1024, diff --git a/ext/standard/tests/file/file_basic.phpt b/ext/standard/tests/file/file_basic.phpt index f1fb58f621..649c3e1e20 100644 --- a/ext/standard/tests/file/file_basic.phpt +++ b/ext/standard/tests/file/file_basic.phpt @@ -3,9 +3,7 @@ Test file() function : basic functionality --FILE-- <?php /* - * Prototype: array file ( string filename [,int use-include_path [,resource context]] ); * Description: Reads entire file into an array - * Returns the file in an array */ require(__DIR__ . '/file.inc'); $file_path = __DIR__; diff --git a/ext/standard/tests/file/file_error.phpt b/ext/standard/tests/file/file_error.phpt index d932966ee5..163943a3db 100644 --- a/ext/standard/tests/file/file_error.phpt +++ b/ext/standard/tests/file/file_error.phpt @@ -2,20 +2,11 @@ Test file() function : error conditions --FILE-- <?php -/* - Prototype: array file ( string filename [,int use-include_path [,resource context]] ); - Description: Reads entire file into an array - Returns the file in an array -*/ $file_path = __DIR__; -echo "\n*** Testing error conditions ***"; +echo "\n*** Testing error conditions ***\n"; $file_handle = fopen($file_path."/file.tmp", "w"); -var_dump( file() ); // Zero No. of args $filename = $file_path."/file.tmp"; -var_dump( file($filename, $filename, $filename, $filename) ); // more than expected number of arguments - -var_dump( file($filename, "INCORRECT_FLAG", NULL) ); // Incorrect flag var_dump( file($filename, 10, NULL) ); // Incorrect flag var_dump( file("temp.tmp") ); // non existing filename @@ -30,18 +21,10 @@ unlink($file_path."/file.tmp"); ?> --EXPECTF-- *** Testing error conditions *** -Warning: file() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: file() expects at most 3 parameters, 4 given in %s on line %d -NULL - -Warning: file() expects parameter 2 to be int, string given in %s on line %d -NULL array(0) { } -Warning: file(temp.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: file(temp.tmp): Failed to open stream: No such file or directory in %s on line %d bool(false) --- Done --- diff --git a/ext/standard/tests/file/file_exists_variation1.phpt b/ext/standard/tests/file/file_exists_variation1.phpt index c3d4184724..55c6c94981 100644 --- a/ext/standard/tests/file/file_exists_variation1.phpt +++ b/ext/standard/tests/file/file_exists_variation1.phpt @@ -4,12 +4,6 @@ Test file_exists() function : usage variations Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : proto bool file_exists(string filename) - * Description: Returns true if filename exists - * Source code: ext/standard/filestat.c - * Alias to functions: - */ - echo "*** Testing file_exists() : usage variations ***\n"; var_dump(file_exists(NULL)); diff --git a/ext/standard/tests/file/file_get_contents_basic.phpt b/ext/standard/tests/file/file_get_contents_basic.phpt index 7fbca00249..5c060fdae1 100644 --- a/ext/standard/tests/file/file_get_contents_basic.phpt +++ b/ext/standard/tests/file/file_get_contents_basic.phpt @@ -5,11 +5,6 @@ Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype: string file_get_contents( string $filename[, bool $use_include_path[, - * resource $context[, int $offset[, int $maxlen]]]] ) - * Description: Reads entire file into a string - */ - $file_path = __DIR__; include($file_path."/file.inc"); diff --git a/ext/standard/tests/file/file_get_contents_basic001.phpt b/ext/standard/tests/file/file_get_contents_basic001.phpt index 86569d7917..d54bf2bcb4 100644 --- a/ext/standard/tests/file/file_get_contents_basic001.phpt +++ b/ext/standard/tests/file/file_get_contents_basic001.phpt @@ -4,13 +4,13 @@ file_get_contents() test using basic syntax "Blanche V.N." <valerie_nare@yahoo.fr> --FILE-- <?php - $file_content = "Bienvenue au CodeFest a Montreal"; - $temp_filename = __DIR__."/fichier_a_lire.txt"; - $handle = fopen($temp_filename,"w"); - fwrite($handle,$file_content); - fclose($handle); - $var = file_get_contents($temp_filename); - echo $var; + $file_content = "Bienvenue au CodeFest a Montreal"; + $temp_filename = __DIR__."/fichier_a_lire.txt"; + $handle = fopen($temp_filename,"w"); + fwrite($handle,$file_content); + fclose($handle); + $var = file_get_contents($temp_filename); + echo $var; ?> --CLEAN-- <?php diff --git a/ext/standard/tests/file/file_get_contents_error.phpt b/ext/standard/tests/file/file_get_contents_error.phpt index d4c6f16529..66708c4f17 100644 --- a/ext/standard/tests/file/file_get_contents_error.phpt +++ b/ext/standard/tests/file/file_get_contents_error.phpt @@ -4,10 +4,6 @@ Test file_get_contents() function : error conditions Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype: string file_get_contents( string $filename{, bool $use_include_path[, - * resource $context[, int $offset[, int $maxlen]]]] ) - * Description: Reads entire file into a string - */ echo "*** Testing error conditions ***\n"; @@ -17,17 +13,15 @@ include($file_path."/file.inc"); echo "\n-- Testing with Non-existing file --\n"; print( file_get_contents("/no/such/file/or/dir") ); -echo "\n-- Testing No.of arguments less than expected --\n"; -print( file_get_contents() ); - -echo "\n-- Testing No.of arguments greater than expected --\n"; - create_files($file_path, 1, "text", 0755, 100, "w", "file", 1, "byte"); $file_handle = fopen($file_path."/file_put_contents_error.tmp", "w"); -print( file_get_contents($file_path."/file1.tmp", false, $file_handle, 1, 2, "extra_argument") ); -echo "\n-- Testing for invalid negative maxlen values --"; -var_dump( file_get_contents($file_path."/file1.tmp", FALSE, $file_handle, 0, -5) ); +echo "\n-- Testing for invalid negative maxlen values --\n"; +try { + file_get_contents($file_path."/file1.tmp", FALSE, $file_handle, 0, -5); +} catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; +} delete_files($file_path, 1); fclose($file_handle); @@ -50,18 +44,9 @@ if(file_exists($file_path."/file_put_contents1.tmp")) { -- Testing with Non-existing file -- -Warning: file_get_contents(/no/such/file/or/dir): failed to open stream: No such file or directory in %s on line %d - --- Testing No.of arguments less than expected -- - -Warning: file_get_contents() expects at least 1 parameter, 0 given in %s on line %d - --- Testing No.of arguments greater than expected -- - -Warning: file_get_contents() expects at most 5 parameters, 6 given in %s on line %d +Warning: file_get_contents(/no/such/file/or/dir): Failed to open stream: No such file or directory in %s on line %d -- Testing for invalid negative maxlen values -- -Warning: file_get_contents(): length must be greater than or equal to zero in %s on line %d -bool(false) +file_get_contents(): Argument #5 ($maxlen) must be greater than or equal to 0 *** Done *** diff --git a/ext/standard/tests/file/file_get_contents_error001.phpt b/ext/standard/tests/file/file_get_contents_error001.phpt index 45c376b913..0bbce038e6 100644 --- a/ext/standard/tests/file/file_get_contents_error001.phpt +++ b/ext/standard/tests/file/file_get_contents_error001.phpt @@ -11,7 +11,7 @@ display_errors=false ?> --FILE-- <?php - var_dump(file_get_contents("php://stdin",null,null,8000,1)); + var_dump(file_get_contents("php://stdin",null,null,8000,1)); ?> --EXPECT-- bool(false) diff --git a/ext/standard/tests/file/file_get_contents_error002.phpt b/ext/standard/tests/file/file_get_contents_error002.phpt index 8ca1162672..6624279d74 100644 --- a/ext/standard/tests/file/file_get_contents_error002.phpt +++ b/ext/standard/tests/file/file_get_contents_error002.phpt @@ -7,7 +7,11 @@ file_get_contents() test using negative parameter for length (last parameter) display_errors=false --FILE-- <?php - var_dump(file_get_contents("http://checkip.dyndns.com",null,null,0,-1)); +try { + file_get_contents("http://checkip.dyndns.com",null,null,0,-1); +} catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; +} ?> --EXPECT-- -bool(false) +file_get_contents(): Argument #5 ($maxlen) must be greater than or equal to 0 diff --git a/ext/standard/tests/file/file_get_contents_file_put_contents_basic.phpt b/ext/standard/tests/file/file_get_contents_file_put_contents_basic.phpt index 85f44f2cb7..97482e9a59 100644 --- a/ext/standard/tests/file/file_get_contents_file_put_contents_basic.phpt +++ b/ext/standard/tests/file/file_get_contents_file_put_contents_basic.phpt @@ -3,15 +3,6 @@ Test file_put_contents() and file_get_contents() functions : basic functionality --FILE-- <?php -/* Prototype: string file_get_contents( string $filename[, bool $use_include_path[, - * resource $context[, int $offset[, int $maxlen]]]] ) - * Description: Reads entire file into a string - */ - -/* Prototype: int file_put_contents( string $filename, mixed $data[, int $flags[, resource $context]] ) - * Description: Write a string to a file - */ - $file_path = __DIR__; include($file_path."/file.inc"); diff --git a/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt b/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt index f34e6ef418..5b889a19c3 100644 --- a/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt +++ b/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt @@ -2,14 +2,6 @@ Test file-get_contents() and file_put_contents() functions : error conditions --FILE-- <?php -/* Prototype: string file_get_contents( string $filename{, bool $use_include_path[, - * resource $context[, int $offset[, int $maxlen]]]] ) - * Description: Reads entire file into a string - */ - -/* Prototype: int file_put_contents( string $filename, mixed $data[, int $flags[, resource $context]] ) - * Description: Write a string to a file - */ echo "*** Testing error conditions ***\n"; @@ -18,19 +10,15 @@ $file_path = __DIR__; echo "\n-- Testing with Non-existing file --\n"; print( file_get_contents("/no/such/file/or/dir") ); -echo "\n-- Testing No.of arguments less than expected --\n"; -print( file_get_contents() ); -print( file_put_contents() ); -print( file_put_contents($file_path."/".__FILE__) ); - $file_handle = fopen($file_path."/file_put_contents.tmp", "w"); -echo "\n-- Testing No.of arguments greater than expected --\n"; -print( file_put_contents("abc.tmp", 12345, 1, $file_handle, "extra_argument") ); -print( file_get_contents("abc.tmp", false, $file_handle, 1, 2, "extra_argument") ); -echo "\n-- Testing for invalid negative maxlen values --"; +echo "\n-- Testing for invalid negative maxlen values --\n"; file_put_contents($file_path."/file_put_contents1.tmp", "Garbage data in the file"); -var_dump( file_get_contents($file_path."/file_put_contents1.tmp", FALSE, NULL, 0, -5) ); +try { + file_get_contents($file_path."/file_put_contents1.tmp", FALSE, NULL, 0, -5); +} catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; +} fclose($file_handle); @@ -48,24 +36,9 @@ unlink($file_path."/file_put_contents1.tmp"); -- Testing with Non-existing file -- -Warning: file_get_contents(/no/such/file/or/dir): failed to open stream: No such file or directory in %s on line %d - --- Testing No.of arguments less than expected -- - -Warning: file_get_contents() expects at least 1 parameter, 0 given in %s on line %d - -Warning: file_put_contents() expects at least 2 parameters, 0 given in %s on line %d - -Warning: file_put_contents() expects at least 2 parameters, 1 given in %s on line %d - --- Testing No.of arguments greater than expected -- - -Warning: file_put_contents() expects at most 4 parameters, 5 given in %s on line %d - -Warning: file_get_contents() expects at most 5 parameters, 6 given in %s on line %d +Warning: file_get_contents(/no/such/file/or/dir): Failed to open stream: No such file or directory in %s on line %d -- Testing for invalid negative maxlen values -- -Warning: file_get_contents(): length must be greater than or equal to zero in %s on line %d -bool(false) +file_get_contents(): Argument #5 ($maxlen) must be greater than or equal to 0 *** Done *** diff --git a/ext/standard/tests/file/file_get_contents_file_put_contents_variation1.phpt b/ext/standard/tests/file/file_get_contents_file_put_contents_variation1.phpt index 80ddf1f5db..4abe1dce13 100644 --- a/ext/standard/tests/file/file_get_contents_file_put_contents_variation1.phpt +++ b/ext/standard/tests/file/file_get_contents_file_put_contents_variation1.phpt @@ -2,14 +2,7 @@ Test file_get_contents() and file_put_contents() functions : usage variations - all arguments --FILE-- <?php -/* Prototype: string file_get_contents( string $filename[, bool $use_include_path[, - * resource $context[, int $offset[, int $maxlen]]]] ) - * Description: Reads entire file into a string - */ -/* Prototype: int file_put_contents( string $filename, mixed $data[,int $flags[, resource $context]] ) - * Description: Write a string to a file - */ /* Testing variation in all argument values */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/file_get_contents_file_put_contents_variation2.phpt b/ext/standard/tests/file/file_get_contents_file_put_contents_variation2.phpt index 0a35283aeb..c452dec13c 100644 --- a/ext/standard/tests/file/file_get_contents_file_put_contents_variation2.phpt +++ b/ext/standard/tests/file/file_get_contents_file_put_contents_variation2.phpt @@ -2,14 +2,6 @@ Test file_get_contents() and file_put_contents() functions : usage variations - use_include_path --FILE-- <?php -/* Prototype: string file_get_contents( string $filename[, bool $use_include_path[, - * resource $context[, int $offset[, int $maxlen]]]] ) - * Description: Reads entire file into a string - */ - -/* Prototype: int file_put_contents( string $filename, mixed $data[,int $flags[, resource $context]] ) - * Description: Write a string to a file - */ /* Testing variation using use_include_path argument */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/file_get_contents_variation1.phpt b/ext/standard/tests/file/file_get_contents_variation1.phpt index eb502e0527..e770626054 100644 --- a/ext/standard/tests/file/file_get_contents_variation1.phpt +++ b/ext/standard/tests/file/file_get_contents_variation1.phpt @@ -4,12 +4,6 @@ Test file_get_contents() function : variation - include path testing Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]]) - * Description: Read the entire file into a string - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing file_get_contents() : variation ***\n"; require_once('fopen_include_path.inc'); @@ -43,8 +37,6 @@ function runtest() { } ?> -===DONE=== --EXPECT-- *** Testing file_get_contents() : variation *** File in include path -===DONE=== diff --git a/ext/standard/tests/file/file_get_contents_variation2.phpt b/ext/standard/tests/file/file_get_contents_variation2.phpt index 8c24246aaa..db3fd365c2 100644 --- a/ext/standard/tests/file/file_get_contents_variation2.phpt +++ b/ext/standard/tests/file/file_get_contents_variation2.phpt @@ -4,12 +4,6 @@ Test file_get_contents() function : variation - include path testing Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]]) - * Description: Read the entire file into a string - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing file_get_contents() : variation ***\n"; @@ -44,8 +38,6 @@ function runtest() { } ?> -===DONE=== --EXPECT-- *** Testing file_get_contents() : variation *** File in script location -===DONE=== diff --git a/ext/standard/tests/file/file_get_contents_variation7-win32-mb.phpt b/ext/standard/tests/file/file_get_contents_variation7-win32-mb.phpt index 0f2c58a86d..c1a0b1960a 100644 --- a/ext/standard/tests/file/file_get_contents_variation7-win32-mb.phpt +++ b/ext/standard/tests/file/file_get_contents_variation7-win32-mb.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype : string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]]) - * Description: Read the entire file into a string - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing file_get_contents() : variation ***\n"; $mainDir = "fileGetContentsVar7ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.dir"; $subDir = "fileGetContentsVar7Subç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™"; @@ -84,12 +78,12 @@ string(%d) "contents read" -- Iteration 5 -- -Warning: file_get_contents(%sfileGetContentsVar7ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.dir\fileGetContentsVar7Subç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™\..\\\fileGetContentsVar7Subç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™\\..\\..\fileGetContentsVar7Subç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™\FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(%sfileGetContentsVar7ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.dir\fileGetContentsVar7Subç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™\..\\\fileGetContentsVar7Subç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™\\..\\..\fileGetContentsVar7Subç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™\FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 6 -- -Warning: file_get_contents(%sfileGetContentsVar7ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.dir\fileGetContentsVar7Subç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™\BADDIR\FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(%sfileGetContentsVar7ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.dir\fileGetContentsVar7Subç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™\BADDIR\FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 7 -- @@ -106,7 +100,7 @@ string(%d) "contents read" -- Iteration 11 -- -Warning: file_get_contents(BADDIR\FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(BADDIR\FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 12 -- diff --git a/ext/standard/tests/file/file_get_contents_variation7-win32.phpt b/ext/standard/tests/file/file_get_contents_variation7-win32.phpt index 8e9f34520a..a18af0ff11 100644 --- a/ext/standard/tests/file/file_get_contents_variation7-win32.phpt +++ b/ext/standard/tests/file/file_get_contents_variation7-win32.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype : string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]]) - * Description: Read the entire file into a string - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing file_get_contents() : variation ***\n"; $mainDir = "fileGetContentsVar7.dir"; $subDir = "fileGetContentsVar7Sub"; @@ -84,12 +78,12 @@ string(%d) "contents read" -- Iteration 5 -- -Warning: file_get_contents(%sfileGetContentsVar7.dir\fileGetContentsVar7Sub\..\\\fileGetContentsVar7Sub\\..\\..\fileGetContentsVar7Sub\FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(%sfileGetContentsVar7.dir\fileGetContentsVar7Sub\..\\\fileGetContentsVar7Sub\\..\\..\fileGetContentsVar7Sub\FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 6 -- -Warning: file_get_contents(%sfileGetContentsVar7.dir\fileGetContentsVar7Sub\BADDIR\FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(%sfileGetContentsVar7.dir\fileGetContentsVar7Sub\BADDIR\FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 7 -- @@ -106,7 +100,7 @@ string(%d) "contents read" -- Iteration 11 -- -Warning: file_get_contents(BADDIR\FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(BADDIR\FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 12 -- diff --git a/ext/standard/tests/file/file_get_contents_variation7.phpt b/ext/standard/tests/file/file_get_contents_variation7.phpt index e2d317a4a0..6af0aaba71 100644 --- a/ext/standard/tests/file/file_get_contents_variation7.phpt +++ b/ext/standard/tests/file/file_get_contents_variation7.phpt @@ -4,12 +4,6 @@ Test file_get_contents() function : variation - various absolute and relative pa Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]]) - * Description: Read the entire file into a string - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing file_get_contents() : variation ***\n"; $mainDir = "fileGetContentsVar7.dir"; $subDir = "fileGetContentsVar7Sub"; @@ -76,12 +70,12 @@ string(%d) "contents read" -- Iteration 5 -- -Warning: file_get_contents(%sfileGetContentsVar7.dir/fileGetContentsVar7Sub/..///fileGetContentsVar7Sub//..//../fileGetContentsVar7Sub/FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(%sfileGetContentsVar7.dir/fileGetContentsVar7Sub/..///fileGetContentsVar7Sub//..//../fileGetContentsVar7Sub/FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 6 -- -Warning: file_get_contents(%sfileGetContentsVar7.dir/fileGetContentsVar7Sub/BADDIR/FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(%sfileGetContentsVar7.dir/fileGetContentsVar7Sub/BADDIR/FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 7 -- @@ -98,7 +92,7 @@ string(%d) "contents read" -- Iteration 11 -- -Warning: file_get_contents(BADDIR/FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(BADDIR/FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d bool(false) *** Done *** diff --git a/ext/standard/tests/file/file_get_contents_variation8-win32.phpt b/ext/standard/tests/file/file_get_contents_variation8-win32.phpt index e8d6238715..d2e39b56bd 100644 --- a/ext/standard/tests/file/file_get_contents_variation8-win32.phpt +++ b/ext/standard/tests/file/file_get_contents_variation8-win32.phpt @@ -12,12 +12,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { obscure_filename --FILE-- <?php -/* Prototype : string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]]) - * Description: Read the entire file into a string - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing file_get_contents() : variation ***\n"; /* An array of filenames */ @@ -40,22 +34,25 @@ $names_arr = array( foreach($names_arr as $key =>$value) { echo "\n-- Filename: $key --\n"; - var_dump(file_get_contents($value)); + try { + var_dump(file_get_contents($value)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } ?> -===Done=== --EXPECTF-- *** Testing file_get_contents() : variation *** -- Filename: -1 -- -Warning: file_get_contents(-1): failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(-1): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Filename: TRUE -- -Warning: file_get_contents(1): failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(1): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Filename: FALSE -- @@ -75,26 +72,21 @@ bool(false) -- Filename: " " -- -Warning: file_get_contents( ): failed to open stream: Permission denied in %s on line %d +Warning: file_get_contents( ): Failed to open stream: Permission denied in %s on line %d bool(false) -- Filename: \0 -- - -Warning: file_get_contents() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +file_get_contents(): Argument #1 ($filename) must be a valid path, string given -- Filename: array() -- - -Warning: file_get_contents() expects parameter 1 to be a valid path, array given in %s on line %d -NULL +file_get_contents(): Argument #1 ($filename) must be a valid path, array given -- Filename: /no/such/file/dir -- -Warning: file_get_contents(/no/such/file/dir): failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(/no/such/file/dir): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Filename: php/php -- -Warning: file_get_contents(php/php): failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(php/php): Failed to open stream: No such file or directory in %s on line %d bool(false) -===Done=== diff --git a/ext/standard/tests/file/file_get_contents_variation8.phpt b/ext/standard/tests/file/file_get_contents_variation8.phpt index 06fd1b3a5f..fb867e28f7 100644 --- a/ext/standard/tests/file/file_get_contents_variation8.phpt +++ b/ext/standard/tests/file/file_get_contents_variation8.phpt @@ -12,12 +12,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { obscure_filename --FILE-- <?php -/* Prototype : string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]]) - * Description: Read the entire file into a string - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing file_get_contents() : variation ***\n"; /* An array of filenames */ $names_arr = array( @@ -39,7 +33,11 @@ $names_arr = array( for( $i=0; $i<count($names_arr); $i++ ) { echo "-- Iteration $i --\n"; - var_dump(file_get_contents($names_arr[$i])); + try { + var_dump(file_get_contents($names_arr[$i])); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } echo "\n*** Done ***\n"; @@ -48,11 +46,11 @@ echo "\n*** Done ***\n"; *** Testing file_get_contents() : variation *** -- Iteration 0 -- -Warning: file_get_contents(-1): failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(-1): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 1 -- -Warning: file_get_contents(1): failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(1): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 2 -- @@ -68,23 +66,19 @@ Warning: file_get_contents(): Filename cannot be empty in %s on line %d bool(false) -- Iteration 5 -- -Warning: file_get_contents( ): failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents( ): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 6 -- - -Warning: file_get_contents() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +file_get_contents(): Argument #1 ($filename) must be a valid path, string given -- Iteration 7 -- - -Warning: file_get_contents() expects parameter 1 to be a valid path, array given in %s on line %d -NULL +file_get_contents(): Argument #1 ($filename) must be a valid path, array given -- Iteration 8 -- -Warning: file_get_contents(/no/such/file/dir): failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(/no/such/file/dir): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 9 -- -Warning: file_get_contents(php/php): failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(php/php): Failed to open stream: No such file or directory in %s on line %d bool(false) *** Done *** diff --git a/ext/standard/tests/file/file_get_contents_variation9.phpt b/ext/standard/tests/file/file_get_contents_variation9.phpt index c5bd75f331..67ec4b3d2a 100644 --- a/ext/standard/tests/file/file_get_contents_variation9.phpt +++ b/ext/standard/tests/file/file_get_contents_variation9.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype : string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]]) - * Description: Read the entire file into a string - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing file_get_contents() : variation ***\n"; $filename = __DIR__.'/fileGetContentsVar9.tmp'; $softlink = __DIR__.'/fileGetContentsVar9.SoftLink'; diff --git a/ext/standard/tests/file/file_put_contents.phpt b/ext/standard/tests/file/file_put_contents.phpt index be2a6ca0ac..f9dc6d1b8e 100644 --- a/ext/standard/tests/file/file_put_contents.phpt +++ b/ext/standard/tests/file/file_put_contents.phpt @@ -11,22 +11,27 @@ $file = __DIR__."/file_put_contents.txt"; $context = stream_context_create(); -var_dump(file_put_contents($file, $context)); +try { + var_dump(file_put_contents($file, $context)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump(file_put_contents($file, new stdClass)); var_dump(file_put_contents($file, new foo)); $fp = fopen($file, "r"); -var_dump(file_put_contents($file, "string", 0, $fp)); +try { + var_dump(file_put_contents($file, "string", 0, $fp)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} @unlink($file); echo "Done\n"; ?> ---EXPECTF-- -Warning: file_put_contents(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +--EXPECT-- +file_put_contents(): supplied resource is not a valid stream resource bool(false) int(15) - -Warning: file_put_contents(): supplied resource is not a valid Stream-Context resource in %s on line %d -int(6) +file_put_contents(): supplied resource is not a valid Stream-Context resource Done diff --git a/ext/standard/tests/file/file_put_contents_variation1.phpt b/ext/standard/tests/file/file_put_contents_variation1.phpt index b6f8815cd0..c67b2e234b 100644 --- a/ext/standard/tests/file/file_put_contents_variation1.phpt +++ b/ext/standard/tests/file/file_put_contents_variation1.phpt @@ -4,12 +4,6 @@ Test file_put_contents() function : variation - test append flag Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : int file_put_contents(string file, mixed data [, int flags [, resource context]]) - * Description: Write/Create a file with contents data and return the number of bytes written - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing file_put_contents() : variation ***\n"; $filename = "FilePutContentsVar1.tmp"; @@ -31,7 +25,6 @@ unlink($filename); ?> -===DONE=== --EXPECT-- *** Testing file_put_contents() : variation *** int(25) @@ -40,4 +33,3 @@ int(18) The first string to write, followed by this 25 The first string to write -===DONE=== diff --git a/ext/standard/tests/file/file_put_contents_variation2.phpt b/ext/standard/tests/file/file_put_contents_variation2.phpt index ae56486d5f..a0c73eca40 100644 --- a/ext/standard/tests/file/file_put_contents_variation2.phpt +++ b/ext/standard/tests/file/file_put_contents_variation2.phpt @@ -4,20 +4,14 @@ Test file_put_contents() function : usage variation - different data types to wr Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : int file_put_contents(string file, mixed data [, int flags [, resource context]]) - * Description: Write/Create a file with contents data and return the number of bytes written - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing file_put_contents() : usage variation ***\n"; // Define error handler -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - if (error_reporting() != 0) { - // report non-silenced errors - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; - } +function test_error_handler($err_no, $err_msg, $filename, $linenum) { + if (error_reporting() & $err_no) { + // report non-silenced errors + echo "Error: $err_no - $err_msg\n"; + } } set_error_handler('test_error_handler'); @@ -34,9 +28,9 @@ unset ($unset_var); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString @@ -109,8 +103,7 @@ foreach($inputs as $key =>$value) { unlink($filename); ?> -===DONE=== ---EXPECTF-- +--EXPECT-- *** Testing file_put_contents() : usage variation *** --int 0-- @@ -138,8 +131,8 @@ unlink($filename); --associative array-- 12 --nested arrays-- -Error: 8 - Array to string conversion, %s(%d) -Error: 8 - Array to string conversion, %s(%d) +Error: 2 - Array to string conversion +Error: 2 - Array to string conversion fooArrayArray --uppercase NULL-- @@ -164,4 +157,3 @@ Class A object --undefined var-- --unset var-- -===DONE=== diff --git a/ext/standard/tests/file/file_put_contents_variation4.phpt b/ext/standard/tests/file/file_put_contents_variation4.phpt index c7df0194ff..4244062b32 100644 --- a/ext/standard/tests/file/file_put_contents_variation4.phpt +++ b/ext/standard/tests/file/file_put_contents_variation4.phpt @@ -4,13 +4,6 @@ Test file_put_contents() function : variation - include path testing Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : int file_put_contents(string file, mixed data [, int flags [, resource context]]) - * Description: Write/Create a file with contents data and return the number of bytes written - * Source code: ext/standard/file.c - * Alias to functions: - */ - - require_once('fopen_include_path.inc'); $thisTestDir = basename(__FILE__, ".php") . ".dir"; @@ -34,7 +27,7 @@ rmdir($thisTestDir); function runtest() { global $filename; - //correct php53 behaviour is to ingnore the FILE_USE_INCLUDE_PATH unless the file alread exists + //correct php53 behaviour is to ignore the FILE_USE_INCLUDE_PATH unless the file already exists // in the include path. In this case it doesn't so the file should be written in the current dir. file_put_contents($filename, "File in include path", FILE_USE_INCLUDE_PATH); $line = file_get_contents($filename); @@ -43,8 +36,6 @@ function runtest() { } ?> -===DONE=== --EXPECT-- File in include path File in include path -===DONE=== diff --git a/ext/standard/tests/file/file_put_contents_variation5.phpt b/ext/standard/tests/file/file_put_contents_variation5.phpt index c069c35a7e..d16db38b14 100644 --- a/ext/standard/tests/file/file_put_contents_variation5.phpt +++ b/ext/standard/tests/file/file_put_contents_variation5.phpt @@ -41,10 +41,8 @@ function runtest() { } } ?> -===DONE=== --EXPECT-- File written in working directory File written in working directory File written in working directory File written in working directory -===DONE=== diff --git a/ext/standard/tests/file/file_put_contents_variation6.phpt b/ext/standard/tests/file/file_put_contents_variation6.phpt index 85f2aad363..fbe4cdfa61 100644 --- a/ext/standard/tests/file/file_put_contents_variation6.phpt +++ b/ext/standard/tests/file/file_put_contents_variation6.phpt @@ -4,12 +4,6 @@ Test file_put_contents() function : variation - include path testing Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : int file_put_contents(string file, mixed data [, int flags [, resource context]]) - * Description: Write/Create a file with contents data and return the number of bytes written - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing file_put_contents() : variation ***\n"; require_once('fopen_include_path.inc'); @@ -47,9 +41,7 @@ function runtest() { } ?> -===DONE=== --EXPECT-- *** Testing file_put_contents() : variation *** File in include path. This was appended File in include path. This was appended -===DONE=== diff --git a/ext/standard/tests/file/file_put_contents_variation7-win32.phpt b/ext/standard/tests/file/file_put_contents_variation7-win32.phpt index 138b4ede84..38e322398d 100644 --- a/ext/standard/tests/file/file_put_contents_variation7-win32.phpt +++ b/ext/standard/tests/file/file_put_contents_variation7-win32.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype : int file_put_contents(string file, mixed data [, int flags [, resource context]]) - * Description: Write/Create a file with contents data and return the number of bytes written - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing file_put_contents() : usage variation ***\n"; $mainDir = "filePutContentsVar7.dir"; @@ -99,12 +93,12 @@ Data written correctly -- Iteration 5 -- -Warning: file_put_contents(%sfilePutContentsVar7.dir\filePutContentsVar7Sub\..\\\filePutContentsVar7Sub\\..\\..\filePutContentsVar7Sub\FileGetContentsVar7.tmp): failed to open stream: %s in %s on line %d +Warning: file_put_contents(%sfilePutContentsVar7.dir\filePutContentsVar7Sub\..\\\filePutContentsVar7Sub\\..\\..\filePutContentsVar7Sub\FileGetContentsVar7.tmp): Failed to open stream: %s in %s on line %d No data written -- Iteration 6 -- -Warning: file_put_contents(%sfilePutContentsVar7.dir\filePutContentsVar7Sub\BADDIR\FileGetContentsVar7.tmp): failed to open stream: %s in %s on line %d +Warning: file_put_contents(%sfilePutContentsVar7.dir\filePutContentsVar7Sub\BADDIR\FileGetContentsVar7.tmp): Failed to open stream: %s in %s on line %d No data written -- Iteration 7 -- @@ -121,7 +115,7 @@ Data written correctly -- Iteration 11 -- -Warning: file_put_contents(BADDIR\FileGetContentsVar7.tmp): failed to open stream: %s in %s on line %d +Warning: file_put_contents(BADDIR\FileGetContentsVar7.tmp): Failed to open stream: %s in %s on line %d No data written -- Iteration 12 -- diff --git a/ext/standard/tests/file/file_put_contents_variation7.phpt b/ext/standard/tests/file/file_put_contents_variation7.phpt index 561c78b374..6e380dc4f6 100644 --- a/ext/standard/tests/file/file_put_contents_variation7.phpt +++ b/ext/standard/tests/file/file_put_contents_variation7.phpt @@ -4,12 +4,6 @@ Test file_put_contents() function : usage variation - various absolute and relat Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : int file_put_contents(string file, mixed data [, int flags [, resource context]]) - * Description: Write/Create a file with contents data and return the number of bytes written - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing file_put_contents() : usage variation ***\n"; $mainDir = "filePutContentsVar7.dir"; @@ -91,12 +85,12 @@ Data written correctly -- Iteration 5 -- -Warning: file_put_contents(%sfilePutContentsVar7.dir/filePutContentsVar7Sub/..///filePutContentsVar7Sub//..//../filePutContentsVar7Sub/FileGetContentsVar7.tmp): failed to open stream: %s in %s on line %d +Warning: file_put_contents(%sfilePutContentsVar7.dir/filePutContentsVar7Sub/..///filePutContentsVar7Sub//..//../filePutContentsVar7Sub/FileGetContentsVar7.tmp): Failed to open stream: %s in %s on line %d No data written -- Iteration 6 -- -Warning: file_put_contents(%sfilePutContentsVar7.dir/filePutContentsVar7Sub/BADDIR/FileGetContentsVar7.tmp): failed to open stream: %s in %s on line %d +Warning: file_put_contents(%sfilePutContentsVar7.dir/filePutContentsVar7Sub/BADDIR/FileGetContentsVar7.tmp): Failed to open stream: %s in %s on line %d No data written -- Iteration 7 -- @@ -113,7 +107,7 @@ Data written correctly -- Iteration 11 -- -Warning: file_put_contents(BADDIR/FileGetContentsVar7.tmp): failed to open stream: %s in %s on line %d +Warning: file_put_contents(BADDIR/FileGetContentsVar7.tmp): Failed to open stream: %s in %s on line %d No data written *** Done *** diff --git a/ext/standard/tests/file/file_put_contents_variation8-win32.phpt b/ext/standard/tests/file/file_put_contents_variation8-win32.phpt index c21c2da986..5246a5af23 100644 --- a/ext/standard/tests/file/file_put_contents_variation8-win32.phpt +++ b/ext/standard/tests/file/file_put_contents_variation8-win32.phpt @@ -11,12 +11,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") obscure_filename --FILE-- <?php -/* Prototype : int file_put_contents(string file, mixed data [, int flags [, resource context]]) - * Description: Write/Create a file with contents data and return the number of bytes written - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing file_put_contents() : usage variation ***\n"; /* An array of filenames */ @@ -37,18 +31,21 @@ $names_arr = array( ); foreach($names_arr as $key =>$value) { - echo "\n-- Filename: $key --\n"; - $res = file_put_contents($value, "Some data"); - if ($res !== false && $res != null) { - echo "$res bytes written to: $value\n"; - unlink($value); - } else { - echo "Failed to write data to: $key\n"; - } + echo "\n-- Filename: $key --\n"; + try { + $res = file_put_contents($value, "Some data"); + if ($res !== false && $res != null) { + echo "$res bytes written to: $value\n"; + unlink($value); + } else { + echo "Failed to write data to: $key\n"; + } + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } }; ?> -===Done=== --EXPECTF-- *** Testing file_put_contents() : usage variation *** @@ -75,26 +72,21 @@ Failed to write data to: "" -- Filename: " " -- -Warning: file_put_contents( ): failed to open stream: Permission denied in %s on line %d +Warning: file_put_contents( ): Failed to open stream: Permission denied in %s on line %d Failed to write data to: " " -- Filename: \0 -- - -Warning: file_put_contents() expects parameter 1 to be a valid path, string given in %s on line %d -Failed to write data to: \0 +file_put_contents(): Argument #1 ($filename) must be a valid path, string given -- Filename: array() -- - -Warning: file_put_contents() expects parameter 1 to be a valid path, array given in %s on line %d -Failed to write data to: array() +file_put_contents(): Argument #1 ($filename) must be a valid path, array given -- Filename: /no/such/file/dir -- -Warning: file_put_contents(/no/such/file/dir): failed to open stream: %s in %s on line %d +Warning: file_put_contents(/no/such/file/dir): Failed to open stream: %s in %s on line %d Failed to write data to: /no/such/file/dir -- Filename: php/php -- -Warning: file_put_contents(php/php): failed to open stream: %s in %s on line %d +Warning: file_put_contents(php/php): Failed to open stream: %s in %s on line %d Failed to write data to: php/php -===Done=== diff --git a/ext/standard/tests/file/file_put_contents_variation8.phpt b/ext/standard/tests/file/file_put_contents_variation8.phpt Binary files differindex 497c68b2bb..63ac4b56fd 100644 --- a/ext/standard/tests/file/file_put_contents_variation8.phpt +++ b/ext/standard/tests/file/file_put_contents_variation8.phpt diff --git a/ext/standard/tests/file/file_put_contents_variation9.phpt b/ext/standard/tests/file/file_put_contents_variation9.phpt index 554ce344e7..03b72d178f 100644 --- a/ext/standard/tests/file/file_put_contents_variation9.phpt +++ b/ext/standard/tests/file/file_put_contents_variation9.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype : int file_put_contents(string file, mixed data [, int flags [, resource context]]) - * Description: Write/Create a file with contents data and return the number of bytes written - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing file_put_contents() : usage variation ***\n"; $filename = __DIR__.'/filePutContentsVar9.tmp'; diff --git a/ext/standard/tests/file/file_variation.phpt b/ext/standard/tests/file/file_variation.phpt index c430845335..2c46f039c2 100644 --- a/ext/standard/tests/file/file_variation.phpt +++ b/ext/standard/tests/file/file_variation.phpt @@ -2,11 +2,6 @@ Test file() function : usage variations --FILE-- <?php -/* - * Prototype: array file ( string filename [,int use-include_path [,resource context]] ); - * Description: Reads entire file into an array - Returns the file in an array - */ require(__DIR__ . '/file.inc'); $data_array = array( "Garbage data", "Gar\nba\nge d\nata", "Gar\n\nbage \n\n data" ); diff --git a/ext/standard/tests/file/file_variation6.phpt b/ext/standard/tests/file/file_variation6.phpt index 7e34f285d3..354f6ee509 100644 --- a/ext/standard/tests/file/file_variation6.phpt +++ b/ext/standard/tests/file/file_variation6.phpt @@ -9,13 +9,17 @@ fwrite($fd, "Line 1\nLine 2\nLine 3"); fclose($fd); for ($flags = 0; $flags <= 32; $flags++) { - var_dump(file($filepath, $flags)); + try { + var_dump(file($filepath, $flags)); + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; + } } unlink($filepath); ?> ---EXPECTF-- +--EXPECT-- array(3) { [0]=> string(7) "Line 1 @@ -232,30 +236,12 @@ array(3) { [2]=> string(6) "Line 3" } - -Warning: file(): '24' flag is not supported in %s on line %d -bool(false) - -Warning: file(): '25' flag is not supported in %s on line %d -bool(false) - -Warning: file(): '26' flag is not supported in %s on line %d -bool(false) - -Warning: file(): '27' flag is not supported in %s on line %d -bool(false) - -Warning: file(): '28' flag is not supported in %s on line %d -bool(false) - -Warning: file(): '29' flag is not supported in %s on line %d -bool(false) - -Warning: file(): '30' flag is not supported in %s on line %d -bool(false) - -Warning: file(): '31' flag is not supported in %s on line %d -bool(false) - -Warning: file(): '32' flag is not supported in %s on line %d -bool(false) +file(): Argument #2 ($flags) must be a valid flag value +file(): Argument #2 ($flags) must be a valid flag value +file(): Argument #2 ($flags) must be a valid flag value +file(): Argument #2 ($flags) must be a valid flag value +file(): Argument #2 ($flags) must be a valid flag value +file(): Argument #2 ($flags) must be a valid flag value +file(): Argument #2 ($flags) must be a valid flag value +file(): Argument #2 ($flags) must be a valid flag value +file(): Argument #2 ($flags) must be a valid flag value diff --git a/ext/standard/tests/file/file_variation8-win32.phpt b/ext/standard/tests/file/file_variation8-win32.phpt index b5a2004473..511bc0eb7c 100644 --- a/ext/standard/tests/file/file_variation8-win32.phpt +++ b/ext/standard/tests/file/file_variation8-win32.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype : array file(string filename [, int flags[, resource context]]) - * Description: Read entire file into an array - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing file() : variation ***\n"; $mainDir = "fileVar8.dir"; $subDir = "fileVar8Sub"; @@ -96,12 +90,12 @@ array(1) { -- Iteration 5 -- -Warning: file(%sfileVar8.dir\fileVar8Sub\..\\\fileVar8Sub\\..\\..\fileVar8Sub\FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: file(%sfileVar8.dir\fileVar8Sub\..\\\fileVar8Sub\\..\\..\fileVar8Sub\FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 6 -- -Warning: file(%sfileVar8.dir\fileVar8Sub\BADDIR\FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: file(%sfileVar8.dir\fileVar8Sub\BADDIR\FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 7 -- @@ -130,7 +124,7 @@ array(1) { -- Iteration 11 -- -Warning: file(BADDIR\FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: file(BADDIR\FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 12 -- diff --git a/ext/standard/tests/file/file_variation8.phpt b/ext/standard/tests/file/file_variation8.phpt index f56ca9af7d..f42925043d 100644 --- a/ext/standard/tests/file/file_variation8.phpt +++ b/ext/standard/tests/file/file_variation8.phpt @@ -4,12 +4,6 @@ Test file function : variation - various absolute and relative paths Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : array file(string filename [, int flags[, resource context]]) - * Description: Read entire file into an array - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing file() : variation ***\n"; $mainDir = "fileVar8.dir"; $subDir = "fileVar8Sub"; @@ -88,12 +82,12 @@ array(1) { -- Iteration 5 -- -Warning: file(%sfileVar8.dir/fileVar8Sub/..///fileVar8Sub//..//../fileVar8Sub/FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: file(%sfileVar8.dir/fileVar8Sub/..///fileVar8Sub//..//../fileVar8Sub/FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 6 -- -Warning: file(%sfileVar8.dir/fileVar8Sub/BADDIR/FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: file(%sfileVar8.dir/fileVar8Sub/BADDIR/FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 7 -- @@ -122,7 +116,7 @@ array(1) { -- Iteration 11 -- -Warning: file(BADDIR/FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: file(BADDIR/FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d bool(false) *** Done *** diff --git a/ext/standard/tests/file/file_variation9.phpt b/ext/standard/tests/file/file_variation9.phpt index 13860878d9..326a56ca27 100644 --- a/ext/standard/tests/file/file_variation9.phpt +++ b/ext/standard/tests/file/file_variation9.phpt @@ -4,12 +4,6 @@ Test file function : variation - test various endings of a file Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : array file(string filename [, int flags[, resource context]]) - * Description: Read entire file into an array - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing file() : variation ***\n"; $testfile = __DIR__."/fileVar9.txt"; @@ -27,7 +21,7 @@ foreach ($contents as $content) { fwrite($h, $content); fclose($h); var_dump(file($testfile)); - unlink($testfile); + unlink($testfile); } echo "\n*** Done ***\n"; diff --git a/ext/standard/tests/file/filegroup_basic.phpt b/ext/standard/tests/file/filegroup_basic.phpt index ff546501ed..6d8c82ffd6 100644 --- a/ext/standard/tests/file/filegroup_basic.phpt +++ b/ext/standard/tests/file/filegroup_basic.phpt @@ -8,9 +8,6 @@ if( substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype: int filegroup ( string $filename ) - * Description: Returns the group ID of the file, or FALSE in case of an error. - */ echo "*** Testing filegroup(): basic functionality ***\n"; diff --git a/ext/standard/tests/file/filegroup_error.phpt b/ext/standard/tests/file/filegroup_error.phpt index e32711cd5b..f65336be6f 100644 --- a/ext/standard/tests/file/filegroup_error.phpt +++ b/ext/standard/tests/file/filegroup_error.phpt @@ -2,9 +2,6 @@ Test filegroup() function: error conditions --FILE-- <?php -/* Prototype: int filegroup ( string $filename ) - * Description: Returns the group ID of the file, or FALSE in case of an error. - */ echo "*** Testing filegroup(): error conditions ***\n"; @@ -15,10 +12,6 @@ var_dump( filegroup("/no/such/file/dir") ); var_dump( filegroup("string") ); var_dump( filegroup(100) ); -/* Invalid no.of arguments */ -var_dump( filegroup() ); // args < expected -var_dump( filegroup("/no/such/file", "root") ); // args > expected - echo "\n*** Done ***\n"; ?> --EXPECTF-- @@ -33,10 +26,4 @@ bool(false) Warning: filegroup(): stat failed for 100 in %s on line %d bool(false) -Warning: filegroup() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: filegroup() expects exactly 1 parameter, 2 given in %s on line %d -NULL - *** Done *** diff --git a/ext/standard/tests/file/filegroup_variation1.phpt b/ext/standard/tests/file/filegroup_variation1.phpt index 06c39cfbda..206f6639c1 100644 --- a/ext/standard/tests/file/filegroup_variation1.phpt +++ b/ext/standard/tests/file/filegroup_variation1.phpt @@ -9,10 +9,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { } --FILE-- <?php -/* Prototype: int filegroup ( string $filename ) - * Description: Returns the group ID of the file, or FALSE in case of an error. - */ - /* Creating soft and hard links to a file and applying filegroup() on links */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/filegroup_variation2.phpt b/ext/standard/tests/file/filegroup_variation2.phpt index 030f97a0f8..85ee170660 100644 --- a/ext/standard/tests/file/filegroup_variation2.phpt +++ b/ext/standard/tests/file/filegroup_variation2.phpt @@ -6,14 +6,9 @@ Dave Kelsey <d_kelsey@uk.ibm.com> obscure_filename --FILE-- <?php -/* Prototype: int filegroup ( string $filename ) - * Description: Returns the group ID of the file, or FALSE in case of an error. - */ - /* Testing filegroup() with invalid arguments -int, float, bool, NULL, resource */ $file_path = __DIR__; -$file_handle = fopen($file_path."/filegroup_variation2.tmp", "w"); echo "*** Testing Invalid file types ***\n"; $filenames = array( @@ -24,7 +19,6 @@ $filenames = array( TRUE, FALSE, NULL, - $file_handle, /* scalars */ 1234, @@ -36,7 +30,6 @@ foreach( $filenames as $filename ) { var_dump( filegroup($filename) ); clearstatcache(); } -fclose($file_handle); ?> --CLEAN-- <?php @@ -58,9 +51,6 @@ bool(false) bool(false) bool(false) -Warning: filegroup() expects parameter 1 to be a valid path, resource given in %s on line %d -NULL - Warning: filegroup(): stat failed for 1234 in %s on line %d bool(false) diff --git a/ext/standard/tests/file/filegroup_variation3.phpt b/ext/standard/tests/file/filegroup_variation3.phpt index a43a54da0d..47f519275e 100644 --- a/ext/standard/tests/file/filegroup_variation3.phpt +++ b/ext/standard/tests/file/filegroup_variation3.phpt @@ -4,9 +4,6 @@ Test filegroup() function: usage variations - diff. path notations Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype: int filegroup ( string $filename ) - * Description: Returns the group ID of the file, or FALSE in case of an error. - */ /* Passing file names with different notations, using slashes, wild-card chars */ @@ -39,7 +36,11 @@ $count = 1; /* loop through to test each element in the above array */ foreach($files_arr as $file) { echo "- Iteration $count -\n"; - var_dump( filegroup( $file_path."/".$file ) ); + try { + var_dump( filegroup( $file_path."/".$file ) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } clearstatcache(); $count++; } @@ -74,12 +75,8 @@ bool(false) Warning: filegroup(): stat failed for %s/filegroup_variation3/filegroup*.tmp in %s on line %d bool(false) - Iteration 7 - - -Warning: filegroup() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +filegroup(): Argument #1 ($filename) must be a valid path, string given - Iteration 8 - - -Warning: filegroup() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +filegroup(): Argument #1 ($filename) must be a valid path, string given *** Done *** diff --git a/ext/standard/tests/file/fileinode_basic.phpt b/ext/standard/tests/file/fileinode_basic.phpt index c468d2025f..473c0fdcca 100644 --- a/ext/standard/tests/file/fileinode_basic.phpt +++ b/ext/standard/tests/file/fileinode_basic.phpt @@ -2,11 +2,6 @@ Test fileinode() function: Basic functionality --FILE-- <?php -/* -Prototype: int fileinode ( string $filename ); -Description: Returns the inode number of the file, or FALSE in case of an error. -*/ - echo "*** Testing fileinode() with file, directory ***\n"; /* Getting inode of created file */ diff --git a/ext/standard/tests/file/fileinode_error.phpt b/ext/standard/tests/file/fileinode_error.phpt index 462ab62367..698dd08195 100644 --- a/ext/standard/tests/file/fileinode_error.phpt +++ b/ext/standard/tests/file/fileinode_error.phpt @@ -2,11 +2,6 @@ Test fileinode() function: Error conditions --FILE-- <?php -/* -Prototype: int fileinode ( string $filename ); -Description: Returns the inode number of the file, or FALSE in case of an error. -*/ - echo "*** Testing error conditions of fileinode() ***"; /* Non-existing file or dir */ @@ -16,28 +11,16 @@ var_dump( fileinode("/no/such/file/dir") ); var_dump( fileinode("string") ); var_dump( fileinode(100) ); -/* No.of arguments less than expected */ -var_dump( fileinode() ); - -/* No.of arguments greater than expected */ -var_dump( fileinode(__FILE__, "string") ); - echo "\n*** Done ***"; --EXPECTF-- *** Testing error conditions of fileinode() *** -Warning: fileinode(): stat failed for /no/such/file/dir in %s on line 10 +Warning: fileinode(): stat failed for /no/such/file/dir in %s on line %d bool(false) -Warning: fileinode(): stat failed for string in %s on line 13 +Warning: fileinode(): stat failed for string in %s on line %d bool(false) -Warning: fileinode(): stat failed for 100 in %s on line 14 +Warning: fileinode(): stat failed for 100 in %s on line %d bool(false) -Warning: fileinode() expects exactly 1 parameter, 0 given in %s on line 17 -NULL - -Warning: fileinode() expects exactly 1 parameter, 2 given in %s on line 20 -NULL - *** Done *** diff --git a/ext/standard/tests/file/fileinode_variation.phpt b/ext/standard/tests/file/fileinode_variation.phpt index d8f59faefc..cf25867218 100644 --- a/ext/standard/tests/file/fileinode_variation.phpt +++ b/ext/standard/tests/file/fileinode_variation.phpt @@ -9,11 +9,6 @@ if (PHP_OS_FAMILY === 'Windows') { ?> --FILE-- <?php -/* -Prototype: int fileinode ( string $filename ); -Description: Returns the inode number of the file, or FALSE in case of an error. -*/ - echo "*** Testing fileinode() with files, links and directories ***\n"; $file_path = __DIR__; $file1 = $file_path."/fileinode1_variation.tmp"; diff --git a/ext/standard/tests/file/fileinode_variation1.phpt b/ext/standard/tests/file/fileinode_variation1.phpt index 49cc6a937d..dcf468e5f5 100644 --- a/ext/standard/tests/file/fileinode_variation1.phpt +++ b/ext/standard/tests/file/fileinode_variation1.phpt @@ -9,11 +9,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { } --FILE-- <?php -/* -Prototype: int fileinode ( string $filename ); -Description: Returns the inode number of the file, or FALSE in case of an error. -*/ - /* Creating soft and hard links to a file and applying fileinode() on links */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/fileinode_variation2.phpt b/ext/standard/tests/file/fileinode_variation2.phpt index 71cdc395a6..d8593733a8 100644 --- a/ext/standard/tests/file/fileinode_variation2.phpt +++ b/ext/standard/tests/file/fileinode_variation2.phpt @@ -6,15 +6,9 @@ Dave Kelsey <d_kelsey@uk.ibm.com> obscure_filename --FILE-- <?php -/* -Prototype: int fileinode ( string $filename ); -Description: Returns the inode number of the file, or FALSE in case of an error. -*/ - /* Testing fileinode() with invalid arguments -int, float, bool, NULL, resource */ $file_path = __DIR__; -$file_handle = fopen($file_path."/fileinode_variation2.tmp", "w"); echo "*** Testing Invalid file types ***\n"; $filenames = array( @@ -25,7 +19,6 @@ $filenames = array( TRUE, FALSE, NULL, - $file_handle, /* scalars */ 1234, @@ -37,7 +30,6 @@ foreach( $filenames as $filename ) { var_dump( fileinode($filename) ); clearstatcache(); } -fclose($file_handle); ?> --CLEAN-- <?php @@ -59,9 +51,6 @@ bool(false) bool(false) bool(false) -Warning: fileinode() expects parameter 1 to be a valid path, resource given in %s on line %d -NULL - Warning: fileinode(): stat failed for 1234 in %s on line %d bool(false) diff --git a/ext/standard/tests/file/fileinode_variation3.phpt b/ext/standard/tests/file/fileinode_variation3.phpt index 72dfcbdc55..cf85f6160b 100644 --- a/ext/standard/tests/file/fileinode_variation3.phpt +++ b/ext/standard/tests/file/fileinode_variation3.phpt @@ -4,11 +4,6 @@ Test fileinode() function: usage variations - diff. path notations Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* -Prototype: int fileinode ( string $filename ); -Description: Returns the inode number of the file, or FALSE in case of an error. -*/ - /* Passing file names with different notations, using slashes, wild-card chars */ $file_path = __DIR__; @@ -40,7 +35,11 @@ $count = 1; /* loop through to test each element in the above array */ foreach($files_arr as $file) { echo "- Iteration $count -\n"; - var_dump( fileinode( $file_path."/".$file ) ); + try { + var_dump( fileinode( $file_path."/".$file ) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } clearstatcache(); $count++; } @@ -75,12 +74,8 @@ bool(false) Warning: fileinode(): stat failed for %s/fileinode_variation3/fileinode*.tmp in %s on line %d bool(false) - Iteration 7 - - -Warning: fileinode() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fileinode(): Argument #1 ($filename) must be a valid path, string given - Iteration 8 - - -Warning: fileinode() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fileinode(): Argument #1 ($filename) must be a valid path, string given *** Done *** diff --git a/ext/standard/tests/file/fileowner_basic.phpt b/ext/standard/tests/file/fileowner_basic.phpt index 9bb0827ec8..faf6656a69 100644 --- a/ext/standard/tests/file/fileowner_basic.phpt +++ b/ext/standard/tests/file/fileowner_basic.phpt @@ -2,11 +2,6 @@ Test fileowner() function: basic functionality --FILE-- <?php -/* Prototype: int fileowner ( string $filename ) - * Description: Returns the user ID of the owner of the file, or - * FALSE in case of an error. - */ - echo "*** Testing fileowner(): basic functionality ***\n"; echo "-- Testing with the file or directory created by owner --\n"; diff --git a/ext/standard/tests/file/fileowner_error.phpt b/ext/standard/tests/file/fileowner_error.phpt index 967a541cc0..c4013a915c 100644 --- a/ext/standard/tests/file/fileowner_error.phpt +++ b/ext/standard/tests/file/fileowner_error.phpt @@ -2,10 +2,6 @@ Test of fileowner() function: error conditions --FILE-- <?php -/* Prototype: int fileowner ( string $filename ) - * Description: Returns the user ID of the owner of the file, or - * FALSE in case of an error. - */ echo "*** Testing fileowner(): error conditions ***\n"; /* Non-existing file or dir */ @@ -15,10 +11,6 @@ var_dump( fileowner("/no/such/file/dir") ); var_dump( fileowner("string") ); var_dump( fileowner(100) ); -/* Invalid no.of arguments */ -var_dump( fileowner() ); // args < expected -var_dump( fileowner("/no/such/file", "root") ); // args > expected - echo "\n*** Done ***\n"; ?> --EXPECTF-- @@ -33,10 +25,4 @@ bool(false) Warning: fileowner(): stat failed for 100 in %s on line %d bool(false) -Warning: fileowner() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: fileowner() expects exactly 1 parameter, 2 given in %s on line %d -NULL - *** Done *** diff --git a/ext/standard/tests/file/fileowner_variation1.phpt b/ext/standard/tests/file/fileowner_variation1.phpt index 03602092e3..d78c449786 100644 --- a/ext/standard/tests/file/fileowner_variation1.phpt +++ b/ext/standard/tests/file/fileowner_variation1.phpt @@ -9,10 +9,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { } --FILE-- <?php -/* Prototype: int fileowner ( string $filename ) - * Description: Returns the user ID of the owner of the file, or - * FALSE in case of an error. - */ /* Creating soft and hard links to a file and applying fileowner() on links */ diff --git a/ext/standard/tests/file/fileowner_variation2.phpt b/ext/standard/tests/file/fileowner_variation2.phpt index 4be8f58682..752fa1d6ef 100644 --- a/ext/standard/tests/file/fileowner_variation2.phpt +++ b/ext/standard/tests/file/fileowner_variation2.phpt @@ -6,15 +6,10 @@ Dave Kelsey <d_kelsey@uk.ibm.com> obscure_filename --FILE-- <?php -/* Prototype: int fileowner ( string $filename ) - * Description: Returns the user ID of the owner of the file, or - * FALSE in case of an error. - */ /* Testing fileowner() with invalid arguments -int, float, bool, NULL, resource */ $file_path = __DIR__; -$file_handle = fopen($file_path."/fileowner_variation2.tmp", "w"); echo "*** Testing Invalid file types ***\n"; $filenames = array( @@ -25,7 +20,6 @@ $filenames = array( TRUE, FALSE, NULL, - $file_handle, /* scalars */ 1234, @@ -37,7 +31,6 @@ foreach( $filenames as $filename ) { var_dump( fileowner($filename) ); clearstatcache(); } -fclose($file_handle); ?> --CLEAN-- <?php @@ -59,9 +52,6 @@ bool(false) bool(false) bool(false) -Warning: fileowner() expects parameter 1 to be a valid path, resource given in %s on line %d -NULL - Warning: fileowner(): stat failed for 1234 in %s on line %d bool(false) diff --git a/ext/standard/tests/file/fileowner_variation3.phpt b/ext/standard/tests/file/fileowner_variation3.phpt index e5d8852776..df392f8f36 100644 --- a/ext/standard/tests/file/fileowner_variation3.phpt +++ b/ext/standard/tests/file/fileowner_variation3.phpt @@ -4,10 +4,6 @@ Test fileowner() function: usage variations - diff. path notations Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype: int fileowner ( string $filename ) - * Description: Returns the user ID of the owner of the file, or - * FALSE in case of an error. - */ /* Passing file names with different notations, using slashes, wild-card chars */ @@ -40,7 +36,11 @@ $count = 1; /* loop through to test each element in the above array */ foreach($files_arr as $file) { echo "- Iteration $count -\n"; - var_dump( fileowner( $file_path."/".$file ) ); + try { + var_dump( fileowner( $file_path."/".$file ) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } clearstatcache(); $count++; } @@ -75,12 +75,8 @@ bool(false) Warning: fileowner(): stat failed for %s/fileowner_variation3/fileowner*.tmp in %s on line %d bool(false) - Iteration 7 - - -Warning: fileowner() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fileowner(): Argument #1 ($filename) must be a valid path, string given - Iteration 8 - - -Warning: fileowner() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fileowner(): Argument #1 ($filename) must be a valid path, string given *** Done *** diff --git a/ext/standard/tests/file/fileperms_variation1.phpt b/ext/standard/tests/file/fileperms_variation1.phpt index b3ea2d5cf6..1bb692bdde 100644 --- a/ext/standard/tests/file/fileperms_variation1.phpt +++ b/ext/standard/tests/file/fileperms_variation1.phpt @@ -9,9 +9,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { } --FILE-- <?php -/* Prototype: int fileperms ( string $filename ) - * Description: Returns the group ID of the file, or FALSE in case of an error. - */ /* Creating soft and hard links to a file and applying fileperms() on links */ diff --git a/ext/standard/tests/file/fileperms_variation2.phpt b/ext/standard/tests/file/fileperms_variation2.phpt index d45da017cc..9c9d263ebe 100644 --- a/ext/standard/tests/file/fileperms_variation2.phpt +++ b/ext/standard/tests/file/fileperms_variation2.phpt @@ -6,14 +6,9 @@ Dave Kelsey <d_kelsey@uk.ibm.com> obscure_filename --FILE-- <?php -/* Prototype: int fileperms ( string $filename ) - * Description: Returns the group ID of the file, or FALSE in case of an error. - */ - /* Testing fileperms() with invalid arguments -int, float, bool, NULL, resource */ $file_path = __DIR__; -$file_handle = fopen($file_path."/fileperms_variation2.tmp", "w"); echo "*** Testing Invalid file types ***\n"; $filenames = array( @@ -24,7 +19,6 @@ $filenames = array( TRUE, FALSE, NULL, - $file_handle, /* scalars */ 1234, @@ -36,7 +30,6 @@ foreach( $filenames as $filename ) { var_dump( fileperms($filename) ); clearstatcache(); } -fclose($file_handle); ?> --CLEAN-- <?php @@ -58,9 +51,6 @@ bool(false) bool(false) bool(false) -Warning: fileperms() expects parameter 1 to be a valid path, resource given in %s on line %d -NULL - Warning: fileperms(): stat failed for 1234 in %s on line %d bool(false) diff --git a/ext/standard/tests/file/fileperms_variation3.phpt b/ext/standard/tests/file/fileperms_variation3.phpt index 6a4aacdc6d..9a4f40b269 100644 --- a/ext/standard/tests/file/fileperms_variation3.phpt +++ b/ext/standard/tests/file/fileperms_variation3.phpt @@ -4,10 +4,6 @@ Test fileperms() function: usage variations - diff. path notations Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype: int fileperms ( string $filename ) - * Description: Returns the group ID of the file, or FALSE in case of an error. - */ - /* Passing file names with different notations, using slashes, wild-card chars */ $file_path = __DIR__; @@ -39,7 +35,11 @@ $count = 1; /* loop through to test each element in the above array */ foreach($files_arr as $file) { echo "- Iteration $count -\n"; - var_dump( fileperms( $file_path."/".$file ) ); + try { + var_dump( fileperms( $file_path."/".$file ) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } clearstatcache(); $count++; } @@ -74,12 +74,8 @@ bool(false) Warning: fileperms(): stat failed for %s/fileperms_variation3/fileperms*.tmp in %s on line %d bool(false) - Iteration 7 - - -Warning: fileperms() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fileperms(): Argument #1 ($filename) must be a valid path, string given - Iteration 8 - - -Warning: fileperms() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fileperms(): Argument #1 ($filename) must be a valid path, string given *** Done *** diff --git a/ext/standard/tests/file/filesize_basic.phpt b/ext/standard/tests/file/filesize_basic.phpt index 09c3352f62..e26592c99e 100644 --- a/ext/standard/tests/file/filesize_basic.phpt +++ b/ext/standard/tests/file/filesize_basic.phpt @@ -2,13 +2,6 @@ Test filesize() function: basic functionaity --FILE-- <?php -/* - * Prototype: int filesize ( string $filename ); - * Description: Returns the size of the file in bytes, or FALSE - * (and generates an error of level E_WARNING) in case of an error. - */ - - echo "*** Testing size of files and directories with filesize() ***\n"; $file_path = __DIR__; diff --git a/ext/standard/tests/file/filesize_error.phpt b/ext/standard/tests/file/filesize_error.phpt index 9f721ff921..5d5acae2af 100644 --- a/ext/standard/tests/file/filesize_error.phpt +++ b/ext/standard/tests/file/filesize_error.phpt @@ -2,25 +2,12 @@ Test filesize() function: error conditions --FILE-- <?php -/* - * Prototype : int filesize ( string $filename ); - * Description : Returns the size of the file in bytes, or FALSE - * (and generates an error of level E_WARNING) in case of an error. - */ - echo "*** Testing filesize(): error conditions ***"; /* Non-existing file or dir */ var_dump( filesize("/no/such/file") ); var_dump( filesize("/no/such/dir") ); -/* No.of arguments less than expected */ -var_dump( filesize() ); - -/* No.of arguments greater than expected */ -var_dump( filesize(__FILE__, 2000) ); -echo "\n"; - echo "*** Done ***\n"; ?> --EXPECTF-- @@ -30,11 +17,4 @@ bool(false) Warning: filesize(): stat failed for /no/such/dir in %s on line %d bool(false) - -Warning: filesize() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: filesize() expects exactly 1 parameter, 2 given in %s on line %d -NULL - *** Done *** diff --git a/ext/standard/tests/file/filesize_variation1-win32-mb.phpt b/ext/standard/tests/file/filesize_variation1-win32-mb.phpt index 73d37c9ec3..3253256ef1 100644 --- a/ext/standard/tests/file/filesize_variation1-win32-mb.phpt +++ b/ext/standard/tests/file/filesize_variation1-win32-mb.phpt @@ -7,12 +7,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { } --FILE-- <?php -/* - Prototype : int filesize ( string $filename ); - Description : Returns the size of the file in bytes, or FALSE - (and generates an error of level E_WARNING) in case of an error. -*/ - $file_path = __DIR__; require($file_path."/file.inc"); diff --git a/ext/standard/tests/file/filesize_variation1-win32.phpt b/ext/standard/tests/file/filesize_variation1-win32.phpt index b312d09fc1..3b784820ac 100644 --- a/ext/standard/tests/file/filesize_variation1-win32.phpt +++ b/ext/standard/tests/file/filesize_variation1-win32.phpt @@ -7,12 +7,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { } --FILE-- <?php -/* - Prototype : int filesize ( string $filename ); - Description : Returns the size of the file in bytes, or FALSE - (and generates an error of level E_WARNING) in case of an error. -*/ - $file_path = __DIR__; require($file_path."/file.inc"); diff --git a/ext/standard/tests/file/filesize_variation1.phpt b/ext/standard/tests/file/filesize_variation1.phpt index e9a5af86ba..8dd974947b 100644 --- a/ext/standard/tests/file/filesize_variation1.phpt +++ b/ext/standard/tests/file/filesize_variation1.phpt @@ -7,12 +7,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { } --FILE-- <?php -/* - Prototype : int filesize ( string $filename ); - Description : Returns the size of the file in bytes, or FALSE - (and generates an error of level E_WARNING) in case of an error. -*/ - $file_path = __DIR__; require($file_path."/file.inc"); diff --git a/ext/standard/tests/file/filesize_variation2-win32.phpt b/ext/standard/tests/file/filesize_variation2-win32.phpt index 06cef27bc6..de475bbea8 100644 --- a/ext/standard/tests/file/filesize_variation2-win32.phpt +++ b/ext/standard/tests/file/filesize_variation2-win32.phpt @@ -7,12 +7,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { } --FILE-- <?php -/* - Prototype : int filesize ( string $filename ); - Description : Returns the size of the file in bytes, or FALSE - (and generates an error of level E_WARNING) in case of an error. -*/ - $file_path = __DIR__; require($file_path."/file.inc"); diff --git a/ext/standard/tests/file/filesize_variation2.phpt b/ext/standard/tests/file/filesize_variation2.phpt index 851d2d526a..b885d93894 100644 --- a/ext/standard/tests/file/filesize_variation2.phpt +++ b/ext/standard/tests/file/filesize_variation2.phpt @@ -7,12 +7,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { } --FILE-- <?php -/* - Prototype : int filesize ( string $filename ); - Description : Returns the size of the file in bytes, or FALSE - (and generates an error of level E_WARNING) in case of an error. -*/ - $file_path = __DIR__; require($file_path."/file.inc"); diff --git a/ext/standard/tests/file/filesize_variation3-win32.phpt b/ext/standard/tests/file/filesize_variation3-win32.phpt deleted file mode 100644 index 67b97a8009..0000000000 --- a/ext/standard/tests/file/filesize_variation3-win32.phpt +++ /dev/null @@ -1,72 +0,0 @@ ---TEST-- -Test filesize() function: usage variations - file size after truncate ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die('skip only valid for Windows'); -} ---FILE-- -<?php -/* - Prototype : int filesize ( string $filename ); - Description : Returns the size of the file in bytes, or FALSE - (and generates an error of level E_WARNING) in case of an error. -*/ - -$file_path = __DIR__; - -echo "*** Testing filesize(): usage variations ***\n"; -$filename = $file_path."/filesize_variation3.tmp"; -$file_handle = fopen($filename, "w"); -fwrite($file_handle, str_repeat("Hello,World ", 1000) ); // create file of size 12000 bytes -fclose($file_handle); - -echo "-- Testing filesize() after truncating the file to a new length --\n"; -// truncate the file created earlier in subdir, the size of the file is 12000bytes -// truncate the same file, in the loop , each time with the decrement in size by 1200 bytes, -// until -1200bytes size -for($size = filesize($filename); $size>=-1200; $size-=1200) { - $file_handle = fopen($filename, "r+"); - var_dump( ftruncate($file_handle, $size) ); - fclose($file_handle); - var_dump( filesize($filename) ); - clearstatcache(); -} - -echo "*** Done ***\n"; -?> ---CLEAN-- -<?php -$file_path = __DIR__; -unlink($file_path."/filesize_variation3.tmp"); -?> ---EXPECTF-- -*** Testing filesize(): usage variations *** --- Testing filesize() after truncating the file to a new length -- -bool(true) -int(12000) -bool(true) -int(10800) -bool(true) -int(9600) -bool(true) -int(8400) -bool(true) -int(7200) -bool(true) -int(6000) -bool(true) -int(4800) -bool(true) -int(3600) -bool(true) -int(2400) -bool(true) -int(1200) -bool(true) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -*** Done *** diff --git a/ext/standard/tests/file/filesize_variation3.phpt b/ext/standard/tests/file/filesize_variation3.phpt index 09b9c341ca..bf27c893b6 100644 --- a/ext/standard/tests/file/filesize_variation3.phpt +++ b/ext/standard/tests/file/filesize_variation3.phpt @@ -1,18 +1,7 @@ --TEST-- Test filesize() function: usage variations - file size after truncate ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip only valid for Linux'); -} --FILE-- <?php -/* - Prototype : int filesize ( string $filename ); - Description : Returns the size of the file in bytes, or FALSE - (and generates an error of level E_WARNING) in case of an error. -*/ - $file_path = __DIR__; echo "*** Testing filesize(): usage variations ***\n"; @@ -26,21 +15,24 @@ echo "-- Testing filesize() after truncating the file to a new length --\n"; // truncate the same file, in the loop , each time with the decrement in size by 1200 bytes, // until -1200bytes size for($size = filesize($filename); $size>=-1200; $size-=1200) { - $file_handle = fopen($filename, "r+"); - var_dump( ftruncate($file_handle, $size) ); - fclose($file_handle); - var_dump( filesize($filename) ); - clearstatcache(); + $file_handle = fopen($filename, "r+"); + try { + var_dump( ftruncate($file_handle, $size) ); + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; + } + fclose($file_handle); + var_dump( filesize($filename) ); + clearstatcache(); } -echo "*** Done ***\n"; ?> --CLEAN-- <?php $file_path = __DIR__; unlink($file_path."/filesize_variation3.tmp"); ?> ---EXPECTF-- +--EXPECT-- *** Testing filesize(): usage variations *** -- Testing filesize() after truncating the file to a new length -- bool(true) @@ -65,8 +57,5 @@ bool(true) int(1200) bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) -*** Done *** diff --git a/ext/standard/tests/file/filesize_variation4-win32.phpt b/ext/standard/tests/file/filesize_variation4-win32.phpt index 89bb869e31..994b699be1 100644 --- a/ext/standard/tests/file/filesize_variation4-win32.phpt +++ b/ext/standard/tests/file/filesize_variation4-win32.phpt @@ -7,12 +7,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { } --FILE-- <?php -/* - Prototype : int filesize ( string $filename ); - Description : Returns the size of the file in bytes, or FALSE - (and generates an error of level E_WARNING) in case of an error. -*/ - $file_path = __DIR__; require($file_path."/file.inc"); @@ -60,7 +54,7 @@ clearstatcache(); echo "-- writing data after hole and checking the size --\n"; $file_handle = fopen($filename, "a"); -fwrite($file_handle, "Hello\0"); //wrting 6 bytes of data +fwrite($file_handle, "Hello\0"); //writing 6 bytes of data fclose($file_handle); var_dump( filesize($filename) ); //226 bytes clearstatcache(); diff --git a/ext/standard/tests/file/filesize_variation4.phpt b/ext/standard/tests/file/filesize_variation4.phpt index 4abb64dca6..9ca263b74a 100644 --- a/ext/standard/tests/file/filesize_variation4.phpt +++ b/ext/standard/tests/file/filesize_variation4.phpt @@ -7,12 +7,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { } --FILE-- <?php -/* - Prototype : int filesize ( string $filename ); - Description : Returns the size of the file in bytes, or FALSE - (and generates an error of level E_WARNING) in case of an error. -*/ - /* Testing filesize() with data written using different file modes and by creating holes in file */ $file_path = __DIR__; @@ -62,7 +56,7 @@ clearstatcache(); echo "-- writing data after hole and checking the size --\n"; $file_handle = fopen($filename, "a"); -fwrite($file_handle, "Hello\0"); //wrting 6 bytes of data +fwrite($file_handle, "Hello\0"); //writing 6 bytes of data fclose($file_handle); var_dump( filesize($filename) ); //226 bytes clearstatcache(); diff --git a/ext/standard/tests/file/filesize_variation5.phpt b/ext/standard/tests/file/filesize_variation5.phpt index 9d1338481d..ab1fc6c9ff 100644 --- a/ext/standard/tests/file/filesize_variation5.phpt +++ b/ext/standard/tests/file/filesize_variation5.phpt @@ -4,12 +4,6 @@ Test filesize() function: usage variations - size of files Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* - * Prototype : int filesize ( string $filename ); - * Description : Returns the size of the file in bytes, or FALSE - * (and generates an error of level E_WARNING) in case of an error. - */ - echo "*** Testing filesize(): usage variations ***\n"; /* null, false, "", " " */ diff --git a/ext/standard/tests/file/filetype_basic.phpt b/ext/standard/tests/file/filetype_basic.phpt index b56c19065d..4e23675e02 100644 --- a/ext/standard/tests/file/filetype_basic.phpt +++ b/ext/standard/tests/file/filetype_basic.phpt @@ -2,12 +2,6 @@ Test filetype() function: Basic functionality --FILE-- <?php -/* -Prototype: string filetype ( string $filename ); -Description: Returns the type of the file. Possible values are fifo, char, - dir, block, link, file, and unknown. -*/ - echo "*** Testing filetype() with files and dirs ***\n"; print( filetype(__FILE__) )."\n"; diff --git a/ext/standard/tests/file/filetype_error.phpt b/ext/standard/tests/file/filetype_error.phpt index b49a5286c6..5d2de7c58d 100644 --- a/ext/standard/tests/file/filetype_error.phpt +++ b/ext/standard/tests/file/filetype_error.phpt @@ -2,12 +2,6 @@ Test filetype() function: Error conditions --FILE-- <?php -/* -Prototype: string filetype ( string $filename ); -Description: Returns the type of the file. Possible values are fifo, char, - dir, block, link, file, and unknown. -*/ - echo "*** Testing error conditions ***"; /* non-existing file or dir */ print( filetype("/no/such/file/dir") ); @@ -16,12 +10,6 @@ print( filetype("/no/such/file/dir") ); print( filetype("string") ); print( filetype(100) ); -/* No.of args less than expected */ -print( filetype() ); - -/* No.of args greater than expected */ -print( filetype("file", "file") ); - echo "\n*** Done ***\n"; ?> --EXPECTF-- @@ -32,8 +20,4 @@ Warning: filetype(): Lstat failed for string in %s on line %d Warning: filetype(): Lstat failed for 100 in %s on line %d -Warning: filetype() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: filetype() expects exactly 1 parameter, 2 given in %s on line %d - *** Done *** diff --git a/ext/standard/tests/file/filetype_variation.phpt b/ext/standard/tests/file/filetype_variation.phpt index 21bceedd02..4394507868 100644 --- a/ext/standard/tests/file/filetype_variation.phpt +++ b/ext/standard/tests/file/filetype_variation.phpt @@ -8,12 +8,6 @@ if (!function_exists("posix_mkfifo")) { ?> --FILE-- <?php -/* -Prototype: string filetype ( string $filename ); -Description: Returns the type of the file. Possible values are fifo, char, - dir, block, link, file, and unknown. -*/ - echo "*** Testing filetype() with various types ***\n"; $file_path = __DIR__; $file1 = $file_path."/filetype1_variation.tmp"; diff --git a/ext/standard/tests/file/filetype_variation2.phpt b/ext/standard/tests/file/filetype_variation2.phpt index 1c276a2957..8ea1e16b22 100644 --- a/ext/standard/tests/file/filetype_variation2.phpt +++ b/ext/standard/tests/file/filetype_variation2.phpt @@ -13,17 +13,9 @@ if (!file_exists("/dev/null")) { ?> --FILE-- <?php -/* -Prototype: string filetype ( string $filename ); -Description: Returns the type of the file. Possible values are fifo, char, - dir, block, link, file, and unknown. -*/ - echo "-- Checking for char --\n"; print( filetype("/dev/null") )."\n"; ?> -===DONE=== --EXPECT-- -- Checking for char -- char -===DONE=== diff --git a/ext/standard/tests/file/filetype_variation3.phpt b/ext/standard/tests/file/filetype_variation3.phpt index eb82a4d149..dbc74966ee 100644 --- a/ext/standard/tests/file/filetype_variation3.phpt +++ b/ext/standard/tests/file/filetype_variation3.phpt @@ -13,17 +13,9 @@ if (!file_exists("/dev/ram0")) { ?> --FILE-- <?php -/* -Prototype: string filetype ( string $filename ); -Description: Returns the type of the file. Possible values are fifo, char, - dir, block, link, file, and unknown. -*/ - echo "-- Checking for block --\n"; print( filetype("/dev/ram0") )."\n"; ?> -===DONE=== --EXPECT-- -- Checking for block -- block -===DONE=== diff --git a/ext/standard/tests/file/flock.phpt b/ext/standard/tests/file/flock.phpt index 43f9112887..68e0f3fd30 100644 --- a/ext/standard/tests/file/flock.phpt +++ b/ext/standard/tests/file/flock.phpt @@ -5,13 +5,14 @@ flock() tests $file = __DIR__."/flock.dat"; -var_dump(flock()); -var_dump(flock("", "", $var)); - $fp = fopen($file, "w"); fclose($fp); -var_dump(flock($fp, LOCK_SH|LOCK_NB)); +try { + var_dump(flock($fp, LOCK_SH|LOCK_NB)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} $fp = fopen($file, "w"); @@ -31,24 +32,21 @@ var_dump(flock($fp, LOCK_UN, $would)); var_dump($would); var_dump(flock($fp, -1)); -var_dump(flock($fp, 0)); -echo "Done\n"; +try { + var_dump(flock($fp, 0)); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} + ?> --CLEAN-- <?php $file = __DIR__."/flock.dat"; unlink($file); ?> ---EXPECTF-- -Warning: flock() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: flock() expects parameter 1 to be resource, string given in %s on line %d -NULL - -Warning: flock(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +--EXPECT-- +flock(): supplied resource is not a valid stream resource bool(true) bool(true) bool(true) @@ -62,7 +60,4 @@ int(0) bool(true) int(0) bool(true) - -Warning: flock(): Illegal operation argument in %s on line %d -bool(false) -Done +flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN diff --git a/ext/standard/tests/file/flock_basic.phpt b/ext/standard/tests/file/flock_basic.phpt index 812c2958a5..df1199d468 100644 --- a/ext/standard/tests/file/flock_basic.phpt +++ b/ext/standard/tests/file/flock_basic.phpt @@ -3,7 +3,6 @@ Test flock() function: Basic functionality --FILE-- <?php /* -Prototype: bool flock(resource $handle, int $operation [, int &$wouldblock]); Description: PHP supports a portable way of locking complete files in an advisory way */ diff --git a/ext/standard/tests/file/flock_error.phpt b/ext/standard/tests/file/flock_error.phpt index d6f1b3f59b..52dd5179be 100644 --- a/ext/standard/tests/file/flock_error.phpt +++ b/ext/standard/tests/file/flock_error.phpt @@ -5,7 +5,6 @@ obscure_filename --FILE-- <?php /* -Prototype: bool flock(resource $handle, int $operation [, int &$wouldblock]); Description: PHP supports a portable way of locking complete files in an advisory way */ @@ -15,7 +14,7 @@ echo "*** Testing error conditions ***\n"; $file = preg_replace("~\.phpt?$~", '.tmp', __FILE__); $fp = fopen($file, "w"); -/* array of operatons */ +/* array of operations */ $operations = array( 0, LOCK_NB, @@ -30,81 +29,48 @@ $operations = array( $i = 0; foreach($operations as $operation) { - echo "\n--- Iteration $i ---"; - var_dump(flock($fp, $operation)); - $i++; + echo "--- Iteration $i ---" . \PHP_EOL; + try { + var_dump(flock($fp, $operation)); + } catch (\TypeError|\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; + } + $i++; } /* Invalid arguments */ $fp = fopen($file, "w"); fclose($fp); -var_dump(flock($fp, LOCK_SH|LOCK_NB)); - -var_dump(flock("", "", $var)); - -/* No.of args leass than expected */ -var_dump(flock()); -var_dump(flock($fp)); - -/* No.of args greater than expected */ -var_dump(flock($fp, "", $var, "")); +try { + var_dump(flock($fp, LOCK_SH|LOCK_NB)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> --CLEAN-- <?php $file = __DIR__."/flock_error.tmp"; unlink($file); ?> ---EXPECTF-- +--EXPECT-- *** Testing error conditions *** - --- Iteration 0 --- -Warning: flock(): Illegal operation argument in %s on line %d -bool(false) - +flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 1 --- -Warning: flock(): Illegal operation argument in %s on line %d -bool(false) - +flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 2 --- -Warning: flock(): Illegal operation argument in %s on line %d -bool(false) - +flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 3 --- -Warning: flock(): Illegal operation argument in %s on line %d -bool(false) - +flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 4 --- -Warning: flock() expects parameter 2 to be int, array given in %s on line %d -NULL - +flock(): Argument #2 ($operation) must be of type int, array given --- Iteration 5 --- -Warning: flock() expects parameter 2 to be int, array given in %s on line %d -NULL - +flock(): Argument #2 ($operation) must be of type int, array given --- Iteration 6 --- -Warning: flock() expects parameter 2 to be int, string given in %s on line %d -NULL - +flock(): Argument #2 ($operation) must be of type int, string given --- Iteration 7 --- -Warning: flock() expects parameter 2 to be int, string given in %s on line %d -NULL - +flock(): Argument #2 ($operation) must be of type int, string given --- Iteration 8 --- -Warning: flock() expects parameter 2 to be int, string given in %s on line %d -NULL - -Warning: flock(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: flock() expects parameter 1 to be resource, string given in %s on line %d -NULL - -Warning: flock() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: flock() expects at least 2 parameters, 1 given in %s on line %d -NULL - -Warning: flock() expects at most 3 parameters, 4 given in %s on line %d -NULL +flock(): Argument #2 ($operation) must be of type int, string given +flock(): supplied resource is not a valid stream resource diff --git a/ext/standard/tests/file/flock_variation.phpt b/ext/standard/tests/file/flock_variation.phpt index 0c66fca7fb..40945be58e 100644 --- a/ext/standard/tests/file/flock_variation.phpt +++ b/ext/standard/tests/file/flock_variation.phpt @@ -2,19 +2,13 @@ Test flock() function: Variations --FILE-- <?php -/* -Prototype: bool flock(resource $handle, int $operation [, int &$wouldblock]); -Description: PHP supports a portable way of locking complete files - in an advisory way -*/ - -echo "*** Testing flock() fun with the various operation and - wouldblock values ***\n"; +echo "*** Testing flock() fun with the various operation and + wouldblock values ***\n"; $file = preg_replace("~\.phpt?$~", null, __FILE__); $fp = fopen($file, "w"); -/* array of operatons */ +/* array of operations */ $operations = array( LOCK_SH, LOCK_EX, @@ -66,8 +60,8 @@ fclose($fp); echo "\n*** Done ***\n"; ?> --EXPECT-- -*** Testing flock() fun with the various operation and - wouldblock values *** +*** Testing flock() fun with the various operation and + wouldblock values *** --- Outer iteration 0 --- bool(true) -- Inner iteration 0 in 0 -- diff --git a/ext/standard/tests/file/fnmatch_basic.phpt b/ext/standard/tests/file/fnmatch_basic.phpt index 189605169d..18a8161966 100644 --- a/ext/standard/tests/file/fnmatch_basic.phpt +++ b/ext/standard/tests/file/fnmatch_basic.phpt @@ -7,10 +7,6 @@ if (!function_exists('fnmatch')) ?> --FILE-- <?php -/* Prototype: bool fnmatch ( string $pattern, string $string [, int $flags] ) - Description: fnmatch() checks if the passed string would match - the given shell wildcard pattern. -*/ echo "*** Testing fnmatch() with file ***\n"; $file = basename(__FILE__); diff --git a/ext/standard/tests/file/fnmatch_variation.phpt b/ext/standard/tests/file/fnmatch_variation.phpt index 919e80eec0..4ca81ed94f 100644 --- a/ext/standard/tests/file/fnmatch_variation.phpt +++ b/ext/standard/tests/file/fnmatch_variation.phpt @@ -7,10 +7,6 @@ if (!function_exists('fnmatch')) ?> --FILE-- <?php -/* Prototype: bool fnmatch ( string $pattern, string $string [, int $flags] ) - Description: fnmatch() checks if the passed string would match - the given shell wildcard pattern. -*/ echo "*** Testing fnmatch() with file and various patterns ***\n"; $file_name = __DIR__."/match.tmp"; @@ -66,7 +62,11 @@ $pattern_arr = array( for( $i = 0; $i<count($pattern_arr); $i++ ) { echo "-- Iteration $i --\n"; - var_dump( fnmatch($pattern_arr[$i], $file_name) ); + try { + var_dump( fnmatch($pattern_arr[$i], $file_name) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } unlink($file_name); @@ -74,11 +74,15 @@ unlink($file_name); echo "\n*** Testing fnmatch() with other types other than files ***"; /* defining a common function */ -function match( $pattern, $string ) { +function match_( $pattern, $string ) { for( $i = 0; $i<count($pattern); $i++ ) { echo "-- Iteration $i --\n"; for( $j = 0; $j<count($string); $j++ ) { - var_dump( fnmatch($pattern[$i], $string[$j]) ); + try { + var_dump( fnmatch($pattern[$i], $string[$j]) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } } } @@ -92,7 +96,7 @@ $int_arr = array( 0xF, 0xF0000 ); -match($int_arr, $int_arr); +match_($int_arr, $int_arr); echo "\n--- With Strings ---\n"; $str_arr = array( @@ -105,7 +109,7 @@ $str_arr = array( /* binary input */ b"string" ); -match($str_arr, $str_arr); +match_($str_arr, $str_arr); echo "\n--- With booleans ---\n"; $bool_arr = array( @@ -119,7 +123,7 @@ $bool_arr = array( "", "string" ); -match($bool_arr, $bool_arr); +match_($bool_arr, $bool_arr); echo "\n--- With NULL ---\n"; $null_arr = array( @@ -130,11 +134,11 @@ $null_arr = array( "string", 0 ); -match($null_arr, $null_arr); +match_($null_arr, $null_arr); echo "\n*** Done ***\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fnmatch() with file and various patterns *** -- Iteration 0 -- bool(true) @@ -183,13 +187,9 @@ bool(false) -- Iteration 22 -- bool(false) -- Iteration 23 -- - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fnmatch(): Argument #1 ($pattern) must be a valid path, string given -- Iteration 24 -- - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fnmatch(): Argument #1 ($pattern) must be a valid path, string given -- Iteration 25 -- bool(false) -- Iteration 26 -- @@ -263,84 +263,44 @@ bool(true) --- With Strings --- -- Iteration 0 -- bool(true) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch(): Argument #2 ($filename) must be a valid path, string given bool(true) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch(): Argument #2 ($filename) must be a valid path, string given bool(false) bool(true) -- Iteration 1 -- - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fnmatch(): Argument #1 ($pattern) must be a valid path, string given +fnmatch(): Argument #1 ($pattern) must be a valid path, string given +fnmatch(): Argument #1 ($pattern) must be a valid path, string given +fnmatch(): Argument #1 ($pattern) must be a valid path, string given +fnmatch(): Argument #1 ($pattern) must be a valid path, string given +fnmatch(): Argument #1 ($pattern) must be a valid path, string given -- Iteration 2 -- bool(true) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch(): Argument #2 ($filename) must be a valid path, string given bool(true) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch(): Argument #2 ($filename) must be a valid path, string given bool(false) bool(true) -- Iteration 3 -- - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fnmatch(): Argument #1 ($pattern) must be a valid path, string given +fnmatch(): Argument #1 ($pattern) must be a valid path, string given +fnmatch(): Argument #1 ($pattern) must be a valid path, string given +fnmatch(): Argument #1 ($pattern) must be a valid path, string given +fnmatch(): Argument #1 ($pattern) must be a valid path, string given +fnmatch(): Argument #1 ($pattern) must be a valid path, string given -- Iteration 4 -- bool(false) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch(): Argument #2 ($filename) must be a valid path, string given bool(false) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch(): Argument #2 ($filename) must be a valid path, string given bool(true) bool(false) -- Iteration 5 -- bool(true) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch(): Argument #2 ($filename) must be a valid path, string given bool(true) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch(): Argument #2 ($filename) must be a valid path, string given bool(false) bool(true) @@ -441,64 +401,42 @@ bool(true) bool(true) bool(true) bool(true) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch(): Argument #2 ($filename) must be a valid path, string given bool(false) bool(false) -- Iteration 1 -- bool(true) bool(true) bool(true) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch(): Argument #2 ($filename) must be a valid path, string given bool(false) bool(false) -- Iteration 2 -- bool(true) bool(true) bool(true) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch(): Argument #2 ($filename) must be a valid path, string given bool(false) bool(false) -- Iteration 3 -- - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fnmatch(): Argument #1 ($pattern) must be a valid path, string given +fnmatch(): Argument #1 ($pattern) must be a valid path, string given +fnmatch(): Argument #1 ($pattern) must be a valid path, string given +fnmatch(): Argument #1 ($pattern) must be a valid path, string given +fnmatch(): Argument #1 ($pattern) must be a valid path, string given +fnmatch(): Argument #1 ($pattern) must be a valid path, string given -- Iteration 4 -- bool(false) bool(false) bool(false) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch(): Argument #2 ($filename) must be a valid path, string given bool(true) bool(false) -- Iteration 5 -- bool(false) bool(false) bool(false) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch(): Argument #2 ($filename) must be a valid path, string given bool(false) bool(true) diff --git a/ext/standard/tests/file/fopen_include_path.inc b/ext/standard/tests/file/fopen_include_path.inc index e33dae4915..160f9aee5f 100644 --- a/ext/standard/tests/file/fopen_include_path.inc +++ b/ext/standard/tests/file/fopen_include_path.inc @@ -11,82 +11,82 @@ $newdirs = array($dir1, $dir2, $dir3); $reldirs = array("dir1", "dir2", "dir3"); function generate_next_rel_path() { - global $reldirs; - //create the include directory structure - $pathSep = ":"; - $newIncludePath = ""; - if(substr(PHP_OS, 0, 3) == 'WIN' ) { - $pathSep = ";"; - } - foreach($reldirs as $newdir) { - $newIncludePath .= $newdir.$pathSep; - } - return "dir4".$pathSep . $newIncludePath; + global $reldirs; + //create the include directory structure + $pathSep = ":"; + $newIncludePath = ""; + if(substr(PHP_OS, 0, 3) == 'WIN' ) { + $pathSep = ";"; + } + foreach($reldirs as $newdir) { + $newIncludePath .= $newdir.$pathSep; + } + return "dir4".$pathSep . $newIncludePath; } function generate_next_path() { - global $newdirs, $dir4; - //create the include directory structure - $pathSep = ":"; - $newIncludePath = ""; - if(substr(PHP_OS, 0, 3) == 'WIN' ) { - $pathSep = ";"; - } - foreach($newdirs as $newdir) { - $newIncludePath .= $newdir.$pathSep; - } - return $dir4.$pathSep . $newIncludePath; + global $newdirs, $dir4; + //create the include directory structure + $pathSep = ":"; + $newIncludePath = ""; + if(substr(PHP_OS, 0, 3) == 'WIN' ) { + $pathSep = ";"; + } + foreach($newdirs as $newdir) { + $newIncludePath .= $newdir.$pathSep; + } + return $dir4.$pathSep . $newIncludePath; } function create_include_path() { - global $newdirs; - //create the include directory structure - $pathSep = ":"; - $newIncludePath = ""; - if(substr(PHP_OS, 0, 3) == 'WIN' ) { - $pathSep = ";"; - } - foreach($newdirs as $newdir) { - mkdir($newdir); - $newIncludePath .= $newdir.$pathSep; - } - return $newIncludePath; + global $newdirs; + //create the include directory structure + $pathSep = ":"; + $newIncludePath = ""; + if(substr(PHP_OS, 0, 3) == 'WIN' ) { + $pathSep = ";"; + } + foreach($newdirs as $newdir) { + mkdir($newdir); + $newIncludePath .= $newdir.$pathSep; + } + return $newIncludePath; } function relative_include_path() { - global $reldirs; - //create the include directory structure - $pathSep = ":"; - $newIncludePath = ""; - if(substr(PHP_OS, 0, 3) == 'WIN' ) { - $pathSep = ";"; - } - foreach($reldirs as $newdir) { - mkdir($newdir); - $newIncludePath .= $newdir.$pathSep; - } - return $newIncludePath; + global $reldirs; + //create the include directory structure + $pathSep = ":"; + $newIncludePath = ""; + if(substr(PHP_OS, 0, 3) == 'WIN' ) { + $pathSep = ";"; + } + foreach($reldirs as $newdir) { + mkdir($newdir); + $newIncludePath .= $newdir.$pathSep; + } + return $newIncludePath; } function teardown_include_path() { - global $newdirs; - // remove the directory structure - foreach($newdirs as $newdir) { - rmdir($newdir); - } + global $newdirs; + // remove the directory structure + foreach($newdirs as $newdir) { + rmdir($newdir); + } } function teardown_relative_path() { - global $reldirs; - // remove the directory structure - foreach($reldirs as $newdir) { - rmdir($newdir); - } + global $reldirs; + // remove the directory structure + foreach($reldirs as $newdir) { + rmdir($newdir); + } } ?> diff --git a/ext/standard/tests/file/fopen_unlink.phpt b/ext/standard/tests/file/fopen_unlink.phpt index 117863b63d..8e66ae0608 100644 --- a/ext/standard/tests/file/fopen_unlink.phpt +++ b/ext/standard/tests/file/fopen_unlink.phpt @@ -4,21 +4,20 @@ Test fopen() function : check fopen()ed descriptor is usable after the fs object <?php var_dump( - $p = __DIR__ . DIRECTORY_SEPARATOR . 'tututu', - $f = fopen($p, 'w+'), - unlink($p), - file_exists($p), - fwrite($f, 'hello'), - fseek($f, 0), - fread($f, 16), - fwrite($f, 'world'), - fseek($f, 0), - fread($f, 16), - fclose($f) + $p = __DIR__ . DIRECTORY_SEPARATOR . 'tututu', + $f = fopen($p, 'w+'), + unlink($p), + file_exists($p), + fwrite($f, 'hello'), + fseek($f, 0), + fread($f, 16), + fwrite($f, 'world'), + fseek($f, 0), + fread($f, 16), + fclose($f) ); ?> -===DONE=== --EXPECTF-- string(%d) "%stututu" resource(%s) of type (Unknown) @@ -31,4 +30,3 @@ int(5) int(0) string(10) "helloworld" bool(true) -===DONE=== diff --git a/ext/standard/tests/file/fopen_variation10-win32.phpt b/ext/standard/tests/file/fopen_variation10-win32.phpt index 8041c59c84..a754f6431f 100644 --- a/ext/standard/tests/file/fopen_variation10-win32.phpt +++ b/ext/standard/tests/file/fopen_variation10-win32.phpt @@ -14,12 +14,6 @@ if (!is_writable('c:\\')) { ?> --FILE-- <?php -/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]]) - * Description: Open a file or a URL and return a file pointer - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing fopen() : variation ***\n"; // fopen with interesting windows paths. @@ -70,9 +64,9 @@ foreach($paths as $path) { } else { fpassthru($h); + fclose($h); echo "\n"; } - fclose($h); }; unlink($firstfile); @@ -83,7 +77,6 @@ rmdir('c:\\'.$rootdir); ?> -===DONE=== --EXPECTF-- *** Testing fopen() : variation *** @@ -95,35 +88,27 @@ file in root --c-- -Warning: fopen(c\fopen_variation10.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: fopen(c\fopen_variation10.tmp): Failed to open stream: No such file or directory in %s on line %d file not opened for read -Warning: fclose() expects parameter 1 to be resource, bool given in %s on line %d - --\-- -Warning: fopen(\\fopen_variation10.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: fopen(\\fopen_variation10.tmp): Failed to open stream: No such file or directory in %s on line %d file not opened for read -Warning: fclose() expects parameter 1 to be resource, bool given in %s on line %d - --/-- -Warning: fopen(/\fopen_variation10.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: fopen(/\fopen_variation10.tmp): Failed to open stream: No such file or directory in %s on line %d file not opened for read -Warning: fclose() expects parameter 1 to be resource, bool given in %s on line %d - --c:fopen10.tmpdirTwo-- file in fopen10.tmpdirTwo --c:adir-- -Warning: fopen(c:adir\fopen_variation10.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: fopen(c:adir\fopen_variation10.tmp): Failed to open stream: No such file or directory in %s on line %d file not opened for read -Warning: fclose() expects parameter 1 to be resource, bool given in %s on line %d - --c:\/-- file in root @@ -141,8 +126,5 @@ file in fopen10.tmpDir --/sortout-- -Warning: fopen(/sortout\fopen_variation10.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: fopen(/sortout\fopen_variation10.tmp): Failed to open stream: No such file or directory in %s on line %d file not opened for read - -Warning: fclose() expects parameter 1 to be resource, bool given in %s on line %d -===DONE=== diff --git a/ext/standard/tests/file/fopen_variation11-win32.phpt b/ext/standard/tests/file/fopen_variation11-win32.phpt index e40c48841d..e6201829b0 100644 --- a/ext/standard/tests/file/fopen_variation11-win32.phpt +++ b/ext/standard/tests/file/fopen_variation11-win32.phpt @@ -13,12 +13,6 @@ if (!is_writable('c:\\')) { ?> --FILE-- <?php -/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]]) - * Description: Open a file or a URL and return a file pointer - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing fopen() : variation ***\n"; // fopen with interesting windows paths. @@ -69,9 +63,9 @@ foreach($paths as $path) { } else { fpassthru($h); + fclose($h); echo "\n"; } - fclose($h); }; unlink($firstfile); @@ -81,7 +75,6 @@ rmdir($testdir); rmdir('c:\\'.$rootdir); ?> -===DONE=== --EXPECTF-- *** Testing fopen() : variation *** @@ -93,35 +86,27 @@ file in root --c-- -Warning: fopen(c\fopen_variation11.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: fopen(c\fopen_variation11.tmp): Failed to open stream: No such file or directory in %s on line %d file not opened for read -Warning: fclose() expects parameter 1 to be resource, bool given in %s on line %d - --\-- -Warning: fopen(\\FOPEN_VARIATION11.TMP): failed to open stream: No such file or directory in %s on line %d +Warning: fopen(\\FOPEN_VARIATION11.TMP): Failed to open stream: No such file or directory in %s on line %d file not opened for read -Warning: fclose() expects parameter 1 to be resource, bool given in %s on line %d - --/-- -Warning: fopen(\\FOPEN_VARIATION11.TMP): failed to open stream: No such file or directory in %s on line %d +Warning: fopen(\\FOPEN_VARIATION11.TMP): Failed to open stream: No such file or directory in %s on line %d file not opened for read -Warning: fclose() expects parameter 1 to be resource, bool given in %s on line %d - --c:fopen11.tmpdirTwo-- file in fopen11.tmpdirTwo --c:adir-- -Warning: fopen(c:adir\fopen_variation11.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: fopen(c:adir\fopen_variation11.tmp): Failed to open stream: No such file or directory in %s on line %d file not opened for read -Warning: fclose() expects parameter 1 to be resource, bool given in %s on line %d - --c:\/-- file in root @@ -139,8 +124,5 @@ file in fopen11.tmpDir --/sortout-- -Warning: fopen(/sortout\fopen_variation11.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: fopen(/sortout\fopen_variation11.tmp): Failed to open stream: No such file or directory in %s on line %d file not opened for read - -Warning: fclose() expects parameter 1 to be resource, bool given in %s on line %d -===DONE=== diff --git a/ext/standard/tests/file/fopen_variation12.phpt b/ext/standard/tests/file/fopen_variation12.phpt index 2f79be1b63..50a04550ca 100644 --- a/ext/standard/tests/file/fopen_variation12.phpt +++ b/ext/standard/tests/file/fopen_variation12.phpt @@ -4,48 +4,40 @@ Test fopen() function : variation: use include path (path is bad) create a file Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]]) - * Description: Open a file or a URL and return a file pointer - * Source code: ext/standard/file.c - * Alias to functions: - */ - set_include_path("rubbish"); testme(); function testme() { - $tmpfile = basename(__FILE__, ".php") . ".tmp"; - $h = fopen($tmpfile, "w", true); - fwrite($h, "This is the test file"); - fclose($h); + $tmpfile = basename(__FILE__, ".php") . ".tmp"; + $h = fopen($tmpfile, "w", true); + fwrite($h, "This is the test file"); + fclose($h); - $h = @fopen($tmpfile, "r"); - if ($h === false) { - echo "Not created in working dir\n"; - } - else { - echo "created in working dir\n"; - fclose($h); - unlink($tmpfile); - } + $h = @fopen($tmpfile, "r"); + if ($h === false) { + echo "Not created in working dir\n"; + } + else { + echo "created in working dir\n"; + fclose($h); + unlink($tmpfile); + } - $scriptDirFile = __DIR__.'/'.$tmpfile; - $h = @fopen($scriptDirFile, "r"); - if ($h === false) { - echo "Not created in script dir\n"; - } - else { - echo "created in script dir\n"; - fclose($h); - unlink($scriptDirFile); - } + $scriptDirFile = __DIR__.'/'.$tmpfile; + $h = @fopen($scriptDirFile, "r"); + if ($h === false) { + echo "Not created in script dir\n"; + } + else { + echo "created in script dir\n"; + fclose($h); + unlink($scriptDirFile); + } } ?> -===DONE=== --EXPECT-- created in working dir Not created in script dir -===DONE=== diff --git a/ext/standard/tests/file/fopen_variation13.phpt b/ext/standard/tests/file/fopen_variation13.phpt index 4d613a9145..77d642f551 100644 --- a/ext/standard/tests/file/fopen_variation13.phpt +++ b/ext/standard/tests/file/fopen_variation13.phpt @@ -4,12 +4,6 @@ Test fopen() function : variation: use include path create a file (absolute) Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]]) - * Description: Open a file or a URL and return a file pointer - * Source code: ext/standard/file.c - * Alias to functions: - */ - require_once('fopen_include_path.inc'); echo "*** Testing fopen() : variation ***\n"; @@ -25,31 +19,29 @@ teardown_include_path(); function runtest() { $tempDir = 'fopen_variation13.dir.tmp'; - $tmpfile = 'fopen_variation13.tmp'; - $absFile = getcwd().'/'.$tempDir.'/'.$tmpfile; - - mkdir($tempDir); - $h = fopen($absFile, "w", true); - fwrite($h, "This is the test file"); - fclose($h); - - - $h = fopen($absFile, "r"); - if ($h === false) { - echo "Not created absolute location\n"; - } - else { - echo "Created in correct location\n"; - fclose($h); - } + $tmpfile = 'fopen_variation13.tmp'; + $absFile = getcwd().'/'.$tempDir.'/'.$tmpfile; + + mkdir($tempDir); + $h = fopen($absFile, "w", true); + fwrite($h, "This is the test file"); + fclose($h); + + + $h = fopen($absFile, "r"); + if ($h === false) { + echo "Not created absolute location\n"; + } + else { + echo "Created in correct location\n"; + fclose($h); + } unlink($absFile); rmdir($tempDir); } ?> -===DONE=== --EXPECT-- *** Testing fopen() : variation *** Created in correct location Created in correct location -===DONE=== diff --git a/ext/standard/tests/file/fopen_variation14-win32.phpt b/ext/standard/tests/file/fopen_variation14-win32.phpt index 73c5d68e76..71a0ecd0c7 100644 --- a/ext/standard/tests/file/fopen_variation14-win32.phpt +++ b/ext/standard/tests/file/fopen_variation14-win32.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]]) - * Description: Open a file or a URL and return a file pointer - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing fopen() : variation ***\n"; // fopen with interesting windows paths. @@ -78,69 +72,68 @@ function runtest($fileURIs) { // create the file to test write $h = fopen($fileURI, 'w'); if ($h !== false) { - fwrite($h, $writeData); - fclose($h); - - $h = fopen($absFile, 'r'); - if ($h !== false) { - if (fread($h, 4096) != $writeData) { - echo "contents not correct\n"; - } - else { - echo "test passed\n"; - } - fclose($h); - } - unlink($absFile); - } + fwrite($h, $writeData); + fclose($h); + + $h = fopen($absFile, 'r'); + if ($h !== false) { + if (fread($h, 4096) != $writeData) { + echo "contents not correct\n"; + } + else { + echo "test passed\n"; + } + fclose($h); + } + unlink($absFile); + } } } ?> -===DONE=== --EXPECTF-- *** Testing fopen() : variation *** --- READ: file://fopen14.tmpDir\fopen_variation14.tmp --- -Warning: fopen(): remote host file access not supported, file://fopen14.tmpDir\fopen_variation14.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://fopen14.tmpDir\fopen_variation14.tmp in %s on line %d -Warning: fopen(file://fopen14.tmpDir\fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://fopen14.tmpDir\fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://fopen14.tmpDir\fopen_variation14.tmp --- -Warning: fopen(): remote host file access not supported, file://fopen14.tmpDir\fopen_variation14.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://fopen14.tmpDir\fopen_variation14.tmp in %s on line %d -Warning: fopen(file://fopen14.tmpDir\fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://fopen14.tmpDir\fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://fopen14.tmpDir/fopen_variation14.tmp --- -Warning: fopen(): remote host file access not supported, file://fopen14.tmpDir/fopen_variation14.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://fopen14.tmpDir/fopen_variation14.tmp --- -Warning: fopen(): remote host file access not supported, file://fopen14.tmpDir/fopen_variation14.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://./fopen14.tmpDir/fopen_variation14.tmp --- -Warning: fopen(): remote host file access not supported, file://./fopen14.tmpDir/fopen_variation14.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://./fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://./fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://./fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://./fopen14.tmpDir/fopen_variation14.tmp --- -Warning: fopen(): remote host file access not supported, file://./fopen14.tmpDir/fopen_variation14.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://./fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://./fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://./fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://.\fopen14.tmpDir\fopen_variation14.tmp --- -Warning: fopen(): remote host file access not supported, file://.\fopen14.tmpDir\fopen_variation14.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://.\fopen14.tmpDir\fopen_variation14.tmp in %s on line %d -Warning: fopen(file://.\fopen14.tmpDir\fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://.\fopen14.tmpDir\fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://.\fopen14.tmpDir\fopen_variation14.tmp --- -Warning: fopen(): remote host file access not supported, file://.\fopen14.tmpDir\fopen_variation14.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://.\fopen14.tmpDir\fopen_variation14.tmp in %s on line %d -Warning: fopen(file://.\fopen14.tmpDir\fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://.\fopen14.tmpDir\fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://%s/fopen14.tmpDir/fopen_variation14.tmp --- test passed --- WRITE: file://%s/fopen14.tmpDir/fopen_variation14.tmp --- @@ -155,24 +148,24 @@ test passed test passed --- READ: file://../fopen14.tmpDir/fopen_variation14.tmp --- -Warning: fopen(): remote host file access not supported, file://../fopen14.tmpDir/fopen_variation14.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://../fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://../fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://../fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://../fopen14.tmpDir/fopen_variation14.tmp --- -Warning: fopen(): remote host file access not supported, file://../fopen14.tmpDir/fopen_variation14.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://../fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://../fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://../fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://..\fopen14.tmpDir\fopen_variation14.tmp --- -Warning: fopen(): remote host file access not supported, file://..\fopen14.tmpDir\fopen_variation14.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://..\fopen14.tmpDir\fopen_variation14.tmp in %s on line %d -Warning: fopen(file://..\fopen14.tmpDir\fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://..\fopen14.tmpDir\fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://..\fopen14.tmpDir\fopen_variation14.tmp --- -Warning: fopen(): remote host file access not supported, file://..\fopen14.tmpDir\fopen_variation14.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://..\fopen14.tmpDir\fopen_variation14.tmp in %s on line %d -Warning: fopen(file://..\fopen14.tmpDir\fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://..\fopen14.tmpDir\fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://%s/fopen14.tmpDir/fopen_variation14.tmp --- test passed --- WRITE: file://%s/fopen14.tmpDir/fopen_variation14.tmp --- @@ -185,4 +178,3 @@ test passed test passed --- WRITE: file:///%s/fopen14.tmpDir/fopen_variation14.tmp --- test passed -===DONE=== diff --git a/ext/standard/tests/file/fopen_variation14.phpt b/ext/standard/tests/file/fopen_variation14.phpt index f1e37fdda0..554527d087 100644 --- a/ext/standard/tests/file/fopen_variation14.phpt +++ b/ext/standard/tests/file/fopen_variation14.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]]) - * Description: Open a file or a URL and return a file pointer - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing fopen() : variation ***\n"; // fopen with interesting windows paths. @@ -70,65 +64,63 @@ function runtest($fileURIs) { // create the file to test write $h = fopen($fileURI, 'w'); if ($h !== false) { - fwrite($h, $writeData); - fclose($h); - - $h = fopen($absFile, 'r'); - if ($h !== false) { - if (fread($h, 4096) != $writeData) { - echo "contents not correct\n"; - } - else { - echo "test passed\n"; - } - fclose($h); - } - unlink($absFile); - } + fwrite($h, $writeData); + fclose($h); + + $h = fopen($absFile, 'r'); + if ($h !== false) { + if (fread($h, 4096) != $writeData) { + echo "contents not correct\n"; + } + else { + echo "test passed\n"; + } + fclose($h); + } + unlink($absFile); + } } } ?> -===DONE=== --EXPECTF-- *** Testing fopen() : variation *** --- READ: file://fopen14.tmpDir/fopen_variation14.tmp --- -Warning: fopen(): remote host file access not supported, file://fopen14.tmpDir/fopen_variation14.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://fopen14.tmpDir/fopen_variation14.tmp --- -Warning: fopen(): remote host file access not supported, file://fopen14.tmpDir/fopen_variation14.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://./fopen14.tmpDir/fopen_variation14.tmp --- -Warning: fopen(): remote host file access not supported, file://./fopen14.tmpDir/fopen_variation14.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://./fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://./fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://./fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://./fopen14.tmpDir/fopen_variation14.tmp --- -Warning: fopen(): remote host file access not supported, file://./fopen14.tmpDir/fopen_variation14.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://./fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://./fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://./fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file:///%s/fopen14.tmpDir/fopen_variation14.tmp --- test passed --- WRITE: file:///%s/fopen14.tmpDir/fopen_variation14.tmp --- test passed --- READ: file://../fopen14.tmpDir/fopen_variation14.tmp --- -Warning: fopen(): remote host file access not supported, file://../fopen14.tmpDir/fopen_variation14.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://../fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://../fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://../fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://../fopen14.tmpDir/fopen_variation14.tmp --- -Warning: fopen(): remote host file access not supported, file://../fopen14.tmpDir/fopen_variation14.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://../fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://../fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://../fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file:///%s/fopen14.tmpDir/fopen_variation14.tmp --- test passed --- WRITE: file:///%s/fopen14.tmpDir/fopen_variation14.tmp --- test passed -===DONE=== diff --git a/ext/standard/tests/file/fopen_variation15-win32.phpt b/ext/standard/tests/file/fopen_variation15-win32.phpt index 52f69db746..edabaa5c5c 100644 --- a/ext/standard/tests/file/fopen_variation15-win32.phpt +++ b/ext/standard/tests/file/fopen_variation15-win32.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]]) - * Description: Open a file or a URL and return a file pointer - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing fopen() : variation ***\n"; // fopen with interesting windows paths. @@ -82,69 +76,68 @@ function runtest($fileURIs) { // create the file to test write $h = fopen($fileURI, 'w', true); if ($h !== false) { - fwrite($h, $writeData); - fclose($h); - - $h = fopen($absFile, 'r'); - if ($h !== false) { - if (fread($h, 4096) != $writeData) { - echo "contents not correct\n"; - } - else { - echo "test passed\n"; - } - fclose($h); - } - unlink($absFile); - } + fwrite($h, $writeData); + fclose($h); + + $h = fopen($absFile, 'r'); + if ($h !== false) { + if (fread($h, 4096) != $writeData) { + echo "contents not correct\n"; + } + else { + echo "test passed\n"; + } + fclose($h); + } + unlink($absFile); + } } } ?> -===DONE=== --EXPECTF-- *** Testing fopen() : variation *** --- READ: file://fopen15.tmpDir\fopen_variation15.tmp --- -Warning: fopen(): remote host file access not supported, file://fopen15.tmpDir\fopen_variation15.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://fopen15.tmpDir\fopen_variation15.tmp in %s on line %d -Warning: fopen(file://fopen15.tmpDir\fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://fopen15.tmpDir\fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://fopen15.tmpDir\fopen_variation15.tmp --- -Warning: fopen(): remote host file access not supported, file://fopen15.tmpDir\fopen_variation15.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://fopen15.tmpDir\fopen_variation15.tmp in %s on line %d -Warning: fopen(file://fopen15.tmpDir\fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://fopen15.tmpDir\fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://fopen15.tmpDir/fopen_variation15.tmp --- -Warning: fopen(): remote host file access not supported, file://fopen15.tmpDir/fopen_variation15.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://fopen15.tmpDir/fopen_variation15.tmp --- -Warning: fopen(): remote host file access not supported, file://fopen15.tmpDir/fopen_variation15.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://./fopen15.tmpDir/fopen_variation15.tmp --- -Warning: fopen(): remote host file access not supported, file://./fopen15.tmpDir/fopen_variation15.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://./fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://./fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://./fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://./fopen15.tmpDir/fopen_variation15.tmp --- -Warning: fopen(): remote host file access not supported, file://./fopen15.tmpDir/fopen_variation15.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://./fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://./fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://./fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://.\fopen15.tmpDir\fopen_variation15.tmp --- -Warning: fopen(): remote host file access not supported, file://.\fopen15.tmpDir\fopen_variation15.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://.\fopen15.tmpDir\fopen_variation15.tmp in %s on line %d -Warning: fopen(file://.\fopen15.tmpDir\fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://.\fopen15.tmpDir\fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://.\fopen15.tmpDir\fopen_variation15.tmp --- -Warning: fopen(): remote host file access not supported, file://.\fopen15.tmpDir\fopen_variation15.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://.\fopen15.tmpDir\fopen_variation15.tmp in %s on line %d -Warning: fopen(file://.\fopen15.tmpDir\fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://.\fopen15.tmpDir\fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://%s/fopen15.tmpDir/fopen_variation15.tmp --- test passed --- WRITE: file://%s/fopen15.tmpDir/fopen_variation15.tmp --- @@ -159,24 +152,24 @@ test passed test passed --- READ: file://../fopen15.tmpDir/fopen_variation15.tmp --- -Warning: fopen(): remote host file access not supported, file://../fopen15.tmpDir/fopen_variation15.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://../fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://../fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://../fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://../fopen15.tmpDir/fopen_variation15.tmp --- -Warning: fopen(): remote host file access not supported, file://../fopen15.tmpDir/fopen_variation15.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://../fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://../fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://../fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://..\fopen15.tmpDir\fopen_variation15.tmp --- -Warning: fopen(): remote host file access not supported, file://..\fopen15.tmpDir\fopen_variation15.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://..\fopen15.tmpDir\fopen_variation15.tmp in %s on line %d -Warning: fopen(file://..\fopen15.tmpDir\fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://..\fopen15.tmpDir\fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://..\fopen15.tmpDir\fopen_variation15.tmp --- -Warning: fopen(): remote host file access not supported, file://..\fopen15.tmpDir\fopen_variation15.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://..\fopen15.tmpDir\fopen_variation15.tmp in %s on line %d -Warning: fopen(file://..\fopen15.tmpDir\fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://..\fopen15.tmpDir\fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://%s/fopen15.tmpDir/fopen_variation15.tmp --- test passed --- WRITE: file://%s/fopen15.tmpDir/fopen_variation15.tmp --- @@ -189,4 +182,3 @@ test passed test passed --- WRITE: file:///%s/fopen15.tmpDir/fopen_variation15.tmp --- test passed -===DONE=== diff --git a/ext/standard/tests/file/fopen_variation15.phpt b/ext/standard/tests/file/fopen_variation15.phpt index bad0a0b63c..a182865bcb 100644 --- a/ext/standard/tests/file/fopen_variation15.phpt +++ b/ext/standard/tests/file/fopen_variation15.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]]) - * Description: Open a file or a URL and return a file pointer - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing fopen() : variation ***\n"; // fopen with interesting windows paths. @@ -74,65 +68,63 @@ function runtest($fileURIs) { // create the file to test write $h = fopen($fileURI, 'w', true); if ($h !== false) { - fwrite($h, $writeData); - fclose($h); - - $h = fopen($absFile, 'r'); - if ($h !== false) { - if (fread($h, 4096) != $writeData) { - echo "contents not correct\n"; - } - else { - echo "test passed\n"; - } - fclose($h); - } - unlink($absFile); - } + fwrite($h, $writeData); + fclose($h); + + $h = fopen($absFile, 'r'); + if ($h !== false) { + if (fread($h, 4096) != $writeData) { + echo "contents not correct\n"; + } + else { + echo "test passed\n"; + } + fclose($h); + } + unlink($absFile); + } } } ?> -===DONE=== --EXPECTF-- *** Testing fopen() : variation *** --- READ: file://fopen15.tmpDir/fopen_variation15.tmp --- -Warning: fopen(): remote host file access not supported, file://fopen15.tmpDir/fopen_variation15.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://fopen15.tmpDir/fopen_variation15.tmp --- -Warning: fopen(): remote host file access not supported, file://fopen15.tmpDir/fopen_variation15.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://./fopen15.tmpDir/fopen_variation15.tmp --- -Warning: fopen(): remote host file access not supported, file://./fopen15.tmpDir/fopen_variation15.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://./fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://./fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://./fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://./fopen15.tmpDir/fopen_variation15.tmp --- -Warning: fopen(): remote host file access not supported, file://./fopen15.tmpDir/fopen_variation15.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://./fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://./fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://./fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file:///%s/fopen15.tmpDir/fopen_variation15.tmp --- test passed --- WRITE: file:///%s/fopen15.tmpDir/fopen_variation15.tmp --- test passed --- READ: file://../fopen15.tmpDir/fopen_variation15.tmp --- -Warning: fopen(): remote host file access not supported, file://../fopen15.tmpDir/fopen_variation15.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://../fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://../fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://../fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://../fopen15.tmpDir/fopen_variation15.tmp --- -Warning: fopen(): remote host file access not supported, file://../fopen15.tmpDir/fopen_variation15.tmp in %s on line %d +Warning: fopen(): Remote host file access not supported, file://../fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://../fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://../fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file:///%s/fopen15.tmpDir/fopen_variation15.tmp --- test passed --- WRITE: file:///%s/fopen15.tmpDir/fopen_variation15.tmp --- test passed -===DONE=== diff --git a/ext/standard/tests/file/fopen_variation16.phpt b/ext/standard/tests/file/fopen_variation16.phpt index 5888688fa8..f3289cd94a 100644 --- a/ext/standard/tests/file/fopen_variation16.phpt +++ b/ext/standard/tests/file/fopen_variation16.phpt @@ -4,12 +4,6 @@ Test fopen() function : variation: use include path create and read a file (rela Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]]) - * Description: Open a file or a URL and return a file pointer - * Source code: ext/standard/file.c - * Alias to functions: - */ - require_once('fopen_include_path.inc'); $thisTestDir = "fopenVariation16.dir"; @@ -36,39 +30,37 @@ function runtest() { mkdir($dir1.'/'.$extraDir); mkdir($extraDir); - $tmpfile = $extraDir.'/fopen_variation16.tmp'; + $tmpfile = $extraDir.'/fopen_variation16.tmp'; - $h = fopen($tmpfile, "w+", true); - fwrite($h, "This is the test file"); - fclose($h); + $h = fopen($tmpfile, "w+", true); + fwrite($h, "This is the test file"); + fclose($h); - $h = @fopen($dir1.'/'.$tmpfile, "r"); - if ($h === false) { - echo "Not created in dir1\n"; - } - else { - echo "created in dir1\n"; - fclose($h); - } + $h = @fopen($dir1.'/'.$tmpfile, "r"); + if ($h === false) { + echo "Not created in dir1\n"; + } + else { + echo "created in dir1\n"; + fclose($h); + } - $h = fopen($tmpfile, "r", true); - if ($h === false) { - echo "could not find file for reading\n"; - } - else { - echo "found file - not in dir1\n"; - fclose($h); - } + $h = fopen($tmpfile, "r", true); + if ($h === false) { + echo "could not find file for reading\n"; + } + else { + echo "found file - not in dir1\n"; + fclose($h); + } - unlink($tmpfile); + unlink($tmpfile); rmdir($dir1.'/'.$extraDir); rmdir($extraDir); } ?> -===DONE=== --EXPECT-- Not created in dir1 found file - not in dir1 Not created in dir1 found file - not in dir1 -===DONE=== diff --git a/ext/standard/tests/file/fopen_variation17.phpt b/ext/standard/tests/file/fopen_variation17.phpt index 5d639e8236..04059493b0 100644 --- a/ext/standard/tests/file/fopen_variation17.phpt +++ b/ext/standard/tests/file/fopen_variation17.phpt @@ -4,12 +4,6 @@ Test fopen() function : variation: use include path create and read a file (rela Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]]) - * Description: Open a file or a URL and return a file pointer - * Source code: ext/standard/file.c - * Alias to functions: - */ - require_once('fopen_include_path.inc'); $thisTestDir = basename(__FILE__, ".php") . ".dir"; @@ -36,38 +30,36 @@ function runtest() { mkdir($dir1.'/'.$extraDir); mkdir($extraDir); - $tmpfile = $extraDir . '/' . basename(__FILE__, ".php") . ".tmp"; - $h = fopen($tmpfile, "w+", true); - fwrite($h, "This is the test file"); - fclose($h); + $tmpfile = $extraDir . '/' . basename(__FILE__, ".php") . ".tmp"; + $h = fopen($tmpfile, "w+", true); + fwrite($h, "This is the test file"); + fclose($h); - $h = @fopen($dir1.'/'.$tmpfile, "r"); - if ($h === false) { - echo "Not created in dir1\n"; - } - else { - echo "created in dir1\n"; - fclose($h); - } + $h = @fopen($dir1.'/'.$tmpfile, "r"); + if ($h === false) { + echo "Not created in dir1\n"; + } + else { + echo "created in dir1\n"; + fclose($h); + } - $h = fopen($tmpfile, "r", true); - if ($h === false) { - echo "could not find file for reading\n"; - } - else { - echo "found file for reading\n"; - fclose($h); - } + $h = fopen($tmpfile, "r", true); + if ($h === false) { + echo "could not find file for reading\n"; + } + else { + echo "found file for reading\n"; + fclose($h); + } - unlink($tmpfile); + unlink($tmpfile); rmdir($dir1.'/'.$extraDir); rmdir($extraDir); } ?> -===DONE=== --EXPECT-- Not created in dir1 found file for reading Not created in dir1 found file for reading -===DONE=== diff --git a/ext/standard/tests/file/fopen_variation19.phpt b/ext/standard/tests/file/fopen_variation19.phpt index 069ce11170..8dd9d756ad 100644 --- a/ext/standard/tests/file/fopen_variation19.phpt +++ b/ext/standard/tests/file/fopen_variation19.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]]) - * Description: Open a file or a URL and return a file pointer - * Source code: ext/standard/file.c - * Alias to functions: - */ - $tmpDir = 'fopenVar19.Dir'; $realFilename = __FILE__.'.real'; $sortFilename = __FILE__.'.soft'; @@ -92,7 +86,6 @@ function writeFile($file) { ?> -===DONE=== --EXPECT-- *** Testing fopen() : variation *** *** testing reading of links *** @@ -107,4 +100,3 @@ link of link:Hello World again! again! again! soft link:Goodbye World hard link:Goodbye World link of link:Goodbye World -===DONE=== diff --git a/ext/standard/tests/file/fopen_variation5.phpt b/ext/standard/tests/file/fopen_variation5.phpt index a3f5c1d3be..ea2ee4c56d 100644 --- a/ext/standard/tests/file/fopen_variation5.phpt +++ b/ext/standard/tests/file/fopen_variation5.phpt @@ -4,14 +4,6 @@ Test fopen() function : variation: use include path and stream context (absolute Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]]) - * Description: Open a file or a URL and return a file pointer - * Source code: ext/standard/file.c - * Alias to functions: - */ - - - //create the include directory structure $thisTestDir = basename(__FILE__, ".php") . ".dir"; mkdir($thisTestDir); @@ -121,7 +113,6 @@ function test_fopen($mode) { } ?> -===DONE=== --EXPECT-- --- testing include path --- @@ -145,4 +136,3 @@ in dir1 in dir1 in working dir in script dir -===DONE=== diff --git a/ext/standard/tests/file/fopen_variation6.phpt b/ext/standard/tests/file/fopen_variation6.phpt index a3ce051deb..eda07590c9 100644 --- a/ext/standard/tests/file/fopen_variation6.phpt +++ b/ext/standard/tests/file/fopen_variation6.phpt @@ -4,12 +4,6 @@ Test fopen() function : variation: use include path and stream context relative/ Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]]) - * Description: Open a file or a URL and return a file pointer - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing fopen() : variation ***\n"; $absfile = __FILE__.'.tmp'; $relfile = "fopen_variation6.tmp"; @@ -36,9 +30,7 @@ echo "\n"; unlink($absfile); unlink($relfile); ?> -===DONE=== --EXPECT-- *** Testing fopen() : variation *** This is an absolute file This is a relative file -===DONE=== diff --git a/ext/standard/tests/file/fopen_variation7.phpt b/ext/standard/tests/file/fopen_variation7.phpt index 531b27e0bc..5c80acc212 100644 --- a/ext/standard/tests/file/fopen_variation7.phpt +++ b/ext/standard/tests/file/fopen_variation7.phpt @@ -4,12 +4,6 @@ Test fopen() function : variation: use include path create a file (relative) Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]]) - * Description: Open a file or a URL and return a file pointer - * Source code: ext/standard/file.c - * Alias to functions: - */ - require_once('fopen_include_path.inc'); $thisTestDir = basename(__FILE__, ".php") . ".dir"; @@ -29,37 +23,35 @@ rmdir($thisTestDir); function runtest() { global $dir1; - $tmpfile = basename(__FILE__, ".php") . ".tmp"; - $h = fopen($tmpfile, "w", true); - fwrite($h, "This is the test file"); - fclose($h); - - - $h = @fopen($tmpfile, "r"); - if ($h === false) { - echo "Not created in working dir\n"; - } - else { - echo "created in working dir\n"; - fclose($h); - unlink($tmpfile); - } - - $h = @fopen($dir1.'/'.$tmpfile, "r"); - if ($h === false) { - echo "Not created in dir1\n"; - } - else { - echo "created in dir1\n"; - fclose($h); - unlink($dir1.'/'.$tmpfile); - } + $tmpfile = basename(__FILE__, ".php") . ".tmp"; + $h = fopen($tmpfile, "w", true); + fwrite($h, "This is the test file"); + fclose($h); + + + $h = @fopen($tmpfile, "r"); + if ($h === false) { + echo "Not created in working dir\n"; + } + else { + echo "created in working dir\n"; + fclose($h); + unlink($tmpfile); + } + + $h = @fopen($dir1.'/'.$tmpfile, "r"); + if ($h === false) { + echo "Not created in dir1\n"; + } + else { + echo "created in dir1\n"; + fclose($h); + unlink($dir1.'/'.$tmpfile); + } } ?> -===DONE=== --EXPECT-- created in working dir Not created in dir1 created in working dir Not created in dir1 -===DONE=== diff --git a/ext/standard/tests/file/fopen_variation8.phpt b/ext/standard/tests/file/fopen_variation8.phpt index 3647191128..34491bb82e 100644 --- a/ext/standard/tests/file/fopen_variation8.phpt +++ b/ext/standard/tests/file/fopen_variation8.phpt @@ -4,14 +4,6 @@ Test fopen() function : variation: use include path and stream context (relative Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]]) - * Description: Open a file or a URL and return a file pointer - * Source code: ext/standard/file.c - * Alias to functions: - */ - - - $thisTestDir = basename(__FILE__, ".php") . ".dir"; mkdir($thisTestDir); chdir($thisTestDir); @@ -120,7 +112,6 @@ function test_fopen($mode) { } ?> -===DONE=== --EXPECT-- --- testing include path --- @@ -144,4 +135,3 @@ in dir1 in dir1 in working dir in script dir -===DONE=== diff --git a/ext/standard/tests/file/fopen_variation9.phpt b/ext/standard/tests/file/fopen_variation9.phpt index 5479ddcf2d..fa1ebcf4e0 100644 --- a/ext/standard/tests/file/fopen_variation9.phpt +++ b/ext/standard/tests/file/fopen_variation9.phpt @@ -4,12 +4,6 @@ Test fopen() function : variation: use include path and stream context create a Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]]) - * Description: Open a file or a URL and return a file pointer - * Source code: ext/standard/file.c - * Alias to functions: - */ - require_once('fopen_include_path.inc'); $thisTestDir = basename(__FILE__, ".php") . ".dir"; @@ -29,37 +23,35 @@ chdir(".."); rmdir($thisTestDir); function runtest() { - $tmpfile = basename(__FILE__, ".php") . ".tmp"; - $h = fopen($tmpfile, "w", true); - fwrite($h, "This is the test file"); - fclose($h); - - - $h = @fopen($tmpfile, "r"); - if ($h === false) { - echo "Not created in working dir\n"; - } - else { - echo "created in working dir\n"; - fclose($h); - unlink($tmpfile); - } - - $h = @fopen('dir1/'.$tmpfile, "r"); - if ($h === false) { - echo "Not created in dir1\n"; - } - else { - echo "created in dir1\n"; - fclose($h); - unlink('dir1/'.$tmpfile); - } + $tmpfile = basename(__FILE__, ".php") . ".tmp"; + $h = fopen($tmpfile, "w", true); + fwrite($h, "This is the test file"); + fclose($h); + + + $h = @fopen($tmpfile, "r"); + if ($h === false) { + echo "Not created in working dir\n"; + } + else { + echo "created in working dir\n"; + fclose($h); + unlink($tmpfile); + } + + $h = @fopen('dir1/'.$tmpfile, "r"); + if ($h === false) { + echo "Not created in dir1\n"; + } + else { + echo "created in dir1\n"; + fclose($h); + unlink('dir1/'.$tmpfile); + } } ?> -===DONE=== --EXPECT-- created in working dir Not created in dir1 created in working dir Not created in dir1 -===DONE=== diff --git a/ext/standard/tests/file/fopencookie.phpt b/ext/standard/tests/file/fopencookie.phpt index 20fd181cbd..03c9a84cd4 100644 --- a/ext/standard/tests/file/fopencookie.phpt +++ b/ext/standard/tests/file/fopencookie.phpt @@ -17,68 +17,68 @@ fopencookie detected and working (or cast mechanism works) */ class userstream { - public $position = 0; - public $data = "If you can read this, it worked"; + public $position = 0; + public $data = "If you can read this, it worked"; - function stream_open($path, $mode, $options, &$opened_path) - { - return true; - } + function stream_open($path, $mode, $options, &$opened_path) + { + return true; + } - function stream_read($count) - { - $ret = substr($this->data, $this->position, $count); - $this->position += strlen($ret); - return $ret; - } + function stream_read($count) + { + $ret = substr($this->data, $this->position, $count); + $this->position += strlen($ret); + return $ret; + } - function stream_tell() - { - return $this->position; - } + function stream_tell() + { + return $this->position; + } - function stream_eof() - { - return $this->position >= strlen($this->data); - } + function stream_eof() + { + return $this->position >= strlen($this->data); + } - function stream_seek($offset, $whence) - { - switch($whence) { - case SEEK_SET: - if ($offset < strlen($this->data) && $offset >= 0) { - $this->position = $offset; - return true; - } else { - return false; - } - break; - case SEEK_CUR: - if ($offset >= 0) { - $this->position += $offset; - return true; - } else { - return false; - } - break; - case SEEK_END: - if (strlen($this->data) + $offset >= 0) { - $this->position = strlen($this->data) + $offset; - return true; - } else { - return false; - } - break; - default: - return false; - } - } - function stream_stat() { - return array('size' => strlen($this->data)); - } - function stream_set_option($option, $arg1, $arg2) { - return false; - } + function stream_seek($offset, $whence) + { + switch($whence) { + case SEEK_SET: + if ($offset < strlen($this->data) && $offset >= 0) { + $this->position = $offset; + return true; + } else { + return false; + } + break; + case SEEK_CUR: + if ($offset >= 0) { + $this->position += $offset; + return true; + } else { + return false; + } + break; + case SEEK_END: + if (strlen($this->data) + $offset >= 0) { + $this->position = strlen($this->data) + $offset; + return true; + } else { + return false; + } + break; + default: + return false; + } + } + function stream_stat() { + return array('size' => strlen($this->data)); + } + function stream_set_option($option, $arg1, $arg2) { + return false; + } } stream_wrapper_register("cookietest", "userstream"); diff --git a/ext/standard/tests/file/fpassthru_basic.phpt b/ext/standard/tests/file/fpassthru_basic.phpt index 9376714368..de16738a3a 100644 --- a/ext/standard/tests/file/fpassthru_basic.phpt +++ b/ext/standard/tests/file/fpassthru_basic.phpt @@ -2,19 +2,13 @@ Test fpassthru() function: Basic functionality --FILE-- <?php -/* -Prototype: int fpassthru ( resource $handle ); -Description: Reads to EOF on the given file pointer from the current position - and writes the results to the output buffer. -*/ - $file_name = __DIR__."/passthru.tmp"; $write_handle = fopen($file_name, "w"); -$string = "Hello, world\n, abcdefg\tadsdsfdf\n8u2394723947\t$%$%#$%#$%#^#%^ +$string = "Hello, world\n, abcdefg\tadsdsfdf\n8u2394723947\t$%$%#$%#$%#^#%^ Hello, world\n, abcdefg\tadsdsfdf\n8u2394723947\t$%$%#$%#$%#^#%^\n"; if(substr(PHP_OS, 0, 3) == "WIN") { - $string = str_replace("\r",'', $string); + $string = str_replace("\r",'', $string); } fwrite($write_handle, $string); fclose($write_handle); @@ -68,60 +62,60 @@ unlink(__DIR__."/passthru.tmp"); -- Before seek operation -- Hello, world , abcdefg adsdsfdf -8u2394723947 $%$%#$%#$%#^#%^ +8u2394723947 $%$%#$%#$%#^#%^ Hello, world , abcdefg adsdsfdf 8u2394723947 $%$%#$%#$%#^#%^ -int(133) +int(132) -- After seeking position to 0 -- Hello, world , abcdefg adsdsfdf -8u2394723947 $%$%#$%#$%#^#%^ +8u2394723947 $%$%#$%#$%#^#%^ Hello, world , abcdefg adsdsfdf 8u2394723947 $%$%#$%#$%#^#%^ -int(133) +int(132) -- After seeking position to 3 -- lo, world , abcdefg adsdsfdf -8u2394723947 $%$%#$%#$%#^#%^ +8u2394723947 $%$%#$%#$%#^#%^ Hello, world , abcdefg adsdsfdf 8u2394723947 $%$%#$%#$%#^#%^ -int(130) +int(129) -- After seeking position to 13 -- , abcdefg adsdsfdf -8u2394723947 $%$%#$%#$%#^#%^ +8u2394723947 $%$%#$%#$%#^#%^ Hello, world , abcdefg adsdsfdf 8u2394723947 $%$%#$%#$%#^#%^ -int(120) +int(119) -- After seeking position to 14 -- abcdefg adsdsfdf -8u2394723947 $%$%#$%#$%#^#%^ +8u2394723947 $%$%#$%#$%#^#%^ Hello, world , abcdefg adsdsfdf 8u2394723947 $%$%#$%#$%#^#%^ -int(119) +int(118) -- After seeking position to 23 -- adsdsfdf -8u2394723947 $%$%#$%#$%#^#%^ +8u2394723947 $%$%#$%#$%#^#%^ Hello, world , abcdefg adsdsfdf 8u2394723947 $%$%#$%#$%#^#%^ -int(110) +int(109) -- After seeking position to 34 -- -2394723947 $%$%#$%#$%#^#%^ +2394723947 $%$%#$%#$%#^#%^ Hello, world , abcdefg adsdsfdf 8u2394723947 $%$%#$%#$%#^#%^ -int(99) +int(98) -- After seeking position to 1000 -- int(0) diff --git a/ext/standard/tests/file/fpassthru_variation.phpt b/ext/standard/tests/file/fpassthru_variation.phpt index fb8c56f585..a7b821303c 100644 --- a/ext/standard/tests/file/fpassthru_variation.phpt +++ b/ext/standard/tests/file/fpassthru_variation.phpt @@ -2,12 +2,6 @@ Test fpassthru() function: Variations --FILE-- <?php -/* -Prototype: int fpassthru ( resource $handle ); -Description: Reads to EOF on the given file pointer from the current position - and writes the results to the output buffer. -*/ - echo "*** Testing fpassthru() function with files ***\n\n"; echo "--- Testing with different offsets ---\n"; diff --git a/ext/standard/tests/file/fputcsv.phpt b/ext/standard/tests/file/fputcsv.phpt index 5760882032..b303554e9c 100644 --- a/ext/standard/tests/file/fputcsv.phpt +++ b/ext/standard/tests/file/fputcsv.phpt @@ -31,14 +31,14 @@ $file = __DIR__ . '/fputcsv.csv'; $fp = fopen($file, "w"); foreach ($list as $v) { - fputcsv($fp, explode(',', $v)); + fputcsv($fp, explode(',', $v)); } fclose($fp); $res = file($file); foreach($res as &$val) { - $val = substr($val, 0, -1); + $val = substr($val, 0, -1); } echo '$list = ';var_export($res);echo ";\n"; @@ -46,7 +46,7 @@ $fp = fopen($file, "r"); $res = array(); while($l=fgetcsv($fp)) { - $res[] = join(',',$l); + $res[] = join(',',$l); } fclose($fp); @@ -55,8 +55,6 @@ echo '$list = ';var_export($res);echo ";\n"; @unlink($file); ?> -===DONE=== -<?php exit(0); ?> --EXPECT-- $list = array ( 0 => 'aaa,bbb', @@ -102,4 +100,3 @@ $list = array ( 18 => '"\\"","aaa"', 19 => '"\\""",aaa', ); -===DONE=== diff --git a/ext/standard/tests/file/fputcsv_002.phpt b/ext/standard/tests/file/fputcsv_002.phpt index db565d5223..90999a9e70 100644 --- a/ext/standard/tests/file/fputcsv_002.phpt +++ b/ext/standard/tests/file/fputcsv_002.phpt @@ -20,7 +20,7 @@ $file = __DIR__ .'/fgetcsv-test.csv'; unlink($file); ?> --EXPECTF-- -Notice: Array to string conversion in %s on line %d +Warning: Array to string conversion in %s on line %d array(7) { [0]=> int(1) diff --git a/ext/standard/tests/file/fputcsv_variation1.phpt b/ext/standard/tests/file/fputcsv_variation1.phpt index b66fdcb269..ba82b20428 100644 --- a/ext/standard/tests/file/fputcsv_variation1.phpt +++ b/ext/standard/tests/file/fputcsv_variation1.phpt @@ -2,11 +2,6 @@ Test fputcsv() : usage variations - with all parameters specified --FILE-- <?php -/* - Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] ); - Description: Format line as CSV and write to the file pointer -*/ - /* Testing fputcsv() to write to a file when all its parameters are provided */ echo "*** Testing fputcsv() : with all parameters specified ***\n"; diff --git a/ext/standard/tests/file/fputcsv_variation10.phpt b/ext/standard/tests/file/fputcsv_variation10.phpt index 23503ee1fa..ecd1846143 100644 --- a/ext/standard/tests/file/fputcsv_variation10.phpt +++ b/ext/standard/tests/file/fputcsv_variation10.phpt @@ -2,12 +2,6 @@ Test fputcsv() : usage variations - with line without any csv fields --FILE-- <?php -/* - Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] ); - Description: Format line as CSV and write to the file pointer -*/ - - /* Testing fputcsv() to write to a file when the field has no CSV format */ echo "*** Testing fputcsv() : with no CSV format in the field ***\n"; diff --git a/ext/standard/tests/file/fputcsv_variation11.phpt b/ext/standard/tests/file/fputcsv_variation11.phpt index 9c394b54e6..2347b9332c 100644 --- a/ext/standard/tests/file/fputcsv_variation11.phpt +++ b/ext/standard/tests/file/fputcsv_variation11.phpt @@ -2,11 +2,6 @@ Test fputcsv() : usage variations - with default enclosure value --FILE-- <?php -/* - Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] ); - Description: Format line as CSV and write to the file pointer -*/ - /* Testing fputcsv() to write to a file when default enclosure value is provided */ echo "*** Testing fputcsv() : with default enclosure value ***\n"; diff --git a/ext/standard/tests/file/fputcsv_variation12.phpt b/ext/standard/tests/file/fputcsv_variation12.phpt index cf1ba8126f..e5e14c0c91 100644 --- a/ext/standard/tests/file/fputcsv_variation12.phpt +++ b/ext/standard/tests/file/fputcsv_variation12.phpt @@ -2,11 +2,6 @@ Test fputcsv() : usage variations - with default enclosure and different delimiter --FILE-- <?php -/* - Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] ); - Description: Format line as CSV and write to the file pointer -*/ - /* Testing fputcsv() to write to a file when default enclosure value and delimiter value other than that in the field is provided */ diff --git a/ext/standard/tests/file/fputcsv_variation13.phpt b/ext/standard/tests/file/fputcsv_variation13.phpt index 119398e788..eb2746790b 100644 --- a/ext/standard/tests/file/fputcsv_variation13.phpt +++ b/ext/standard/tests/file/fputcsv_variation13.phpt @@ -2,11 +2,6 @@ Test fputcsv() : usage variations - with default enclosure & delimiter of two chars --FILE-- <?php -/* - Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] ); - Description: Format line as CSV and write to the file pointer -*/ - /* Testing fputcsv() to write to a file when default enclosure value and delimiter of two chars is provided */ diff --git a/ext/standard/tests/file/fputcsv_variation14.phpt b/ext/standard/tests/file/fputcsv_variation14.phpt index 79576e4656..e5e98c5ce2 100644 --- a/ext/standard/tests/file/fputcsv_variation14.phpt +++ b/ext/standard/tests/file/fputcsv_variation14.phpt @@ -2,11 +2,6 @@ Test fputcsv() : usage variations - with enclosure & delimiter of two chars(read only modes) --FILE-- <?php -/* - Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] ); - Description: Format line as CSV and write to the file pointer -*/ - /* Testing fputcsv() to write to a file when default enclosure value and delimiter of two chars is provided and file is opened in read only mode */ @@ -90,7 +85,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 12 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 12 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -102,7 +97,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 12 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 12 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -114,7 +109,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 12 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 12 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -126,7 +121,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 15 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 15 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -138,7 +133,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 15 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 15 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -150,7 +145,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 15 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 15 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -162,7 +157,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -174,7 +169,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -186,7 +181,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -198,7 +193,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -210,7 +205,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -222,7 +217,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -234,7 +229,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -246,7 +241,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -258,7 +253,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -270,7 +265,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -282,7 +277,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -294,7 +289,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -306,7 +301,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -318,7 +313,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -330,7 +325,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -342,7 +337,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 22 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 22 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -354,7 +349,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 22 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 22 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -366,7 +361,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 22 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 22 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -378,7 +373,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 24 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 24 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -390,7 +385,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 24 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 24 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) @@ -402,7 +397,7 @@ Notice: fputcsv(): delimiter must be a single character in %s on line %d Notice: fputcsv(): enclosure must be a single character in %s on line %d -Notice: fputcsv(): write of 24 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fputcsv(): Write of 24 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) diff --git a/ext/standard/tests/file/fputcsv_variation15.phpt b/ext/standard/tests/file/fputcsv_variation15.phpt index 0e9d306ffa..150fdd69d5 100644 --- a/ext/standard/tests/file/fputcsv_variation15.phpt +++ b/ext/standard/tests/file/fputcsv_variation15.phpt @@ -33,14 +33,14 @@ $file = __DIR__ . '/fputcsv_variation15.csv'; $fp = fopen($file, "w"); foreach ($list as $v) { - fputcsv($fp, explode(',', $v), ',', '"', '/'); + fputcsv($fp, explode(',', $v), ',', '"', '/'); } fclose($fp); $res = file($file); foreach($res as &$val) { - $val = substr($val, 0, -1); + $val = substr($val, 0, -1); } echo '$list = ';var_export($res);echo ";\n"; @@ -48,7 +48,7 @@ $fp = fopen($file, "r"); $res = array(); while($l=fgetcsv($fp, 0, ',', '"', '/')) { - $res[] = join(',',$l); + $res[] = join(',',$l); } fclose($fp); @@ -57,8 +57,6 @@ echo '$list = ';var_export($res);echo ";\n"; @unlink($file); ?> -===DONE=== -<?php exit(0); ?> --EXPECT-- $list = array ( 0 => 'aaa,bbb', @@ -104,4 +102,3 @@ $list = array ( 18 => '"/"","aaa"', 19 => '"/""",aaa', ); -===DONE=== diff --git a/ext/standard/tests/file/fputcsv_variation16.phpt b/ext/standard/tests/file/fputcsv_variation16.phpt index 1bae60da20..b5434312c6 100644 --- a/ext/standard/tests/file/fputcsv_variation16.phpt +++ b/ext/standard/tests/file/fputcsv_variation16.phpt @@ -14,8 +14,6 @@ rewind($stream); echo stream_get_contents($stream); fclose($stream); ?> -===DONE=== --EXPECT-- \ "\""" -===DONE=== diff --git a/ext/standard/tests/file/fputcsv_variation2.phpt b/ext/standard/tests/file/fputcsv_variation2.phpt index deb2e82565..5116940b4d 100644 --- a/ext/standard/tests/file/fputcsv_variation2.phpt +++ b/ext/standard/tests/file/fputcsv_variation2.phpt @@ -2,11 +2,6 @@ Test fputcsv() : usage variations - with delimiter as NULL --FILE-- <?php -/* - Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] ); - Description: Format line as CSV and write to the file pointer -*/ - /* Testing fputcsv() to write to a file when delimiter is NULL */ echo "*** Testing fputcsv() : with delimiter as NULL ***\n"; @@ -55,7 +50,11 @@ foreach ($csv_lists as $csv_list) { $csv_field = $csv_list[2]; // write to a file in csv format - var_dump( fputcsv($file_handle, $csv_field, NULL, $enclosure) ); + try { + var_dump( fputcsv($file_handle, $csv_field, NULL, $enclosure) ); + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; + } // check the file pointer position and eof var_dump( ftell($file_handle) ); var_dump( feof($file_handle) ); @@ -72,869 +71,653 @@ foreach ($csv_lists as $csv_list) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fputcsv() : with delimiter as NULL *** -- file opened in r+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" diff --git a/ext/standard/tests/file/fputcsv_variation3.phpt b/ext/standard/tests/file/fputcsv_variation3.phpt index 05f29bfc4c..eb8771aa4a 100644 --- a/ext/standard/tests/file/fputcsv_variation3.phpt +++ b/ext/standard/tests/file/fputcsv_variation3.phpt @@ -2,11 +2,6 @@ Test fputcsv() : usage variations - with enclosure as NULL --FILE-- <?php -/* - Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] ); - Description: Format line as CSV and write to the file pointer -*/ - /* Testing fputcsv() to write to a file when enclosure is NULL */ echo "*** Testing fputcsv() : with enclosure as NULL ***\n"; @@ -55,7 +50,11 @@ foreach ($csv_lists as $csv_list) { $csv_field = $csv_list[2]; // write to a file in csv format - var_dump( fputcsv($file_handle, $csv_field, $delimiter, NULL) ); + try { + var_dump( fputcsv($file_handle, $csv_field, $delimiter, NULL) ); + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; + } // check the file pointer position and eof var_dump( ftell($file_handle) ); var_dump( feof($file_handle) ); @@ -72,869 +71,653 @@ foreach ($csv_lists as $csv_list) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fputcsv() : with enclosure as NULL *** -- file opened in r+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): enclosure must be a character in %s on line %d -bool(false) +fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" diff --git a/ext/standard/tests/file/fputcsv_variation4.phpt b/ext/standard/tests/file/fputcsv_variation4.phpt index 0a1a1cb5d7..a53257535a 100644 --- a/ext/standard/tests/file/fputcsv_variation4.phpt +++ b/ext/standard/tests/file/fputcsv_variation4.phpt @@ -2,11 +2,6 @@ Test fputcsv() : usage variations - with delimiter and enclosure as NULL --FILE-- <?php -/* - Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] ); - Description: Format line as CSV and write to the file pointer -*/ - /* Testing fputcsv() to write to a file when delimiter and enclosure is NULL */ echo "*** Testing fputcsv() : with delimiter and enclosure as NULL ***\n"; @@ -55,7 +50,11 @@ foreach ($csv_lists as $csv_list) { $csv_field = $csv_list[2]; // write to a file in csv format - var_dump( fputcsv($file_handle, $csv_field, NULL, NULL) ); + try { + var_dump( fputcsv($file_handle, $csv_field, NULL, NULL) ); + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; + } // check the file pointer position and eof var_dump( ftell($file_handle) ); var_dump( feof($file_handle) ); @@ -72,869 +71,653 @@ foreach ($csv_lists as $csv_list) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fputcsv() : with delimiter and enclosure as NULL *** -- file opened in r+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): delimiter must be a character in %s on line %d -bool(false) +fputcsv(): Argument #3 ($delimiter) must be a single character int(0) bool(false) string(0) "" diff --git a/ext/standard/tests/file/fputcsv_variation5.phpt b/ext/standard/tests/file/fputcsv_variation5.phpt index 1a3a37679e..9261f1d2c1 100644 --- a/ext/standard/tests/file/fputcsv_variation5.phpt +++ b/ext/standard/tests/file/fputcsv_variation5.phpt @@ -2,11 +2,6 @@ Test fputcsv() : usage variations - with default arguments value --FILE-- <?php -/* - Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] ); - Description: Format line as CSV and write to the file pointer -*/ - /* Testing fputcsv() to write to a file when default arguments values are considered */ echo "*** Testing fputcsv() : with default arguments value ***\n"; diff --git a/ext/standard/tests/file/fputcsv_variation6.phpt b/ext/standard/tests/file/fputcsv_variation6.phpt index 2812f53a0a..a385c61ce9 100644 --- a/ext/standard/tests/file/fputcsv_variation6.phpt +++ b/ext/standard/tests/file/fputcsv_variation6.phpt @@ -3,11 +3,6 @@ Test fputcsv() : usage variations - with different delimiter and enclosure --FILE-- <?php /* - Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] ); - Description: Format line as CSV and write to the file pointer -*/ - -/* Testing fputcsv() to write to a file when delimiter are different from those present in the field to be written to the file */ diff --git a/ext/standard/tests/file/fputcsv_variation7.phpt b/ext/standard/tests/file/fputcsv_variation7.phpt index 51100b4e5d..7d7586cebf 100644 --- a/ext/standard/tests/file/fputcsv_variation7.phpt +++ b/ext/standard/tests/file/fputcsv_variation7.phpt @@ -3,11 +3,6 @@ Test fputcsv() : usage variations - with different delimiter and same enclosure --FILE-- <?php /* - Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] ); - Description: Format line as CSV and write to the file pointer -*/ - -/* Testing fputcsv() to write to a file when enclosure is same but delimiter is different from those present in the field to be written to the file */ diff --git a/ext/standard/tests/file/fputcsv_variation8.phpt b/ext/standard/tests/file/fputcsv_variation8.phpt index 15f5de8e84..ed981284f5 100644 --- a/ext/standard/tests/file/fputcsv_variation8.phpt +++ b/ext/standard/tests/file/fputcsv_variation8.phpt @@ -3,11 +3,6 @@ Test fputcsv() : usage variations - with same delimiter and different enclosure --FILE-- <?php /* - Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] ); - Description: Format line as CSV and write to the file pointer -*/ - -/* Testing fputcsv() to write to a file when delimiter is same but enclosure is different from those present in the field to be written to the file */ diff --git a/ext/standard/tests/file/fputcsv_variation9.phpt b/ext/standard/tests/file/fputcsv_variation9.phpt index db5694b1bf..e030c41bd2 100644 --- a/ext/standard/tests/file/fputcsv_variation9.phpt +++ b/ext/standard/tests/file/fputcsv_variation9.phpt @@ -2,12 +2,6 @@ Test fputcsv() : usage variations - two chars as enclosure & delimiter --FILE-- <?php -/* - Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] ); - Description: Format line as CSV and write to the file pointer -*/ - - /* Testing fputcsv() to write to a file when delimiter and enclosure are of two chars each */ echo "*** Testing fputcsv() : with two chars as enclosure & delimiter ***\n"; diff --git a/ext/standard/tests/file/fread_basic.phpt b/ext/standard/tests/file/fread_basic.phpt index 80175ef37f..8f1f76a50c 100644 --- a/ext/standard/tests/file/fread_basic.phpt +++ b/ext/standard/tests/file/fread_basic.phpt @@ -2,14 +2,6 @@ Test fread() function : basic functionality --FILE-- <?php -/* - Prototype: string fread ( resource $handle [, int $length] ); - Description: reads up to length bytes from the file pointer referenced by handle. - Reading stops when up to length bytes have been read, EOF (end of file) is - reached, (for network streams) when a packet becomes available, or (after - opening userspace stream) when 8192 bytes have been read whichever comes first. -*/ - // include the file.inc for common functions for test include ("file.inc"); @@ -54,7 +46,7 @@ $file_content_types = array("numeric","text","text_with_new_line","alphanumeric" exit(); } - /* read file by giving the acutal length, check the length and content by calculating the + /* read file by giving the actual length, check the length and content by calculating the hash using md5() function */ /* Reading 1024 bytes from file, expecting 1024 bytes */ ; diff --git a/ext/standard/tests/file/fread_error.phpt b/ext/standard/tests/file/fread_error.phpt index 1c4068cd97..18bd0ae8d8 100644 --- a/ext/standard/tests/file/fread_error.phpt +++ b/ext/standard/tests/file/fread_error.phpt @@ -2,113 +2,28 @@ Test fread() function : error conditions --FILE-- <?php -/* - Prototype: string fread ( resource $handle [, int $length] ); - Description: reads up to length bytes from the file pointer referenced by handle. - Reading stops when up to length bytes have been read, EOF (end of file) is - reached, (for network streams) when a packet becomes available, or (after - opening userspace stream) when 8192 bytes have been read whichever comes first. -*/ - echo "*** Testing error conditions ***\n"; $filename = __FILE__; $file_handle = fopen($filename, "r"); -// zero argument -echo "-- Testing fread() with zero argument --\n"; -var_dump( fread() ); - -// more than expected no. of args -echo "-- Testing fread() with more than expected number of arguments --\n"; -var_dump( fread($file_handle, 10, $file_handle) ); - // invalid length argument echo "-- Testing fread() with invalid length arguments --\n"; $len = 0; -var_dump( fread($file_handle, $len) ); -$len = -10; -var_dump( fread($file_handle, $len) ); - -// test invalid arguments : non-resources -echo "-- Testing fread() with invalid arguments --\n"; -$invalid_args = array ( - "string", - 10, - 10.5, - true, - array(1,2,3), - new stdclass, -); -/* loop to test fread() with different invalid type of args */ -for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++) { - echo "-- Iteration $loop_counter --\n"; - var_dump( fread($invalid_args[$loop_counter - 1], 10) ); +try { + var_dump( fread($file_handle, $len) ); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; } -// fwrite() on a file handle which is already closed -echo "-- Testing fwrite() with closed/unset file handle --\n"; -fclose($file_handle); -var_dump( fread($file_handle,$file_content_type) ); - -// fwrite on a file handle which is unset -$fp = fopen($filename, "r"); -unset($fp); //unset file handle -var_dump( fread(@$fp,10) ); -var_dump( fclose(@$fp) ); +$len = -10; +try { + var_dump( fread($file_handle, $len) ); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} -echo "Done\n"; ---EXPECTF-- +--EXPECT-- *** Testing error conditions *** --- Testing fread() with zero argument -- - -Warning: fread() expects exactly 2 parameters, 0 given in %s on line %d -bool(false) --- Testing fread() with more than expected number of arguments -- - -Warning: fread() expects exactly 2 parameters, 3 given in %s on line %d -bool(false) -- Testing fread() with invalid length arguments -- - -Warning: fread(): Length parameter must be greater than 0 in %s on line %d -bool(false) - -Warning: fread(): Length parameter must be greater than 0 in %s on line %d -bool(false) --- Testing fread() with invalid arguments -- --- Iteration 1 -- - -Warning: fread() expects parameter 1 to be resource, string given in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: fread() expects parameter 1 to be resource, int given in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: fread() expects parameter 1 to be resource, float given in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: fread() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: fread() expects parameter 1 to be resource, array given in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: fread() expects parameter 1 to be resource, object given in %s on line %d -bool(false) --- Testing fwrite() with closed/unset file handle -- - -Notice: Undefined variable: file_content_type in %s on line %d - -Warning: fread(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: fread() expects parameter 1 to be resource, null given in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, null given in %s on line %d -bool(false) -Done +fread(): Argument #2 ($length) must be greater than 0 +fread(): Argument #2 ($length) must be greater than 0 diff --git a/ext/standard/tests/file/fread_fwrite_basic.phpt b/ext/standard/tests/file/fread_fwrite_basic.phpt index 1b47d4ddd2..97309a6e90 100644 --- a/ext/standard/tests/file/fread_fwrite_basic.phpt +++ b/ext/standard/tests/file/fread_fwrite_basic.phpt @@ -6,19 +6,9 @@ Dave Kelsey <d_kelsey@uk.ibm.com> <?php /* - * proto int fwrite(resource fp, string str [, int length]) * Function is implemented in ext/standard/file.c */ - /* - Prototype: string fread ( resource $handle [, int $length] ); - Description: reads up to length bytes from the file pointer referenced by handle. - Reading stops when up to length bytes have been read, EOF (end of file) is - reached, (for network streams) when a packet becomes available, or (after - opening userspace stream) when 8192 bytes have been read whichever comes first. -*/ - - $outputfile = __FILE__.".tmp"; echo "--- testing rw moving about the file ---\n"; diff --git a/ext/standard/tests/file/fread_variation1.phpt b/ext/standard/tests/file/fread_variation1.phpt index df9c6da8f5..31a99b29a8 100644 --- a/ext/standard/tests/file/fread_variation1.phpt +++ b/ext/standard/tests/file/fread_variation1.phpt @@ -2,14 +2,6 @@ Test fread() function : usage variations - read some/all chars, read/write modes --FILE-- <?php -/* - Prototype: string fread ( resource $handle [, int $length] ); - Description: reads up to length bytes from the file pointer referenced by handle. - Reading stops when up to length bytes have been read, EOF (end of file) is - reached, (for network streams) when a packet becomes available, or (after - opening userspace stream) when 8192 bytes have been read whichever comes first. -*/ - /* Read content less than file size & Read entire file */ @@ -79,7 +71,7 @@ foreach($file_content_types as $file_content_type) { } rewind($file_handle); - echo "-- Reading entire file content, expeceted : 1024 bytes --\n"; + echo "-- Reading entire file content, expected : 1024 bytes --\n"; // read from file, by giving the file actual size, $data_from_file = check_read($file_handle, 1024, (strstr($file_mode, "+") ? 1024 : 1024 ) ); // calculate the hash and dump it, if data read, expecting here no data was read @@ -87,7 +79,7 @@ foreach($file_content_types as $file_content_type) { var_dump( md5($data_from_file) ); // reading file by giving less than its size - echo "-- Reading file content less than max. file size, expeceted : 1000 bytes --\n"; + echo "-- Reading file content less than max. file size, expected : 1000 bytes --\n"; rewind($file_handle); $data_from_file = check_read($file_handle, 1000, (strstr($file_mode, "+") ? 1000 : 1000 ) ); // calculate the hash and dump it, if data read, expecting here no data was read @@ -109,14 +101,14 @@ echo"Done\n"; -- Testing fread() with file having content of type numeric -- -- File opened in mode a+ -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -124,14 +116,14 @@ int(1000) bool(false) string(32) "4501f99f2b79d0345f26f1394aca58a3" -- File opened in mode a+b -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -139,14 +131,14 @@ int(1000) bool(false) string(32) "4501f99f2b79d0345f26f1394aca58a3" -- File opened in mode a+t -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -154,14 +146,14 @@ int(1000) bool(false) string(32) "4501f99f2b79d0345f26f1394aca58a3" -- File opened in mode w+ -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -169,14 +161,14 @@ int(1000) bool(false) string(32) "4501f99f2b79d0345f26f1394aca58a3" -- File opened in mode w+b -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -184,14 +176,14 @@ int(1000) bool(false) string(32) "4501f99f2b79d0345f26f1394aca58a3" -- File opened in mode w+t -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -199,14 +191,14 @@ int(1000) bool(false) string(32) "4501f99f2b79d0345f26f1394aca58a3" -- File opened in mode x+ -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -214,14 +206,14 @@ int(1000) bool(false) string(32) "4501f99f2b79d0345f26f1394aca58a3" -- File opened in mode x+b -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -229,14 +221,14 @@ int(1000) bool(false) string(32) "4501f99f2b79d0345f26f1394aca58a3" -- File opened in mode x+t -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -246,14 +238,14 @@ string(32) "4501f99f2b79d0345f26f1394aca58a3" -- Testing fread() with file having content of type text -- -- File opened in mode a+ -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -261,14 +253,14 @@ int(1000) bool(false) string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd" -- File opened in mode a+b -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -276,14 +268,14 @@ int(1000) bool(false) string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd" -- File opened in mode a+t -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -291,14 +283,14 @@ int(1000) bool(false) string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd" -- File opened in mode w+ -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -306,14 +298,14 @@ int(1000) bool(false) string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd" -- File opened in mode w+b -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -321,14 +313,14 @@ int(1000) bool(false) string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd" -- File opened in mode w+t -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -336,14 +328,14 @@ int(1000) bool(false) string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd" -- File opened in mode x+ -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -351,14 +343,14 @@ int(1000) bool(false) string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd" -- File opened in mode x+b -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -366,14 +358,14 @@ int(1000) bool(false) string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd" -- File opened in mode x+t -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -383,14 +375,14 @@ string(32) "2ec76a59f8c44b8f8a0f5139f61bb1bd" -- Testing fread() with file having content of type text_with_new_line -- -- File opened in mode a+ -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -398,14 +390,14 @@ int(1000) bool(false) string(32) "a148fa8110bbac875d84fc9d7056c0a1" -- File opened in mode a+b -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -413,14 +405,14 @@ int(1000) bool(false) string(32) "a148fa8110bbac875d84fc9d7056c0a1" -- File opened in mode a+t -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -428,14 +420,14 @@ int(1000) bool(false) string(32) "a148fa8110bbac875d84fc9d7056c0a1" -- File opened in mode w+ -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -443,14 +435,14 @@ int(1000) bool(false) string(32) "a148fa8110bbac875d84fc9d7056c0a1" -- File opened in mode w+b -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -458,14 +450,14 @@ int(1000) bool(false) string(32) "a148fa8110bbac875d84fc9d7056c0a1" -- File opened in mode w+t -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -473,14 +465,14 @@ int(1000) bool(false) string(32) "a148fa8110bbac875d84fc9d7056c0a1" -- File opened in mode x+ -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -488,14 +480,14 @@ int(1000) bool(false) string(32) "a148fa8110bbac875d84fc9d7056c0a1" -- File opened in mode x+b -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -503,14 +495,14 @@ int(1000) bool(false) string(32) "a148fa8110bbac875d84fc9d7056c0a1" -- File opened in mode x+t -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -520,14 +512,14 @@ string(32) "a148fa8110bbac875d84fc9d7056c0a1" -- Testing fread() with file having content of type alphanumeric -- -- File opened in mode a+ -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "3fabd48d8eaa65c14e0d93d6880c560c" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -535,14 +527,14 @@ int(1000) bool(false) string(32) "a49d752f980184c7f44568e930f89c72" -- File opened in mode a+b -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "3fabd48d8eaa65c14e0d93d6880c560c" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -550,14 +542,14 @@ int(1000) bool(false) string(32) "a49d752f980184c7f44568e930f89c72" -- File opened in mode a+t -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "3fabd48d8eaa65c14e0d93d6880c560c" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -565,14 +557,14 @@ int(1000) bool(false) string(32) "a49d752f980184c7f44568e930f89c72" -- File opened in mode w+ -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "3fabd48d8eaa65c14e0d93d6880c560c" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -580,14 +572,14 @@ int(1000) bool(false) string(32) "a49d752f980184c7f44568e930f89c72" -- File opened in mode w+b -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "3fabd48d8eaa65c14e0d93d6880c560c" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -595,14 +587,14 @@ int(1000) bool(false) string(32) "a49d752f980184c7f44568e930f89c72" -- File opened in mode w+t -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "3fabd48d8eaa65c14e0d93d6880c560c" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -610,14 +602,14 @@ int(1000) bool(false) string(32) "a49d752f980184c7f44568e930f89c72" -- File opened in mode x+ -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "3fabd48d8eaa65c14e0d93d6880c560c" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -625,14 +617,14 @@ int(1000) bool(false) string(32) "a49d752f980184c7f44568e930f89c72" -- File opened in mode x+b -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "3fabd48d8eaa65c14e0d93d6880c560c" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK @@ -640,14 +632,14 @@ int(1000) bool(false) string(32) "a49d752f980184c7f44568e930f89c72" -- File opened in mode x+t -- --- Reading entire file content, expeceted : 1024 bytes -- +-- Reading entire file content, expected : 1024 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 1024 bytes ... OK int(1024) bool(false) string(32) "3fabd48d8eaa65c14e0d93d6880c560c" --- Reading file content less than max. file size, expeceted : 1000 bytes -- +-- Reading file content less than max. file size, expected : 1000 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 1000 bytes ... OK diff --git a/ext/standard/tests/file/fread_variation2.phpt b/ext/standard/tests/file/fread_variation2.phpt index 908ce90f2e..a16c97a745 100644 --- a/ext/standard/tests/file/fread_variation2.phpt +++ b/ext/standard/tests/file/fread_variation2.phpt @@ -2,14 +2,6 @@ Test fread() function : usage variations - read some/all chars, write only mode (Bug #42036) --FILE-- <?php -/* - Prototype: string fread ( resource $handle [, int $length] ); - Description: reads up to length bytes from the file pointer referenced by handle. - Reading stops when up to length bytes have been read, EOF (end of file) is - reached, (for network streams) when a packet becomes available, or (after - opening userspace stream) when 8192 bytes have been read whichever comes first. -*/ - /* Try reading some or all content of the file opened in write only mode */ // include the file.inc for common functions for test @@ -78,7 +70,7 @@ foreach($file_content_types as $file_content_type) { } rewind($file_handle); - echo "-- Reading entire file content, expeceted : 0 bytes --\n"; + echo "-- Reading entire file content, expected : 0 bytes --\n"; // read from file, by giving the file actual size, $data_from_file = check_read($file_handle, 1024, (strstr($file_mode, "+") ? 1024 : 0 ) ); // calculate the hash and dump it, if data read, expecting here no data was read @@ -86,7 +78,7 @@ foreach($file_content_types as $file_content_type) { var_dump( md5($data_from_file) ); // reading file by giving less than its size - echo "-- Reading file content less than max. file size, expeceted : 0 bytes --\n"; + echo "-- Reading file content less than max. file size, expected : 0 bytes --\n"; rewind($file_handle); $data_from_file = check_read($file_handle, 1000, (strstr($file_mode, "+") ? 1000 : 0 ) ); // calculate the hash and dump it, if data read, expecting here no data was read @@ -108,172 +100,172 @@ echo "Done\n"; -- Testing fread() with file having content of type numeric -- -- File opened in mode a -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode ab -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode at -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode w -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode wb -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode wt -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode x -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode xb -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode xt -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) @@ -281,172 +273,172 @@ bool(false) -- Testing fread() with file having content of type text -- -- File opened in mode a -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode ab -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode at -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode w -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode wb -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode wt -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode x -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode xb -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode xt -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) @@ -454,172 +446,172 @@ bool(false) -- Testing fread() with file having content of type text_with_new_line -- -- File opened in mode a -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode ab -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode at -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode w -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode wb -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode wt -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode x -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode xb -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode xt -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) @@ -627,172 +619,172 @@ bool(false) -- Testing fread() with file having content of type alphanumeric -- -- File opened in mode a -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode ab -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode at -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode w -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode wb -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode wt -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode x -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode xb -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) -- File opened in mode xt -- --- Reading entire file content, expeceted : 0 bytes -- +-- Reading entire file content, expected : 0 bytes -- int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading file content less than max. file size, expeceted : 0 bytes -- +-- Reading file content less than max. file size, expected : 0 bytes -- int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) diff --git a/ext/standard/tests/file/fread_variation3-win32-mb.phpt b/ext/standard/tests/file/fread_variation3-win32-mb.phpt index cbc1b6d60b..0e777f74fe 100644 --- a/ext/standard/tests/file/fread_variation3-win32-mb.phpt +++ b/ext/standard/tests/file/fread_variation3-win32-mb.phpt @@ -8,14 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* - Prototype: string fread ( resource $handle [, int $length] ); - Description: reads up to length bytes from the file pointer referenced by handle. - Reading stops when up to length bytes have been read, EOF (end of file) is - reached, (for network streams) when a packet becomes available, or (after - opening userspace stream) when 8192 bytes have been read whichever comes first. -*/ - // include the file.inc for common functions for test include ("file.inc"); @@ -84,14 +76,14 @@ foreach($file_content_types as $file_content_type) { rewind($file_handle); // read file by giving size more than its size - echo "-- Reading beyond filesize, expeceted : 1024 bytes --\n"; + echo "-- Reading beyond filesize, expected : 1024 bytes --\n"; rewind($file_handle); $data_from_file = check_read($file_handle, 1030, ( strstr($file_mode, "+") ? 1024 : 1024) ); if ( $data_from_file != false) var_dump( md5($data_from_file) ); rewind($file_handle); - echo "-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --\n"; + echo "-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --\n"; // try fread when file pointer at end fseek($file_handle, 0, SEEK_END); //reading file when file pointer at end @@ -114,126 +106,126 @@ echo"Done\n"; -- Testing fread() with file having content of type numeric -- -- File opened in mode a+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode a+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode a+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK @@ -242,126 +234,126 @@ bool(true) -- Testing fread() with file having content of type text -- -- File opened in mode a+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode a+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode a+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK @@ -370,126 +362,126 @@ bool(true) -- Testing fread() with file having content of type text_with_new_line -- -- File opened in mode a+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode a+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode a+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1137) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1137) bool(true) -- File opened in mode x+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1137) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK diff --git a/ext/standard/tests/file/fread_variation3-win32.phpt b/ext/standard/tests/file/fread_variation3-win32.phpt index d09917207e..3a6bd28246 100644 --- a/ext/standard/tests/file/fread_variation3-win32.phpt +++ b/ext/standard/tests/file/fread_variation3-win32.phpt @@ -8,14 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* - Prototype: string fread ( resource $handle [, int $length] ); - Description: reads up to length bytes from the file pointer referenced by handle. - Reading stops when up to length bytes have been read, EOF (end of file) is - reached, (for network streams) when a packet becomes available, or (after - opening userspace stream) when 8192 bytes have been read whichever comes first. -*/ - // include the file.inc for common functions for test include ("file.inc"); @@ -84,14 +76,14 @@ foreach($file_content_types as $file_content_type) { rewind($file_handle); // read file by giving size more than its size - echo "-- Reading beyond filesize, expeceted : 1024 bytes --\n"; + echo "-- Reading beyond filesize, expected : 1024 bytes --\n"; rewind($file_handle); $data_from_file = check_read($file_handle, 1030, ( strstr($file_mode, "+") ? 1024 : 1024) ); if ( $data_from_file != false) var_dump( md5($data_from_file) ); rewind($file_handle); - echo "-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --\n"; + echo "-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --\n"; // try fread when file pointer at end fseek($file_handle, 0, SEEK_END); //reading file when file pointer at end @@ -114,126 +106,126 @@ echo"Done\n"; -- Testing fread() with file having content of type numeric -- -- File opened in mode a+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode a+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode a+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK @@ -242,126 +234,126 @@ bool(true) -- Testing fread() with file having content of type text -- -- File opened in mode a+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode a+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode a+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK @@ -370,126 +362,126 @@ bool(true) -- Testing fread() with file having content of type text_with_new_line -- -- File opened in mode a+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode a+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode a+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1137) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1137) bool(true) -- File opened in mode x+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1137) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK diff --git a/ext/standard/tests/file/fread_variation3.phpt b/ext/standard/tests/file/fread_variation3.phpt index b0b374a4c6..1ccd222b22 100644 --- a/ext/standard/tests/file/fread_variation3.phpt +++ b/ext/standard/tests/file/fread_variation3.phpt @@ -8,14 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* - Prototype: string fread ( resource $handle [, int $length] ); - Description: reads up to length bytes from the file pointer referenced by handle. - Reading stops when up to length bytes have been read, EOF (end of file) is - reached, (for network streams) when a packet becomes available, or (after - opening userspace stream) when 8192 bytes have been read whichever comes first. -*/ - // include the file.inc for common functions for test include ("file.inc"); @@ -84,14 +76,14 @@ foreach($file_content_types as $file_content_type) { rewind($file_handle); // read file by giving size more than its size - echo "-- Reading beyond filesize, expeceted : 1024 bytes --\n"; + echo "-- Reading beyond filesize, expected : 1024 bytes --\n"; rewind($file_handle); $data_from_file = check_read($file_handle, 1030, ( strstr($file_mode, "+") ? 1024 : 1024) ); if ( $data_from_file != false) var_dump( md5($data_from_file) ); rewind($file_handle); - echo "-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --\n"; + echo "-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --\n"; // try fread when file pointer at end fseek($file_handle, 0, SEEK_END); //reading file when file pointer at end @@ -114,126 +106,126 @@ echo"Done\n"; -- Testing fread() with file having content of type numeric -- -- File opened in mode a+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode a+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode a+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "950b7457d1deb6332f2fc5d42f3129d6" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK @@ -242,126 +234,126 @@ bool(true) -- Testing fread() with file having content of type text -- -- File opened in mode a+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode a+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode a+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "e486000c4c8452774f746a27658d87fa" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK @@ -370,126 +362,126 @@ bool(true) -- Testing fread() with file having content of type text_with_new_line -- -- File opened in mode a+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode a+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode a+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode w+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+ -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+b -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) bool(true) -- File opened in mode x+t -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 1024 bytes ... OK int(1024) bool(true) string(32) "b09c8026a64a88d36d4c2f17983964bb" --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK diff --git a/ext/standard/tests/file/fread_variation4.phpt b/ext/standard/tests/file/fread_variation4.phpt index de2fceb034..97c6c39f9c 100644 --- a/ext/standard/tests/file/fread_variation4.phpt +++ b/ext/standard/tests/file/fread_variation4.phpt @@ -2,14 +2,6 @@ Test fread() function : usage variations - read beyond file size, write only mode --FILE-- <?php -/* - Prototype: string fread ( resource $handle [, int $length] ); - Description: reads up to length bytes from the file pointer referenced by handle. - Reading stops when up to length bytes have been read, EOF (end of file) is - reached, (for network streams) when a packet becomes available, or (after - opening userspace stream) when 8192 bytes have been read whichever comes first. -*/ - // include the file.inc for common functions for test include ("file.inc"); @@ -75,14 +67,14 @@ foreach($file_content_types as $file_content_type) { } rewind($file_handle); - echo "-- Reading beyond filesize, expeceted : 1024 bytes --\n"; + echo "-- Reading beyond filesize, expected : 1024 bytes --\n"; // read file by giving size more than its size rewind($file_handle); $data_from_file = check_read($file_handle, 1030, ( strstr($file_mode, "+") ? 1024 : 0) ); if ( $data_from_file != false) var_dump( md5($data_from_file) ); - echo "-- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes --\n"; + echo "-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes --\n"; rewind($file_handle); // try fread when file pointer at end fseek($file_handle, 0, SEEK_END); @@ -106,465 +98,465 @@ echo"Done\n"; -- Testing fread() with file having content of type numeric -- -- File opened in mode a -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode ab -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode at -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode w -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode wb -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode wt -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode x -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode xb -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode xt -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- Testing fread() with file having content of type text -- -- File opened in mode a -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode ab -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode at -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode w -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode wb -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode wt -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode x -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode xb -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode xt -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- Testing fread() with file having content of type text_with_new_line -- -- File opened in mode a -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode ab -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode at -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode w -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode wb -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode wt -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(%r1024|1137%r) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(%r1024|1137%r) bool(false) -- File opened in mode x -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode xb -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(1024) bool(false) -- File opened in mode xt -- --- Reading beyond filesize, expeceted : 1024 bytes -- +-- Reading beyond filesize, expected : 1024 bytes -- int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(0) bool(false) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- +-- Reading beyond filesize when file pointer pointing to EOF, expected : 0 bytes -- int(%r1024|1137%r) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d OK int(%r1024|1137%r) bool(false) diff --git a/ext/standard/tests/file/fscanf.phpt b/ext/standard/tests/file/fscanf.phpt index 7a5a70070e..4acadc6169 100644 --- a/ext/standard/tests/file/fscanf.phpt +++ b/ext/standard/tests/file/fscanf.phpt @@ -5,10 +5,6 @@ fscanf() tests $filename = __DIR__."/fscanf.dat"; -var_dump(fscanf()); -var_dump(fscanf(array())); -var_dump(fscanf(array(), array())); - file_put_contents($filename, "data"); $fp = fopen($filename, "rt"); @@ -22,7 +18,11 @@ var_dump($v); fclose($fp); $fp = fopen($filename, "rt"); -var_dump(fscanf($fp, "%s", $v, $v1)); +try { + fscanf($fp, "%s", $v, $v1); +} catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; +} var_dump($v); var_dump($v1); fclose($fp); @@ -30,7 +30,11 @@ fclose($fp); $v = array(); $v1 = array(); $fp = fopen($filename, "rt"); -var_dump(fscanf($fp, "", $v, $v1)); +try { + fscanf($fp, "", $v, $v1); +} catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; +} var_dump($v); var_dump($v1); fclose($fp); @@ -38,7 +42,11 @@ fclose($fp); $v = array(); $v1 = array(); $fp = fopen($filename, "rt"); -var_dump(fscanf($fp, "%.a", $v, $v1)); +try { + fscanf($fp, "%.a", $v, $v1); +} catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; +} var_dump($v); var_dump($v1); fclose($fp); @@ -54,7 +62,11 @@ fclose($fp); file_put_contents($filename, "data"); $fp = fopen($filename, "rt"); -var_dump(fscanf($fp, "%s%d", $v)); +try { + var_dump(fscanf($fp, "%s%d", $v)); +} catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; +} echo "Done\n"; ?> @@ -63,34 +75,20 @@ echo "Done\n"; $filename = __DIR__."/fscanf.dat"; unlink($filename); ?> ---EXPECTF-- -Warning: fscanf() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: fscanf() expects at least 2 parameters, 1 given in %s on line %d -NULL - -Warning: fscanf() expects parameter 1 to be resource, array given in %s on line %d -NULL +--EXPECT-- int(0) NULL int(1) string(4) "data" - -Warning: fscanf(): Variable is not assigned by any conversion specifiers in %s on line %d -int(-1) +Variable is not assigned by any conversion specifiers string(4) "data" NULL - -Warning: fscanf(): Variable is not assigned by any conversion specifiers in %s on line %d -int(-1) +Variable is not assigned by any conversion specifiers array(0) { } array(0) { } - -Warning: fscanf(): Bad scan conversion character "." in %s on line %d -int(-1) +Bad scan conversion character "." array(0) { } array(0) { @@ -98,7 +96,5 @@ array(0) { bool(false) array(0) { } - -Warning: fscanf(): Different numbers of variable names and field specifiers in %s on line %d -int(-1) +Different numbers of variable names and field specifiers Done diff --git a/ext/standard/tests/file/fscanf_error.phpt b/ext/standard/tests/file/fscanf_error.phpt index ea6a91e33d..c50af50b6d 100644 --- a/ext/standard/tests/file/fscanf_error.phpt +++ b/ext/standard/tests/file/fscanf_error.phpt @@ -2,11 +2,6 @@ Test fscanf() function: error conditions --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - echo "*** Testing fscanf() for error conditions ***\n"; $file_path = __DIR__; @@ -17,28 +12,26 @@ if ($file_handle == false) fwrite($file_handle, "hello world"); fclose($file_handle); -// zero argument -var_dump( fscanf() ); - -// single argument -$file_handle = fopen($filename, 'r'); -if ($file_handle == false) - exit("Error:failed to open file $filename"); -var_dump( fscanf($file_handle) ); -fclose($file_handle); - // invalid file handle -var_dump( fscanf($file_handle, "%s") ); +try { + fscanf($file_handle, "%s"); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} // number of formats in format strings not matching the no of variables $file_handle = fopen($filename, 'r'); if ($file_handle == false) exit("Error:failed to open file $filename"); -var_dump( fscanf($file_handle, "%d%s%f", $int_var, $string_var) ); +try { + fscanf($file_handle, "%d%s%f", $int_var, $string_var); +} catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; +} fclose($file_handle); // different invalid format strings -$invalid_formats = array( $undefined_var, undefined_constant, +$invalid_formats = array( $undefined_var, "%", "%h", "%.", "%d%m" ); @@ -48,7 +41,11 @@ foreach($invalid_formats as $format) { $file_handle = fopen($filename, 'r'); if ($file_handle == false) exit("Error:failed to open file $filename"); - var_dump( fscanf($file_handle, $format) ); + try { + var_dump(fscanf($file_handle, $format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } fclose($file_handle); } @@ -62,37 +59,15 @@ unlink($filename); ?> --EXPECTF-- *** Testing fscanf() for error conditions *** +fscanf(): supplied resource is not a valid File-Handle resource +Different numbers of variable names and field specifiers -Warning: fscanf() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: fscanf() expects at least 2 parameters, 1 given in %s on line %d -NULL - -Warning: fscanf(): supplied resource is not a valid File-Handle resource in %s on line %d -bool(false) - -Warning: fscanf(): Different numbers of variable names and field specifiers in %s on line %d -int(-1) - -Notice: Undefined variable: undefined_var in %s on line %d - -Warning: Use of undefined constant undefined_constant - assumed 'undefined_constant' (this will throw an Error in a future version of PHP) in %s on line %d -array(0) { -} +Warning: Undefined variable $undefined_var in %s on line %d array(0) { } - -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 "m" in %s on line %d -NULL +Bad scan conversion character " +Bad scan conversion character " +Bad scan conversion character "." +Bad scan conversion character "m" *** Done *** diff --git a/ext/standard/tests/file/fscanf_variation1.phpt b/ext/standard/tests/file/fscanf_variation1.phpt index 6463a2700e..e63afdea65 100644 --- a/ext/standard/tests/file/fscanf_variation1.phpt +++ b/ext/standard/tests/file/fscanf_variation1.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - return type without third argument --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* test fscanf() for its return type */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/fscanf_variation10.phpt b/ext/standard/tests/file/fscanf_variation10.phpt index 158c6579d9..1de7d25ffd 100644 --- a/ext/standard/tests/file/fscanf_variation10.phpt +++ b/ext/standard/tests/file/fscanf_variation10.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - float formats with resource --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan resource type using different float format types */ $file_path = __DIR__; @@ -42,7 +37,7 @@ $counter = 1; // writing to the file foreach($resource_types as $value) { - @fprintf($file_handle, $value); + @fprintf($file_handle, "%s", $value); @fprintf($file_handle, "\n"); } // closing the file @@ -61,7 +56,11 @@ foreach($float_formats as $float_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$float_format) ); + try { + var_dump( fscanf($file_handle,$float_format) ); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -78,7 +77,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation10.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different float format types with resource *** -- iteration 1 -- @@ -148,12 +147,8 @@ 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 +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation11.phpt b/ext/standard/tests/file/fscanf_variation11.phpt index 97dfa810a2..40560cfb39 100644 --- a/ext/standard/tests/file/fscanf_variation11.phpt +++ b/ext/standard/tests/file/fscanf_variation11.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - float formats with arrays --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan arrays using different float format types */ $file_path = __DIR__; @@ -47,7 +42,7 @@ $counter = 1; // writing to the file foreach($array_types as $value) { - @fprintf($file_handle, $value); + @fprintf($file_handle, "%s", $value); @fprintf($file_handle, "\n"); } // closing the file @@ -66,7 +61,11 @@ foreach($float_formats as $float_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$float_format) ); + try { + var_dump(fscanf($file_handle,$float_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -79,7 +78,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation11.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different float format types with arrays *** -- iteration 1 -- @@ -389,42 +388,18 @@ 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 +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 -- diff --git a/ext/standard/tests/file/fscanf_variation12.phpt b/ext/standard/tests/file/fscanf_variation12.phpt index a76e5b92a4..0969d05feb 100644 --- a/ext/standard/tests/file/fscanf_variation12.phpt +++ b/ext/standard/tests/file/fscanf_variation12.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - float formats with strings --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan strings using different float format types */ $file_path = __DIR__; @@ -67,7 +62,11 @@ foreach($float_formats as $float_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$float_format) ); + try { + var_dump(fscanf($file_handle,$float_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -80,7 +79,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation12.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different float format types with strings *** -- iteration 1 -- @@ -498,60 +497,24 @@ 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 - -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 " " +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation13.phpt b/ext/standard/tests/file/fscanf_variation13.phpt index 8f14e97e32..73806dc6e4 100644 --- a/ext/standard/tests/file/fscanf_variation13.phpt +++ b/ext/standard/tests/file/fscanf_variation13.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - float 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 float format types */ $file_path = __DIR__; @@ -53,7 +48,11 @@ foreach($float_formats as $float_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$float_format) ); + try { + var_dump(fscanf($file_handle,$float_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -66,7 +65,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation13.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different float 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 -- diff --git a/ext/standard/tests/file/fscanf_variation14.phpt b/ext/standard/tests/file/fscanf_variation14.phpt index 47caaa3568..97a07a98f2 100644 --- a/ext/standard/tests/file/fscanf_variation14.phpt +++ b/ext/standard/tests/file/fscanf_variation14.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - string formats with strings --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan different strings using different string format types */ $file_path = __DIR__; @@ -76,8 +71,12 @@ $counter = 1; // writing to the file foreach($valid_strings as $string) { - @fprintf($file_handle, $string); - @fprintf($file_handle, "\n"); + try { + fprintf($file_handle, $string); + } catch (\ValueError $e) { + } catch (\ArgumentCountError $e) { + } + fprintf($file_handle, "\n"); } // closing the file fclose($file_handle); @@ -95,7 +94,11 @@ foreach($string_formats as $string_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$string_format) ); + try { + var_dump(fscanf($file_handle,$string_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -108,7 +111,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation14.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different string format types with different string *** -- iteration 1 -- @@ -562,78 +565,30 @@ 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 - -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 " " +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 -- diff --git a/ext/standard/tests/file/fscanf_variation15.phpt b/ext/standard/tests/file/fscanf_variation15.phpt index f16b697896..b35bb1bebe 100644 --- a/ext/standard/tests/file/fscanf_variation15.phpt +++ b/ext/standard/tests/file/fscanf_variation15.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - string formats with float values --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan float values using different string format types */ $file_path = __DIR__; @@ -69,7 +64,11 @@ foreach($string_formats as $string_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$string_format) ); + try { + var_dump(fscanf($file_handle,$string_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -82,7 +81,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation15.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different string format types with float values *** -- iteration 1 -- @@ -464,51 +463,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 -- diff --git a/ext/standard/tests/file/fscanf_variation16.phpt b/ext/standard/tests/file/fscanf_variation16.phpt index a9fd0cf84d..199db82a02 100644 --- a/ext/standard/tests/file/fscanf_variation16.phpt +++ b/ext/standard/tests/file/fscanf_variation16.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - string formats with resource --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan resource type using different string format types */ $file_path = __DIR__; @@ -41,7 +36,7 @@ $counter = 1; // writing to the file foreach($resource_types as $value) { - @fprintf($file_handle, $value); + @fprintf($file_handle, "%s", $value); @fprintf($file_handle, "\n"); } // closing the file @@ -60,7 +55,11 @@ foreach($string_formats as $string_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$string_format) ); + try { + var_dump(fscanf($file_handle,$string_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -77,7 +76,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation16.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different string format types with resource *** -- iteration 1 -- @@ -147,12 +146,8 @@ 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 +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation17.phpt b/ext/standard/tests/file/fscanf_variation17.phpt index 4e976c7cb4..64080a1a83 100644 --- a/ext/standard/tests/file/fscanf_variation17.phpt +++ b/ext/standard/tests/file/fscanf_variation17.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - string formats with arrays --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan arrays using different string format types */ $file_path = __DIR__; @@ -46,7 +41,7 @@ $counter = 1; // writing to the file foreach($array_types as $value) { - @fprintf($file_handle, $value); + @fprintf($file_handle, "%s", $value); @fprintf($file_handle, "\n"); } // closing the file @@ -65,7 +60,11 @@ foreach($string_formats as $string_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$string_format) ); + try { + var_dump(fscanf($file_handle,$string_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -78,7 +77,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation17.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different string format types with arrays *** -- iteration 1 -- @@ -388,42 +387,18 @@ 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 +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 -- diff --git a/ext/standard/tests/file/fscanf_variation18.phpt b/ext/standard/tests/file/fscanf_variation18.phpt index 3887170b96..eef94173c5 100644 --- a/ext/standard/tests/file/fscanf_variation18.phpt +++ b/ext/standard/tests/file/fscanf_variation18.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - string formats with integer values --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan integer values using different string format types */ $file_path = __DIR__; @@ -73,7 +68,11 @@ foreach($string_formats as $string_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$string_format) ); + try { + var_dump(fscanf($file_handle,$string_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -86,7 +85,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation18.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different string format types with integer values *** -- iteration 1 -- @@ -540,60 +539,24 @@ 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 - -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 " " +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation19.phpt b/ext/standard/tests/file/fscanf_variation19.phpt index 5558c7786a..f5bc3f19e3 100644 --- a/ext/standard/tests/file/fscanf_variation19.phpt +++ b/ext/standard/tests/file/fscanf_variation19.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - string 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 string format types */ $file_path = __DIR__; @@ -31,8 +26,8 @@ $bool_types = array ( $string_formats = array( "%s", "%hs", "%ls", "%Ls", " %s", "%s ", "% s", - "\t%s", "\n%s", "%4s", - "%30s", "%[a-zA-Z0-9]", "%*s"); + "\t%s", "\n%s", "%4s", + "%30s", "%[a-zA-Z0-9]", "%*s"); $counter = 1; @@ -57,7 +52,11 @@ foreach($string_formats as $string_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$string_format) ); + try { + var_dump(fscanf($file_handle,$string_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -70,7 +69,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation19.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different string format types with boolean data *** -- iteration 1 -- @@ -152,18 +151,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 -- diff --git a/ext/standard/tests/file/fscanf_variation2.phpt b/ext/standard/tests/file/fscanf_variation2.phpt index 7ef77a6754..f2c5593c3e 100644 --- a/ext/standard/tests/file/fscanf_variation2.phpt +++ b/ext/standard/tests/file/fscanf_variation2.phpt @@ -3,12 +3,7 @@ Test fscanf() function: usage variations - integer formats with integer values --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - -/* Test fscanf() to scan different integer values using different interger format types */ +/* Test fscanf() to scan different integer values using different integer format types */ $file_path = __DIR__; @@ -67,7 +62,11 @@ foreach($int_formats as $int_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$int_format) ); + try { + var_dump(fscanf($file_handle,$int_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -80,7 +79,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation2.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different integer format types with different integer values *** -- iteration 1 -- @@ -534,60 +533,24 @@ 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 - -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 " " +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation20.phpt b/ext/standard/tests/file/fscanf_variation20.phpt index 2db263b79f..70b13dd55c 100644 --- a/ext/standard/tests/file/fscanf_variation20.phpt +++ b/ext/standard/tests/file/fscanf_variation20.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - char formats with integer values --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan different integer values using different char format types */ $file_path = __DIR__; @@ -43,10 +38,10 @@ $valid_ints = array( ); // various char formats $char_formats = array( "%c", - "%hc", "%lc", "%Lc", - " %c", "%c ", "% c", - "\t%c", "\n%c", "%4c", - "%30c", "%[a-bA-B@#$&]", "%*c"); + "%hc", "%lc", "%Lc", + " %c", "%c ", "% c", + "\t%c", "\n%c", "%4c", + "%30c", "%[a-bA-B@#$&]", "%*c"); $counter = 1; @@ -71,7 +66,11 @@ foreach($char_formats as $char_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$char_format) ); + try { + var_dump(fscanf($file_handle,$char_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -84,7 +83,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation20.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different char format types with different integer values *** -- iteration 1 -- @@ -538,60 +537,24 @@ 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 - -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 " " +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation21.phpt b/ext/standard/tests/file/fscanf_variation21.phpt index 1275064d6a..86968ddd11 100644 --- a/ext/standard/tests/file/fscanf_variation21.phpt +++ b/ext/standard/tests/file/fscanf_variation21.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - char formats with float values --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan float values using different char format types */ $file_path = __DIR__; @@ -42,9 +37,9 @@ $float_values = array ( $char_formats = array( "%c", "%hc", "%lc", "%Lc", - " %c", "%c ", "% c", - "\t%c", "\n%c", "%4c", - "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); + " %c", "%c ", "% c", + "\t%c", "\n%c", "%4c", + "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); $counter = 1; @@ -69,7 +64,11 @@ foreach($char_formats as $char_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$char_format) ); + try { + var_dump(fscanf($file_handle,$char_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -82,7 +81,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation21.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different char format types with float values *** -- iteration 1 -- @@ -464,51 +463,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 -- diff --git a/ext/standard/tests/file/fscanf_variation22.phpt b/ext/standard/tests/file/fscanf_variation22.phpt index adb848a908..87a5fe21bc 100644 --- a/ext/standard/tests/file/fscanf_variation22.phpt +++ b/ext/standard/tests/file/fscanf_variation22.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - char formats with resource --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan resource type using different char format types */ $file_path = __DIR__; @@ -32,16 +27,16 @@ $resource_types = array ( ); $char_formats = array( "%c", - "%hc", "%lc", "%Lc", - " %c", "%c ", "% c", - "\t%c", "\n%c", "%4c", - "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); + "%hc", "%lc", "%Lc", + " %c", "%c ", "% c", + "\t%c", "\n%c", "%4c", + "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); $counter = 1; // writing to the file foreach($resource_types as $value) { - @fprintf($file_handle, $value); + @fprintf($file_handle, "%s", $value); @fprintf($file_handle, "\n"); } // closing the file @@ -60,7 +55,11 @@ foreach($char_formats as $char_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$char_format) ); + try { + var_dump(fscanf($file_handle,$char_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -77,7 +76,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation22.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different char format types with resource *** -- iteration 1 -- @@ -147,12 +146,8 @@ 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 +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation23.phpt b/ext/standard/tests/file/fscanf_variation23.phpt index c1b9ca6580..f7bb4ee552 100644 --- a/ext/standard/tests/file/fscanf_variation23.phpt +++ b/ext/standard/tests/file/fscanf_variation23.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - char formats with arrays --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan arrays using different char format types */ $file_path = __DIR__; @@ -37,16 +32,16 @@ $array_types = array ( ); $char_formats = array( "%c", - "%hc", "%lc", "%Lc", - " %c", "%c ", "% c", - "\t%c", "\n%c", "%4c", - "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); + "%hc", "%lc", "%Lc", + " %c", "%c ", "% c", + "\t%c", "\n%c", "%4c", + "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); $counter = 1; // writing to the file foreach($array_types as $value) { - @fprintf($file_handle, $value); + @fprintf($file_handle, "%s", $value); @fprintf($file_handle, "\n"); } // closing the file @@ -65,7 +60,11 @@ foreach($char_formats as $char_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$char_format) ); + try { + var_dump(fscanf($file_handle,$char_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -78,7 +77,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation23.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different char format types with arrays *** -- iteration 1 -- @@ -388,42 +387,18 @@ 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 +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 -- diff --git a/ext/standard/tests/file/fscanf_variation24.phpt b/ext/standard/tests/file/fscanf_variation24.phpt index eb7053587c..4c46cf58da 100644 --- a/ext/standard/tests/file/fscanf_variation24.phpt +++ b/ext/standard/tests/file/fscanf_variation24.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - char formats with strings --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan strings using different char format types */ $file_path = __DIR__; @@ -43,10 +38,10 @@ $strings = array ( ); $char_formats = array( "%c", - "%hc", "%lc", "%Lc", - " %c", "%c ", "% c", - "\t%c", "\n%c", "%4c", - "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); + "%hc", "%lc", "%Lc", + " %c", "%c ", "% c", + "\t%c", "\n%c", "%4c", + "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); $counter = 1; @@ -71,7 +66,11 @@ foreach($char_formats as $char_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$char_format) ); + try { + var_dump(fscanf($file_handle,$char_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -84,7 +83,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation24.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different char format types with strings *** -- iteration 1 -- @@ -532,60 +531,24 @@ 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 - -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 " " +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation25.phpt b/ext/standard/tests/file/fscanf_variation25.phpt index 41d9bdc009..dc9d993602 100644 --- a/ext/standard/tests/file/fscanf_variation25.phpt +++ b/ext/standard/tests/file/fscanf_variation25.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - char 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 char format types */ $file_path = __DIR__; @@ -29,10 +24,10 @@ $bool_types = array ( ); $char_formats = array( "%c", - "%hc", "%lc", "%Lc", - " %c", "%c ", "% c", - "\t%c", "\n%c", "%4c", - "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); + "%hc", "%lc", "%Lc", + " %c", "%c ", "% c", + "\t%c", "\n%c", "%4c", + "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); $counter = 1; @@ -57,7 +52,11 @@ foreach($char_formats as $char_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$char_format) ); + try { + var_dump(fscanf($file_handle,$char_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -70,7 +69,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation25.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different char format types with boolean data *** -- iteration 1 -- @@ -182,18 +181,10 @@ 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 +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation26.phpt b/ext/standard/tests/file/fscanf_variation26.phpt index d777e2ce8d..19db8f45ab 100644 --- a/ext/standard/tests/file/fscanf_variation26.phpt +++ b/ext/standard/tests/file/fscanf_variation26.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - char formats with chars --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan different chars using different char format types */ $file_path = __DIR__; @@ -24,10 +19,10 @@ if($file_handle == false) $char_types = array( 'a', "a", 67, -67, 99 ); $char_formats = array( "%c", - "%hc", "%lc", "%Lc", - " %c", "%c ", "% c", - "\t%c", "\n%c", "%4c", - "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); + "%hc", "%lc", "%Lc", + " %c", "%c ", "% c", + "\t%c", "\n%c", "%4c", + "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); $counter = 1; @@ -52,7 +47,11 @@ foreach($char_formats as $char_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$char_format) ); + try { + var_dump(fscanf($file_handle,$char_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -65,7 +64,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation26.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different char format types with chars *** -- iteration 1 -- @@ -207,21 +206,11 @@ 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 +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation27.phpt b/ext/standard/tests/file/fscanf_variation27.phpt index 1d81190e9b..a9560e0425 100644 --- a/ext/standard/tests/file/fscanf_variation27.phpt +++ b/ext/standard/tests/file/fscanf_variation27.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - octal formats with integer values --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan different integer values using different octal format types */ $file_path = __DIR__; @@ -72,7 +67,11 @@ foreach($octal_formats as $octal_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$octal_format) ); + try { + var_dump(fscanf($file_handle,$octal_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -85,7 +84,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation27.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different octal format types with different integer values *** -- iteration 1 -- @@ -539,60 +538,24 @@ 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 - -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 " " +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation28.phpt b/ext/standard/tests/file/fscanf_variation28.phpt index 4a791259bc..18c9726f85 100644 --- a/ext/standard/tests/file/fscanf_variation28.phpt +++ b/ext/standard/tests/file/fscanf_variation28.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - octal formats with float values --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan float values using different octal format types */ $file_path = __DIR__; @@ -70,7 +65,11 @@ foreach($octal_formats as $octal_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$octal_format) ); + try { + var_dump(fscanf($file_handle,$octal_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -83,7 +82,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation28.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different octal format types with float values *** -- iteration 1 -- @@ -465,51 +464,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 -- diff --git a/ext/standard/tests/file/fscanf_variation29.phpt b/ext/standard/tests/file/fscanf_variation29.phpt index 1db4973290..a35d782fcd 100644 --- a/ext/standard/tests/file/fscanf_variation29.phpt +++ b/ext/standard/tests/file/fscanf_variation29.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - octal formats with resource --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan resource type using different octal format types */ $file_path = __DIR__; @@ -32,17 +27,17 @@ $resource_types = array ( ); $octal_formats = array( "%o", - "%ho", "%lo", "%Lo", - " %o", "%o ", "% o", - "\t%o", "\n%o", "%4o", - "%30o", "%[0-7]", "%*o" - ); + "%ho", "%lo", "%Lo", + " %o", "%o ", "% o", + "\t%o", "\n%o", "%4o", + "%30o", "%[0-7]", "%*o" + ); $counter = 1; // writing to the file foreach($resource_types as $value) { - @fprintf($file_handle, $value); + @fprintf($file_handle, "%s", $value); @fprintf($file_handle, "\n"); } // closing the file @@ -61,7 +56,11 @@ foreach($octal_formats as $octal_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$octal_format) ); + try { + var_dump(fscanf($file_handle,$octal_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -78,7 +77,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation29.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different octal format types with resource *** -- iteration 1 -- @@ -148,12 +147,8 @@ 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 +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation3.phpt b/ext/standard/tests/file/fscanf_variation3.phpt index 225fb6a0de..5226dba55a 100644 --- a/ext/standard/tests/file/fscanf_variation3.phpt +++ b/ext/standard/tests/file/fscanf_variation3.phpt @@ -9,11 +9,6 @@ if (PHP_INT_SIZE != 4) { --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan float values using different integer format types */ $file_path = __DIR__; @@ -71,7 +66,11 @@ foreach($int_formats as $int_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$int_format) ); + try { + var_dump( fscanf($file_handle,$int_format) ); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -84,7 +83,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation3.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different integer format types with float values *** -- iteration 1 -- @@ -466,51 +465,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 -- diff --git a/ext/standard/tests/file/fscanf_variation30.phpt b/ext/standard/tests/file/fscanf_variation30.phpt index c01f5aa2e6..9afde0f093 100644 --- a/ext/standard/tests/file/fscanf_variation30.phpt +++ b/ext/standard/tests/file/fscanf_variation30.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - octal formats with arrays --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan arrays using different octal format types */ $file_path = __DIR__; @@ -37,17 +32,17 @@ $array_types = array ( ); $octal_formats = array ( "%o", - "%ho", "%lo", "%Lo", - " %o", "%o ", "% o", - "\t%o", "\n%o", "%4o", - "%30o", "%[0-7]", "%*o" - ); + "%ho", "%lo", "%Lo", + " %o", "%o ", "% o", + "\t%o", "\n%o", "%4o", + "%30o", "%[0-7]", "%*o" + ); $counter = 1; // writing to the file foreach($array_types as $value) { - @fprintf($file_handle, $value); + @fprintf($file_handle, "%s", $value); @fprintf($file_handle, "\n"); } // closing the file @@ -66,7 +61,11 @@ foreach($octal_formats as $octal_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$octal_format) ); + try { + var_dump(fscanf($file_handle,$octal_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -79,7 +78,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation30.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different octal format types with arrays *** -- iteration 1 -- @@ -389,42 +388,18 @@ 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 +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 -- diff --git a/ext/standard/tests/file/fscanf_variation31.phpt b/ext/standard/tests/file/fscanf_variation31.phpt index 2702fbc535..a9e2c8b268 100644 --- a/ext/standard/tests/file/fscanf_variation31.phpt +++ b/ext/standard/tests/file/fscanf_variation31.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - octal formats with strings --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan strings using different octal format types */ $file_path = __DIR__; @@ -67,7 +62,11 @@ foreach($octal_formats as $octal_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$octal_format) ); + try { + var_dump(fscanf($file_handle,$octal_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -80,7 +79,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation31.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different octal format types with strings *** -- iteration 1 -- @@ -498,60 +497,24 @@ 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 - -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 " " +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation32.phpt b/ext/standard/tests/file/fscanf_variation32.phpt index 36f3f56881..df393f9d83 100644 --- a/ext/standard/tests/file/fscanf_variation32.phpt +++ b/ext/standard/tests/file/fscanf_variation32.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - octal 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 octal format types */ $file_path = __DIR__; @@ -29,11 +24,11 @@ $bool_types = array ( ); $octal_formats = array( "%o", - "%ho", "%lo", "%Lo", - " %o", "%o ", "% o", - "\t%o", "\n%o", "%4o", - "%30o", "%[0-7]", "%*o" - ); + "%ho", "%lo", "%Lo", + " %o", "%o ", "% o", + "\t%o", "\n%o", "%4o", + "%30o", "%[0-7]", "%*o" + ); $counter = 1; @@ -58,7 +53,11 @@ foreach($octal_formats as $octal_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$octal_format) ); + try { + var_dump(fscanf($file_handle,$octal_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -71,7 +70,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation32.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different octal format types with boolean data *** -- iteration 1 -- @@ -153,18 +152,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 -- diff --git a/ext/standard/tests/file/fscanf_variation33.phpt b/ext/standard/tests/file/fscanf_variation33.phpt index a444462a09..1809a0d1e5 100644 --- a/ext/standard/tests/file/fscanf_variation33.phpt +++ b/ext/standard/tests/file/fscanf_variation33.phpt @@ -9,11 +9,6 @@ if (PHP_INT_SIZE != 4) { --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan different integer values using different hexa format types */ $file_path = __DIR__; @@ -49,11 +44,11 @@ $valid_ints = array( ); // various hexa formats $hexa_formats = array( "%x", - "%xx", "%lx", "%Lx", - " %x", "%x ", "% x", - "\t%x", "\n%x", "%4x", - "%30x", "%[0-9A-Fa-f]", "%*x" - ); + "%xx", "%lx", "%Lx", + " %x", "%x ", "% x", + "\t%x", "\n%x", "%4x", + "%30x", "%[0-9A-Fa-f]", "%*x" + ); $counter = 1; @@ -78,7 +73,11 @@ foreach($hexa_formats as $hexa_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$hexa_format) ); + try { + var_dump(fscanf($file_handle,$hexa_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -91,7 +90,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation33.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different hexa format types with different integer values *** -- iteration 1 -- @@ -545,60 +544,24 @@ 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 - -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 " " +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation34.phpt b/ext/standard/tests/file/fscanf_variation34.phpt index a2d1ffdf01..ac202ab26e 100644 --- a/ext/standard/tests/file/fscanf_variation34.phpt +++ b/ext/standard/tests/file/fscanf_variation34.phpt @@ -9,11 +9,6 @@ if (PHP_INT_SIZE != 4) { --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan float values using different hexa format types */ $file_path = __DIR__; @@ -47,10 +42,10 @@ $float_values = array ( ); $hexa_formats = array( "%x", - "%hx", "%lx", "%Lx", - " %x", "%x ", "% x", - "\t%x", "\n%x", "%4x", - "%30x", "%[0-9A-Za-z]", "%*x"); + "%hx", "%lx", "%Lx", + " %x", "%x ", "% x", + "\t%x", "\n%x", "%4x", + "%30x", "%[0-9A-Za-z]", "%*x"); $counter = 1; @@ -75,7 +70,11 @@ foreach($hexa_formats as $hexa_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$hexa_format) ); + try { + var_dump(fscanf($file_handle,$hexa_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -88,7 +87,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation34.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different hexa format types with float values *** -- iteration 1 -- @@ -470,51 +469,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 -- diff --git a/ext/standard/tests/file/fscanf_variation35.phpt b/ext/standard/tests/file/fscanf_variation35.phpt index 445280c2fd..61b939d321 100644 --- a/ext/standard/tests/file/fscanf_variation35.phpt +++ b/ext/standard/tests/file/fscanf_variation35.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - hexa formats with resource --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan resource type using different hexa format types */ $file_path = __DIR__; @@ -37,7 +32,7 @@ $counter = 1; // writing to the file foreach($resource_types as $value) { - @fprintf($file_handle, $value); + @fprintf($file_handle, "%s", $value); @fprintf($file_handle, "\n"); } // closing the file @@ -56,7 +51,11 @@ foreach($hexa_formats as $hexa_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$hexa_format) ); + try { + var_dump(fscanf($file_handle,$hexa_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -73,7 +72,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation35.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different hexa format types with resource *** -- iteration 1 -- @@ -143,12 +142,8 @@ 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 +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation36.phpt b/ext/standard/tests/file/fscanf_variation36.phpt index 9eb617077d..61571f6c6c 100644 --- a/ext/standard/tests/file/fscanf_variation36.phpt +++ b/ext/standard/tests/file/fscanf_variation36.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - hexa formats with arrays --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan arrays using different hexa format types */ $file_path = __DIR__; @@ -42,7 +37,7 @@ $counter = 1; // writing to the file foreach($array_types as $value) { - @fprintf($file_handle, $value); + @fprintf($file_handle, "%s", $value); @fprintf($file_handle, "\n"); } // closing the file @@ -61,7 +56,11 @@ foreach($hexa_formats as $hexa_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$hexa_format) ); + try { + var_dump(fscanf($file_handle,$hexa_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -74,7 +73,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation36.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different hexa format types with arrays *** -- iteration 1 -- @@ -384,42 +383,18 @@ 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 +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 -- diff --git a/ext/standard/tests/file/fscanf_variation37.phpt b/ext/standard/tests/file/fscanf_variation37.phpt index 9acdfa489c..d597ebe307 100644 --- a/ext/standard/tests/file/fscanf_variation37.phpt +++ b/ext/standard/tests/file/fscanf_variation37.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - hexa formats with strings --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan strings using different hexa format types */ $file_path = __DIR__; @@ -67,7 +62,11 @@ foreach($hexa_formats as $hexa_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$hexa_format) ); + try { + var_dump(fscanf($file_handle,$hexa_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -80,7 +79,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation37.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different hexa format types with strings *** -- iteration 1 -- @@ -498,60 +497,24 @@ 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 - -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 " " +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation38.phpt b/ext/standard/tests/file/fscanf_variation38.phpt index eabe5a05b4..236d547f6b 100644 --- a/ext/standard/tests/file/fscanf_variation38.phpt +++ b/ext/standard/tests/file/fscanf_variation38.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - hexa 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 hexa format types */ $file_path = __DIR__; @@ -53,7 +48,11 @@ foreach($hexa_formats as $hexa_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$hexa_format) ); + try { + var_dump(fscanf($file_handle,$hexa_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -66,7 +65,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation38.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different hexa 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 -- diff --git a/ext/standard/tests/file/fscanf_variation39.phpt b/ext/standard/tests/file/fscanf_variation39.phpt index 011a714e1c..25a0b38706 100644 --- a/ext/standard/tests/file/fscanf_variation39.phpt +++ b/ext/standard/tests/file/fscanf_variation39.phpt @@ -9,11 +9,6 @@ if (PHP_INT_SIZE != 4) { --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan different integer values using different unsigned int format types */ $file_path = __DIR__; @@ -73,7 +68,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++; } @@ -86,7 +85,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation39.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different unsigned int format types with different integer values *** -- iteration 1 -- @@ -540,60 +539,24 @@ 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 - -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 " " +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation4.phpt b/ext/standard/tests/file/fscanf_variation4.phpt index b802a90da3..45a3b5702b 100644 --- a/ext/standard/tests/file/fscanf_variation4.phpt +++ b/ext/standard/tests/file/fscanf_variation4.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - integer formats with resource --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan resource type using different integer format types */ $file_path = __DIR__; @@ -38,7 +33,7 @@ $counter = 1; // writing to the file foreach($resource_types as $value) { - @fprintf($file_handle, $value); + @fprintf($file_handle, "%s", $value); @fprintf($file_handle, "\n"); } // closing the file @@ -57,7 +52,11 @@ foreach($int_formats as $int_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$int_format) ); + try { + var_dump(fscanf($file_handle,$int_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -74,7 +73,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation4.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different integer format types with resource *** -- iteration 1 -- @@ -144,12 +143,8 @@ 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 +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation40.phpt b/ext/standard/tests/file/fscanf_variation40.phpt index c65aaac9c7..f13af1a26a 100644 --- a/ext/standard/tests/file/fscanf_variation40.phpt +++ b/ext/standard/tests/file/fscanf_variation40.phpt @@ -9,11 +9,6 @@ if (PHP_INT_SIZE != 4) { --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan float values using different unsigned format types */ $file_path = __DIR__; @@ -71,7 +66,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 +83,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 +465,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 -- diff --git a/ext/standard/tests/file/fscanf_variation41.phpt b/ext/standard/tests/file/fscanf_variation41.phpt index 487954097f..4c993bbeec 100644 --- a/ext/standard/tests/file/fscanf_variation41.phpt +++ b/ext/standard/tests/file/fscanf_variation41.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - unsigned formats with resource --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan resource type using different unsigned format types */ $file_path = __DIR__; @@ -37,7 +32,7 @@ $counter = 1; // writing to the file foreach($resource_types as $value) { - @fprintf($file_handle, $value); + @fprintf($file_handle, "%s", $value); @fprintf($file_handle, "\n"); } // closing the file @@ -56,7 +51,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++; } @@ -73,7 +72,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation41.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different unsigned format types with resource *** -- iteration 1 -- @@ -143,12 +142,8 @@ 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 +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation42.phpt b/ext/standard/tests/file/fscanf_variation42.phpt index 45cf3696b5..90436ff124 100644 --- a/ext/standard/tests/file/fscanf_variation42.phpt +++ b/ext/standard/tests/file/fscanf_variation42.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - unsigned formats with arrays --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan arrays using different unsigned format types */ $file_path = __DIR__; @@ -42,7 +37,7 @@ $counter = 1; // writing to the file foreach($array_types as $value) { - @fprintf($file_handle, $value); + @fprintf($file_handle, "%s", $value); @fprintf($file_handle, "\n"); } // closing the file @@ -61,7 +56,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++; } @@ -74,7 +73,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation42.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different unsigned format types with arrays *** -- iteration 1 -- @@ -384,42 +383,18 @@ 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 +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 -- diff --git a/ext/standard/tests/file/fscanf_variation43.phpt b/ext/standard/tests/file/fscanf_variation43.phpt index bc19326e62..72afbba0c3 100644 --- a/ext/standard/tests/file/fscanf_variation43.phpt +++ b/ext/standard/tests/file/fscanf_variation43.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - unsigned formats with strings --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan strings using different unsigned format types */ $file_path = __DIR__; @@ -67,7 +62,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++; } @@ -80,7 +79,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation43.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different unsigned format types with strings *** -- iteration 1 -- @@ -498,60 +497,24 @@ 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 - -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 " " +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- 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 -- diff --git a/ext/standard/tests/file/fscanf_variation45.phpt b/ext/standard/tests/file/fscanf_variation45.phpt index 87192cbb7c..b694da0e55 100644 --- a/ext/standard/tests/file/fscanf_variation45.phpt +++ b/ext/standard/tests/file/fscanf_variation45.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - scientific formats with integer value --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan different integer values using different scientific format types */ $file_path = __DIR__; @@ -67,7 +62,11 @@ foreach($scientific_formats as $scientific_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$scientific_format) ); + try { + var_dump(fscanf($file_handle,$scientific_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -80,7 +79,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation45.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different scientific format types with different integer values *** -- iteration 1 -- @@ -534,60 +533,24 @@ 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 - -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 " " +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation46.phpt b/ext/standard/tests/file/fscanf_variation46.phpt index 690918bdf1..bc96af6dbe 100644 --- a/ext/standard/tests/file/fscanf_variation46.phpt +++ b/ext/standard/tests/file/fscanf_variation46.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - scientific formats with float values --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan float values using different scientific format types */ $file_path = __DIR__; @@ -65,7 +60,11 @@ foreach($scientific_formats as $scientific_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$scientific_format) ); + try { + var_dump(fscanf($file_handle,$scientific_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -78,7 +77,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation46.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different scientific format types with float values *** -- iteration 1 -- @@ -460,51 +459,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 -- diff --git a/ext/standard/tests/file/fscanf_variation47.phpt b/ext/standard/tests/file/fscanf_variation47.phpt index 6217b32b61..04b92b7e9f 100644 --- a/ext/standard/tests/file/fscanf_variation47.phpt +++ b/ext/standard/tests/file/fscanf_variation47.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - scientific formats with resource --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan resource type using different scientific format types */ $file_path = __DIR__; @@ -37,7 +32,7 @@ $counter = 1; // writing to the file foreach($resource_types as $value) { - @fprintf($file_handle, $value); + @fprintf($file_handle, "%s", $value); @fprintf($file_handle, "\n"); } // closing the file @@ -56,7 +51,11 @@ foreach($scientific_formats as $scientific_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$scientific_format) ); + try { + var_dump(fscanf($file_handle,$scientific_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -73,7 +72,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation47.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different scientific format types with resource *** -- iteration 1 -- @@ -143,12 +142,8 @@ 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 +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation48.phpt b/ext/standard/tests/file/fscanf_variation48.phpt index 355d5cf187..aa717bd83e 100644 --- a/ext/standard/tests/file/fscanf_variation48.phpt +++ b/ext/standard/tests/file/fscanf_variation48.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - scientific formats with arrays --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan arrays using different scientific format types */ $file_path = __DIR__; @@ -42,7 +37,7 @@ $counter = 1; // writing to the file foreach($array_types as $value) { - @fprintf($file_handle, $value); + @fprintf($file_handle, "%s", $value); @fprintf($file_handle, "\n"); } // closing the file @@ -61,7 +56,11 @@ foreach($scientific_formats as $scientific_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$scientific_format) ); + try { + var_dump(fscanf($file_handle,$scientific_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -74,7 +73,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation48.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different scientific format types with arrays *** -- iteration 1 -- @@ -384,42 +383,18 @@ 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 +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 -- diff --git a/ext/standard/tests/file/fscanf_variation49.phpt b/ext/standard/tests/file/fscanf_variation49.phpt index 5355db9a5a..43505fc249 100644 --- a/ext/standard/tests/file/fscanf_variation49.phpt +++ b/ext/standard/tests/file/fscanf_variation49.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - scientific formats with strings --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan strings using different scientific format types */ $file_path = __DIR__; @@ -67,7 +62,11 @@ foreach($scientific_formats as $scientific_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$scientific_format) ); + try { + var_dump(fscanf($file_handle,$scientific_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -80,7 +79,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation49.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different scientific format types with strings *** -- iteration 1 -- @@ -498,60 +497,24 @@ 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 - -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 " " +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation5.phpt b/ext/standard/tests/file/fscanf_variation5.phpt index 714a54b912..7ccdbf6402 100644 --- a/ext/standard/tests/file/fscanf_variation5.phpt +++ b/ext/standard/tests/file/fscanf_variation5.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - integer formats with arrays --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan arrays using different integer format types */ $file_path = __DIR__; @@ -42,7 +37,7 @@ $counter = 1; // writing to the file foreach($array_types as $value) { - @fprintf($file_handle, $value); + @fprintf($file_handle, "%s", $value); @fprintf($file_handle, "\n"); } // closing the file @@ -61,7 +56,11 @@ foreach($int_formats as $int_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$int_format) ); + try { + var_dump(fscanf($file_handle,$int_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -74,7 +73,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation5.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different integer format types with arrays *** -- iteration 1 -- @@ -384,42 +383,18 @@ 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 +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 -- diff --git a/ext/standard/tests/file/fscanf_variation50.phpt b/ext/standard/tests/file/fscanf_variation50.phpt index 4853ba10ca..1e6ecb865e 100644 --- a/ext/standard/tests/file/fscanf_variation50.phpt +++ b/ext/standard/tests/file/fscanf_variation50.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - scientific 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 scientific format types */ $file_path = __DIR__; @@ -53,7 +48,11 @@ foreach($scientific_formats as $scientific_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$scientific_format) ); + try { + var_dump(fscanf($file_handle,$scientific_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -66,7 +65,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation50.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different scientific 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 -- diff --git a/ext/standard/tests/file/fscanf_variation51.phpt b/ext/standard/tests/file/fscanf_variation51.phpt index 712e1e18c7..fad6132748 100644 --- a/ext/standard/tests/file/fscanf_variation51.phpt +++ b/ext/standard/tests/file/fscanf_variation51.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - file opened in write only mode --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan a file for read when file is opened inwrite only mode */ $file_path = __DIR__; @@ -70,209 +65,209 @@ if(file_exists($filename)) { -- iteration 1 -- -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -- iteration 2 -- -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -- iteration 3 -- -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -- iteration 4 -- -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -- iteration 5 -- -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -- iteration 6 -- -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -- iteration 7 -- -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -- iteration 8 -- -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -- iteration 9 -- -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) -Notice: fscanf(): read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) *** Done *** diff --git a/ext/standard/tests/file/fscanf_variation52.phpt b/ext/standard/tests/file/fscanf_variation52.phpt index 522eef0493..fbd50ca554 100644 --- a/ext/standard/tests/file/fscanf_variation52.phpt +++ b/ext/standard/tests/file/fscanf_variation52.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - empty file --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan an empty file */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/fscanf_variation53.phpt b/ext/standard/tests/file/fscanf_variation53.phpt index 5935a8a3cf..a683d0a4d4 100644 --- a/ext/standard/tests/file/fscanf_variation53.phpt +++ b/ext/standard/tests/file/fscanf_variation53.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - file pointer pointing to EOF --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to read a file when file pointer is pointing to EOF */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/fscanf_variation54.phpt b/ext/standard/tests/file/fscanf_variation54.phpt index 9833fa2872..b13a4ee1b8 100644 --- a/ext/standard/tests/file/fscanf_variation54.phpt +++ b/ext/standard/tests/file/fscanf_variation54.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - objects --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan a file to read objects */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/fscanf_variation55.phpt b/ext/standard/tests/file/fscanf_variation55.phpt index 359359d07f..3536d01b42 100644 --- a/ext/standard/tests/file/fscanf_variation55.phpt +++ b/ext/standard/tests/file/fscanf_variation55.phpt @@ -10,11 +10,6 @@ if (PHP_INT_SIZE != 4) { <?php /* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - -/* Test fscanf() to scan data using different format types and also tracking the file pointer movement along with reading */ diff --git a/ext/standard/tests/file/fscanf_variation6.phpt b/ext/standard/tests/file/fscanf_variation6.phpt index f2038cd1c8..577477e5de 100644 --- a/ext/standard/tests/file/fscanf_variation6.phpt +++ b/ext/standard/tests/file/fscanf_variation6.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - integer formats with strings --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan strings using different integer format types */ $file_path = __DIR__; @@ -67,7 +62,11 @@ foreach($int_formats as $int_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$int_format) ); + try { + var_dump(fscanf($file_handle,$int_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -80,7 +79,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation6.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different integer format types with strings *** -- iteration 1 -- @@ -498,60 +497,24 @@ 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 - -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 " " +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation7.phpt b/ext/standard/tests/file/fscanf_variation7.phpt index 5be2436607..42e2455eea 100644 --- a/ext/standard/tests/file/fscanf_variation7.phpt +++ b/ext/standard/tests/file/fscanf_variation7.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - integer 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 integer format types */ $file_path = __DIR__; @@ -53,7 +48,11 @@ foreach($int_formats as $int_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$int_format) ); + try { + var_dump(fscanf($file_handle,$int_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -66,7 +65,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation7.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different integer 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 -- diff --git a/ext/standard/tests/file/fscanf_variation8.phpt b/ext/standard/tests/file/fscanf_variation8.phpt index cd7dd35fd9..2851d7c027 100644 --- a/ext/standard/tests/file/fscanf_variation8.phpt +++ b/ext/standard/tests/file/fscanf_variation8.phpt @@ -3,11 +3,6 @@ Test fscanf() function: usage variations - float formats with float values --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan different float values using different format types */ $file_path = __DIR__; @@ -85,7 +80,11 @@ foreach($float_formats as $float_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$float_format) ); + try { + var_dump(fscanf($file_handle,$float_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -98,7 +97,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation8.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different float format types with different float values *** -- iteration 1 -- @@ -840,96 +839,36 @@ 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 - -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 " " +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 -- diff --git a/ext/standard/tests/file/fscanf_variation9.phpt b/ext/standard/tests/file/fscanf_variation9.phpt index 40470db064..eafa78cefd 100644 --- a/ext/standard/tests/file/fscanf_variation9.phpt +++ b/ext/standard/tests/file/fscanf_variation9.phpt @@ -9,11 +9,6 @@ if (PHP_INT_SIZE != 4) { --FILE-- <?php -/* - Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] ); - Description: Parses input from a file according to a format -*/ - /* Test fscanf() to scan integer values using different float format types */ $file_path = __DIR__; @@ -74,7 +69,11 @@ foreach($float_formats as $float_format) { rewind($file_handle); echo "\n-- iteration $counter --\n"; while( !feof($file_handle) ) { - var_dump( fscanf($file_handle,$float_format) ); + try { + var_dump(fscanf($file_handle,$float_format)); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } } $counter++; } @@ -87,7 +86,7 @@ $file_path = __DIR__; $filename = "$file_path/fscanf_variation9.tmp"; unlink($filename); ?> ---EXPECTF-- +--EXPECT-- *** Test fscanf(): different float format types with integer values *** -- iteration 1 -- @@ -541,60 +540,24 @@ 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 - -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 " " +Bad scan conversion character " " +Bad scan conversion character " " +Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fseek_ftell_rewind_basic1.phpt b/ext/standard/tests/file/fseek_ftell_rewind_basic1.phpt index 9b2fa584f6..93fa8429c9 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_basic1.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_basic1.phpt @@ -2,16 +2,6 @@ Test fseek(), ftell() & rewind() functions : Basic functionality - all r and a modes --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - // include the file.inc for common functions for test include ("file.inc"); diff --git a/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32-mb.phpt b/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32-mb.phpt index 2df98b4a8a..f50176590e 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32-mb.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32-mb.phpt @@ -7,16 +7,6 @@ if( substr(PHP_OS, 0, 3) != "WIN" ) ?> --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - // include the file.inc for common functions for test include ("file.inc"); diff --git a/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt b/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt index 2674fb7697..a841e365e3 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt @@ -7,16 +7,6 @@ if( substr(PHP_OS, 0, 3) != "WIN" ) ?> --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - // include the file.inc for common functions for test include ("file.inc"); diff --git a/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt b/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt index 5b1ca5fea5..96b1dde207 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt @@ -7,16 +7,6 @@ if( substr(PHP_OS, 0, 3) == "WIN" ) ?> --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - // include the file.inc for common functions for test include ("file.inc"); diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt index 9c1b3a822d..d576403644 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt @@ -3,97 +3,22 @@ Test fseek(), ftell() & rewind() functions : error conditions - fseek() --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - echo "*** Testing fseek() : error conditions ***\n"; -// zero argument -echo "-- Testing fseek() with zero argument --\n"; -var_dump( fseek() ); - -// unexpected no. of args -echo "-- Testing fseek() with unexpected number of arguments --\n"; -$fp = fopen(__FILE__, "r"); -var_dump( fseek($fp) ); -var_dump( fseek($fp, 10, $fp,10) ); - -// test invalid arguments : non-resources -echo "-- Testing fseek() with invalid arguments --\n"; -$invalid_args = array ( - "string", - 10, - 10.5, - true, - array(1,2,3), - new stdclass -); -/* loop to test fseek() with different invalid type of args */ -for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++) { - echo "-- Iteration $loop_counter --\n"; - var_dump( fseek($invalid_args[$loop_counter - 1], 10) ); -} // fseek() on a file handle which is already closed -echo "-- Testing fseek() with closed/unset file handle --"; +echo "-- Testing fseek() with closed/unset file handle --\n"; +$fp = fopen(__FILE__, "r"); fclose($fp); -var_dump(fseek($fp,10)); - -// fseek() on a file handle which is unset -$file_handle = fopen(__FILE__, "r"); -unset($file_handle); //unset file handle -var_dump( fseek(@$file_handle,10)); +try { + var_dump(fseek($fp,10)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fseek() : error conditions *** --- Testing fseek() with zero argument -- - -Warning: fseek() expects at least 2 parameters, 0 given in %s on line %d -bool(false) --- Testing fseek() with unexpected number of arguments -- - -Warning: fseek() expects at least 2 parameters, 1 given in %s on line %d -bool(false) - -Warning: fseek() expects at most 3 parameters, 4 given in %s on line %d -bool(false) --- Testing fseek() with invalid arguments -- --- Iteration 1 -- - -Warning: fseek() expects parameter 1 to be resource, string given in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: fseek() expects parameter 1 to be resource, int given in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: fseek() expects parameter 1 to be resource, float given in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: fseek() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: fseek() expects parameter 1 to be resource, array given in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: fseek() expects parameter 1 to be resource, object given in %s on line %d -bool(false) -- Testing fseek() with closed/unset file handle -- -Warning: fseek(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: fseek() expects parameter 1 to be resource, null given in %s on line %d -bool(false) +fseek(): supplied resource is not a valid stream resource Done diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt index 8835046f6c..5a947f6658 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt @@ -3,93 +3,22 @@ Test fseek(), ftell() & rewind() functions : error conditions - ftell() --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - echo "*** Testing ftell() : error conditions ***\n"; -// zero argument -echo "-- Testing ftell() with zero argument --\n"; -var_dump( ftell() ); - -// more than expected no. of args -echo "-- Testing ftell() with more than expected number of arguments --\n"; -$fp = fopen(__FILE__, "r"); -var_dump( ftell($fp, 10) ); - -// test invalid arguments : non-resources -echo "-- Testing ftell() with invalid arguments --\n"; -$invalid_args = array ( - "string", - 10, - 10.5, - true, - array(1,2,3), - new stdclass, -); -/* loop to test ftell with different invalid type of args */ -for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++) { - echo "-- Iteration $loop_counter --\n"; - var_dump( ftell($invalid_args[$loop_counter - 1]) ); -} // ftell on a file handle which is already closed -echo "-- Testing ftell with closed/unset file handle --"; +echo "-- Testing ftell with closed/unset file handle --\n"; +$fp = fopen(__FILE__, "r"); fclose($fp); -var_dump(ftell($fp)); - -// ftell on a file handle which is unset -$file_handle = fopen(__FILE__, "r"); -unset($file_handle); //unset file handle -var_dump( ftell(@$file_handle) ); +try { + var_dump(ftell($fp)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing ftell() : error conditions *** --- Testing ftell() with zero argument -- - -Warning: ftell() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) --- Testing ftell() with more than expected number of arguments -- - -Warning: ftell() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) --- Testing ftell() with invalid arguments -- --- Iteration 1 -- - -Warning: ftell() expects parameter 1 to be resource, string given in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: ftell() expects parameter 1 to be resource, int given in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: ftell() expects parameter 1 to be resource, float given in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: ftell() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: ftell() expects parameter 1 to be resource, array given in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: ftell() expects parameter 1 to be resource, object given in %s on line %d -bool(false) -- Testing ftell with closed/unset file handle -- -Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: ftell() expects parameter 1 to be resource, null given in %s on line %d -bool(false) +ftell(): supplied resource is not a valid stream resource Done diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt index 0b94bcffc7..f4212ec71b 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt @@ -3,93 +3,22 @@ Test fseek(), ftell() & rewind() functions : error conditions - rewind() --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - echo "*** Testing rewind() : error conditions ***\n"; -// zero argument -echo "-- Testing rewind() with zero argument --\n"; -var_dump( rewind() ); - -// more than expected no. of args -echo "-- Testing rewind() with more than expected number of arguments --\n"; -$fp = fopen(__FILE__, "r"); -var_dump( rewind($fp, 10) ); - -// test invalid arguments : non-resources -echo "-- Testing rewind() with invalid arguments --\n"; -$invalid_args = array ( - "string", - 10, - 10.5, - true, - array(1,2,3), - new stdclass, -); -/* loop to test rewind with different invalid type of args */ -for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++) { - echo "-- Iteration $loop_counter --\n"; - var_dump( rewind($invalid_args[$loop_counter - 1]) ); -} // rewind on a file handle which is already closed -echo "-- Testing rewind() with closed/unset file handle --"; +echo "-- Testing rewind() with closed/unset file handle --\n"; +$fp = fopen(__FILE__, "r"); fclose($fp); -var_dump(rewind($fp)); - -// rewind on a file handle which is unset -$file_handle = fopen(__FILE__, "r"); -unset($file_handle); //unset file handle -var_dump( rewind(@$file_handle) ); +try { + var_dump(rewind($fp)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing rewind() : error conditions *** --- Testing rewind() with zero argument -- - -Warning: rewind() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) --- Testing rewind() with more than expected number of arguments -- - -Warning: rewind() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) --- Testing rewind() with invalid arguments -- --- Iteration 1 -- - -Warning: rewind() expects parameter 1 to be resource, string given in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: rewind() expects parameter 1 to be resource, int given in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: rewind() expects parameter 1 to be resource, float given in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: rewind() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: rewind() expects parameter 1 to be resource, array given in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: rewind() expects parameter 1 to be resource, object given in %s on line %d -bool(false) -- Testing rewind() with closed/unset file handle -- -Warning: rewind(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: rewind() expects parameter 1 to be resource, null given in %s on line %d -bool(false) +rewind(): supplied resource is not a valid stream resource Done diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation1.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation1.phpt index 4eee279fd1..11d10ab058 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_variation1.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_variation1.phpt @@ -2,16 +2,6 @@ Test fseek(), ftell() & rewind() functions : usage variations - all r & a modes, default whence --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - // include the file.inc for common functions for test include ("file.inc"); diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation2-win32.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation2-win32.phpt index cf962e4676..08fd4adb94 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_variation2-win32.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_variation2-win32.phpt @@ -7,16 +7,6 @@ if( substr(PHP_OS, 0, 3) != "WIN" ) ?> --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - // include the file.inc for common functions for test include ("file.inc"); diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation2.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation2.phpt index 5d8caf173f..a16ebdad05 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_variation2.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_variation2.phpt @@ -7,16 +7,6 @@ if( substr(PHP_OS, 0, 3) == "WIN" ) ?> --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - // include the file.inc for common functions for test include ("file.inc"); diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation3.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation3.phpt index e46f7bc085..ffbf31b129 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_variation3.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_variation3.phpt @@ -2,16 +2,6 @@ Test fseek(), ftell() & rewind() functions : usage variations - all r and a modes, SEEK_SET --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - // include the file.inc for common functions for test include ("file.inc"); diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation4-win32.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation4-win32.phpt index bba1f9bb0c..6893b11150 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_variation4-win32.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_variation4-win32.phpt @@ -7,16 +7,6 @@ if( substr(PHP_OS, 0, 3) != "WIN" ) ?> --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - // include the file.inc for common functions for test include ("file.inc"); diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation4.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation4.phpt index a56d50fab8..7bb5e2ae7d 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_variation4.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_variation4.phpt @@ -7,16 +7,6 @@ if( substr(PHP_OS, 0, 3) == "WIN" ) ?> --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - // include the file.inc for common functions for test include ("file.inc"); diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation5.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation5.phpt index 24a8ba6a46..78fb1800a8 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_variation5.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_variation5.phpt @@ -2,16 +2,6 @@ Test fseek(), ftell() & rewind() functions : usage variations - all r & a modes, SEEK_CUR --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - // include the file.inc for common functions for test include ("file.inc"); diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation6-win32.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation6-win32.phpt index a4365f0621..188f13ea27 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_variation6-win32.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_variation6-win32.phpt @@ -7,16 +7,6 @@ if( substr(PHP_OS, 0, 3) != "WIN" ) ?> --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - // include the file.inc for common functions for test include ("file.inc"); diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation6.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation6.phpt index 7187738db8..938586277c 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_variation6.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_variation6.phpt @@ -7,16 +7,6 @@ if( substr(PHP_OS, 0, 3) == "WIN" ) ?> --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - // include the file.inc for common functions for test include ("file.inc"); diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation7.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation7.phpt index 449fe44b0d..2551267a5b 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_variation7.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_variation7.phpt @@ -2,16 +2,6 @@ Test fseek(), ftell() & rewind() functions : usage variations - all r and a modes, SEEK_END --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - // include the file.inc for common functions for test include ("file.inc"); diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation8-win32.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation8-win32.phpt index a0a90a4d89..b4180547ab 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_variation8-win32.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_variation8-win32.phpt @@ -7,16 +7,6 @@ if( substr(PHP_OS, 0, 3) != "WIN" ) ?> --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - // include the file.inc for common functions for test include ("file.inc"); diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation8.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation8.phpt index 82d4359bd3..0b7b6aacdb 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_variation8.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_variation8.phpt @@ -7,16 +7,6 @@ if( substr(PHP_OS, 0, 3) == "WIN" ) ?> --FILE-- <?php -/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] ); - Description: Seeks on a file pointer - - Prototype: bool rewind ( resource $handle ); - Description: Rewind the position of a file pointer - - Prototype: int ftell ( resource $handle ); - Description: Tells file pointer read/write position -*/ - // include the file.inc for common functions for test include ("file.inc"); diff --git a/ext/standard/tests/file/fseek_variation3.phpt b/ext/standard/tests/file/fseek_variation3.phpt index b40a08cc9a..f756f81957 100644 --- a/ext/standard/tests/file/fseek_variation3.phpt +++ b/ext/standard/tests/file/fseek_variation3.phpt @@ -4,12 +4,6 @@ Test fseek() function : variation functionality beyond file boundaries Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : proto int fseek(resource fp, int offset [, int whence]) - * Description: Seek on a file pointer - * Source code: ext/standard/file.c - * Alias to functions: gzseek - */ - echo "*** Testing fseek() : variation - beyond file boundaries ***\n"; $outputfile = __FILE__.".tmp"; diff --git a/ext/standard/tests/file/fstat.phpt b/ext/standard/tests/file/fstat.phpt index 415124046e..b48b06cfe5 100644 --- a/ext/standard/tests/file/fstat.phpt +++ b/ext/standard/tests/file/fstat.phpt @@ -8,7 +8,11 @@ $filename = __DIR__."/fstat.dat"; $fp = fopen($filename, "w"); var_dump(fstat($fp)); fclose($fp); -var_dump(fstat($fp)); +try { + var_dump(fstat($fp)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} @unlink($filename); echo "Done\n"; @@ -68,7 +72,5 @@ array(26) { ["blocks"]=> int(%i) } - -Warning: fstat(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +fstat(): supplied resource is not a valid stream resource Done diff --git a/ext/standard/tests/file/fstat_basic.phpt b/ext/standard/tests/file/fstat_basic.phpt index e1f92a7926..d5fdd44e34 100644 --- a/ext/standard/tests/file/fstat_basic.phpt +++ b/ext/standard/tests/file/fstat_basic.phpt @@ -6,7 +6,6 @@ $fp = fopen (__FILE__, 'r'); var_dump(fstat( $fp ) ); fclose($fp); ?> -===DONE=== --EXPECTF-- array(26) { [0]=> @@ -62,4 +61,3 @@ array(26) { ["blocks"]=> int(%i) } -===DONE=== diff --git a/ext/standard/tests/file/fstat_variation8.phpt b/ext/standard/tests/file/fstat_variation8.phpt index c738b1bcaa..95036f5013 100644 --- a/ext/standard/tests/file/fstat_variation8.phpt +++ b/ext/standard/tests/file/fstat_variation8.phpt @@ -15,10 +15,10 @@ foreach($stat_result as $key =>$value) { // windows, dev and rdev will not match this is expected } else { - if ($fstat_result[$key] != $value) { - echo "FAIL: stat differs at '$key'. $fstat_result[$key] -- $value\n"; - $failed = true; - } + if ($fstat_result[$key] != $value) { + echo "FAIL: stat differs at '$key'. $fstat_result[$key] -- $value\n"; + $failed = true; + } } } if ($failed !== true) { @@ -27,7 +27,5 @@ if ($failed !== true) { ?> -===DONE=== --EXPECT-- PASSED: all elements are the same -===DONE=== diff --git a/ext/standard/tests/file/ftruncate.phpt b/ext/standard/tests/file/ftruncate.phpt Binary files differindex 3779cf3378..757bbb733d 100644 --- a/ext/standard/tests/file/ftruncate.phpt +++ b/ext/standard/tests/file/ftruncate.phpt diff --git a/ext/standard/tests/file/ftruncate_bug76422.phpt b/ext/standard/tests/file/ftruncate_bug76422.phpt index 77334545a9..978a8c7a71 100644 --- a/ext/standard/tests/file/ftruncate_bug76422.phpt +++ b/ext/standard/tests/file/ftruncate_bug76422.phpt @@ -5,6 +5,10 @@ Bug #76422 ftruncate fails on files > 2GB if (PHP_INT_SIZE < 8) { die('skip.. only valid for 64-bit'); } +if (disk_free_space(__DIR__) <= 4.1 * 1024 * 1024 * 1024 ) { + // Add a bit of extra overhead for other processes, temporary files created while running tests, etc. + die('skip.. This test requires over 4GB of free disk space on this disk partition'); +} ?> --FILE-- <?php @@ -23,6 +27,8 @@ $truncate_offset = 2 * 1024 * 1024 * 1024; $ftruncate_result = ftruncate($file_handle, $truncate_offset); if (false === $ftruncate_result) { var_dump(true); + fclose($file_handle); + unlink($fn); return; } @@ -30,11 +36,17 @@ $truncate_offset = 4 * 1024 * 1024 * 1024 + 1; $ftruncate_result = ftruncate($file_handle, $truncate_offset); if (false === $ftruncate_result) { + // NOTE: unlink() is deliberately repeated - If this test runs out of disk space attempting to reserve space for this temporary file, + // then the--CLEAN-- script can't be run (if we don't delete the file), + // because there wouldn't be any free disk space to save a new php file. + fclose($file_handle); + unlink($fn); die('Truncate has failed :/'); } fclose($file_handle); var_dump(filesize($fn) >= $truncate_offset); +unlink($fn); ?> --CLEAN-- <?php diff --git a/ext/standard/tests/file/ftruncate_error.phpt b/ext/standard/tests/file/ftruncate_error.phpt index 61ba1fc509..752397a461 100644 --- a/ext/standard/tests/file/ftruncate_error.phpt +++ b/ext/standard/tests/file/ftruncate_error.phpt @@ -2,11 +2,6 @@ Test ftruncate() function : error conditions --FILE-- <?php -/* - Prototype: bool ftruncate ( resource $handle, int $size ); - Description: truncates a file to a given length -*/ - echo "*** Testing ftruncate() : error conditions ***\n"; $filename = __DIR__."/ftruncate_error.tmp"; @@ -15,51 +10,16 @@ fwrite($file_handle, "Testing ftruncate error conditions \n"); fflush($file_handle); echo "\n Initial file size = ".filesize($filename)."\n"; -echo "-- Testing ftruncate() with less than expected number of arguments --\n"; - -// zero arguments -var_dump( ftruncate() ); - -// arguments less than expected numbers -var_dump( ftruncate( $file_handle ) ); -// check the first size -var_dump( filesize($filename) ); - -echo "-- Testing ftruncate() with more than expected number of arguments --\n"; -// more than expected number of arguments -var_dump( ftruncate($file_handle, 10, 20) ); -// check the first size -var_dump( filesize($filename) ); - -// test invalid arguments : non-resources -echo "-- Testing ftruncate() with invalid file pointer --\n"; -$invalid_args = array ( - "string", - 10, - 10.5, - true, - array(1,2,3), - new stdclass, -); -/* loop to test ftruncate() with different invalid type of args */ -for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++) { - echo "-- Iteration $loop_counter --\n"; - var_dump( ftruncate($invalid_args[$loop_counter - 1], 10) ); -} - // ftruncate() on a file handle which is already closed/unset echo "-- Testing ftruncate() with closed/unset file handle --\n"; // ftruncate on close file handle fclose($file_handle); -var_dump( ftruncate($file_handle,10) ); -// check the first size -var_dump( filesize($filename) ); - -// ftruncate on a file handle which is unset -$fp = fopen($filename, "w"); -unset($fp); //unset file handle -var_dump( ftruncate(@$fp,10)); +try { + var_dump( ftruncate($file_handle,10) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} // check the first size var_dump( filesize($filename) ); @@ -70,55 +30,11 @@ echo "Done\n"; $filename = __DIR__."/ftruncate_error.tmp"; unlink( $filename ); ?> ---EXPECTF-- +--EXPECT-- *** Testing ftruncate() : error conditions *** Initial file size = 36 --- Testing ftruncate() with less than expected number of arguments -- - -Warning: ftruncate() expects exactly 2 parameters, 0 given in %s on line %d -bool(false) - -Warning: ftruncate() expects exactly 2 parameters, 1 given in %s on line %d -bool(false) -int(36) --- Testing ftruncate() with more than expected number of arguments -- - -Warning: ftruncate() expects exactly 2 parameters, 3 given in %s on line %d -bool(false) -int(36) --- Testing ftruncate() with invalid file pointer -- --- Iteration 1 -- - -Warning: ftruncate() expects parameter 1 to be resource, string given in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: ftruncate() expects parameter 1 to be resource, int given in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: ftruncate() expects parameter 1 to be resource, float given in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: ftruncate() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: ftruncate() expects parameter 1 to be resource, array given in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: ftruncate() expects parameter 1 to be resource, object given in %s on line %d -bool(false) -- Testing ftruncate() with closed/unset file handle -- - -Warning: ftruncate(): supplied resource is not a valid stream resource in %s on line %d -bool(false) -int(36) - -Warning: ftruncate() expects parameter 1 to be resource, null given in %s on line %d -bool(false) +ftruncate(): supplied resource is not a valid stream resource int(36) Done diff --git a/ext/standard/tests/file/ftruncate_variation1-win32-mb.phpt b/ext/standard/tests/file/ftruncate_variation1-win32-mb.phpt index 0cd33d6512..d9a05b951c 100644 --- a/ext/standard/tests/file/ftruncate_variation1-win32-mb.phpt +++ b/ext/standard/tests/file/ftruncate_variation1-win32-mb.phpt @@ -8,11 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* - Prototype: bool ftruncate ( resource $handle, int $size ); - Description: Truncates a file to a given length -*/ - // include common file related test functions include ("file.inc"); diff --git a/ext/standard/tests/file/ftruncate_variation1-win32.phpt b/ext/standard/tests/file/ftruncate_variation1-win32.phpt index 2ce57bff86..95aee5ef07 100644 --- a/ext/standard/tests/file/ftruncate_variation1-win32.phpt +++ b/ext/standard/tests/file/ftruncate_variation1-win32.phpt @@ -8,11 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* - Prototype: bool ftruncate ( resource $handle, int $size ); - Description: Truncates a file to a given length -*/ - // include common file related test functions include ("file.inc"); diff --git a/ext/standard/tests/file/ftruncate_variation1.phpt b/ext/standard/tests/file/ftruncate_variation1.phpt index b92d2be7e0..5880c47c1f 100644 --- a/ext/standard/tests/file/ftruncate_variation1.phpt +++ b/ext/standard/tests/file/ftruncate_variation1.phpt @@ -8,11 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* - Prototype: bool ftruncate ( resource $handle, int $size ); - Description: Truncates a file to a given length -*/ - // include common file related test functions include ("file.inc"); diff --git a/ext/standard/tests/file/ftruncate_variation2-win32.phpt b/ext/standard/tests/file/ftruncate_variation2-win32.phpt index ac485497fb..a1fe06885c 100644 --- a/ext/standard/tests/file/ftruncate_variation2-win32.phpt +++ b/ext/standard/tests/file/ftruncate_variation2-win32.phpt @@ -8,11 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* - Prototype: bool ftruncate ( resource $handle, int $size ); - Description: Truncates a file to a given length -*/ - // include common file related test functions include ("file.inc"); diff --git a/ext/standard/tests/file/ftruncate_variation2.phpt b/ext/standard/tests/file/ftruncate_variation2.phpt index f08614d182..9aacea0fbf 100644 --- a/ext/standard/tests/file/ftruncate_variation2.phpt +++ b/ext/standard/tests/file/ftruncate_variation2.phpt @@ -8,11 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* - Prototype: bool ftruncate ( resource $handle, int $size ); - Description: Truncates a file to a given length -*/ - // include common file related test functions include ("file.inc"); diff --git a/ext/standard/tests/file/ftruncate_variation3-win32.phpt b/ext/standard/tests/file/ftruncate_variation3-win32.phpt index e89372bb1f..60e31fefe1 100644 --- a/ext/standard/tests/file/ftruncate_variation3-win32.phpt +++ b/ext/standard/tests/file/ftruncate_variation3-win32.phpt @@ -8,11 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* - Prototype: bool ftruncate ( resource $handle, int $size ); - Description: Truncates a file to a given length -*/ - // include common file related test functions include ("file.inc"); diff --git a/ext/standard/tests/file/ftruncate_variation3.phpt b/ext/standard/tests/file/ftruncate_variation3.phpt index 91511fd10a..4aa939f346 100644 --- a/ext/standard/tests/file/ftruncate_variation3.phpt +++ b/ext/standard/tests/file/ftruncate_variation3.phpt @@ -8,11 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* - Prototype: bool ftruncate ( resource $handle, int $size ); - Description: Truncates a file to a given length -*/ - // include common file related test functions include ("file.inc"); diff --git a/ext/standard/tests/file/ftruncate_variation4-win32.phpt b/ext/standard/tests/file/ftruncate_variation4-win32.phpt deleted file mode 100644 index e2e92269e7..0000000000 --- a/ext/standard/tests/file/ftruncate_variation4-win32.phpt +++ /dev/null @@ -1,558 +0,0 @@ ---TEST-- -Test ftruncate() function : usage variations - truncate file to negative size ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die('skip.. only valid for Windows'); -} -?> ---FILE-- -<?php -/* - Prototype: bool ftruncate ( resource $handle, int $size ); - Description: Truncates a file to a given length -*/ - -// include common file related test functions -include ("file.inc"); - -echo "*** Testing ftruncate() : usage variations ***\n"; - -/* test ftruncate with file opened in different modes */ -$file_modes = array("r", "rb", "rt", "r+", "r+b", "r+t", - "w", "wb", "wt", "w+", "w+b", "w+t", - "x", "xb", "xt", "x+", "x+b", "x+t", - "a", "ab", "at", "a+", "a+b", "a+t"); - -$file_content_types = array("numeric","text_with_new_line"); - -foreach($file_content_types as $file_content_type) { - echo "\n-- Testing ftruncate() with file having data of type ". $file_content_type ." --\n"; - - for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - echo "-- Testing ftruncate() with file opening using $file_modes[$mode_counter] mode --\n"; - - // create 1 file with some contents - $filename = __DIR__."/ftruncate_variation4.tmp"; - if( strstr($file_modes[$mode_counter], "x") || strstr($file_modes[$mode_counter], "w") ) { - // fopen the file using the $file_modes - $file_handle = fopen($filename, $file_modes[$mode_counter]); - fill_file($file_handle, $file_content_type, 1024); - } else { - create_files ( __DIR__, 1, $file_content_type, 0755, 1, "w", "ftruncate_variation", 4); - // fopen the file using the $file_modes - $file_handle = fopen($filename, $file_modes[$mode_counter]); - } - if (!$file_handle) { - echo "Error: failed to open file $filename!\n"; - exit(); - } - - rewind($file_handle); // file pointer to 0 - - echo "-- Testing ftruncate(): try truncating file to a negative size --\n"; - /* try to truncate it to a negative size, size should not change*/ - - $new_size = -1000; - var_dump( filesize($filename) ); // current filesize - var_dump( ftell($file_handle) ); - var_dump( ftruncate($file_handle, $new_size) ); // truncate it - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - fclose($file_handle); - clearstatcache(); // clear previous size value in cache - var_dump( filesize($filename) ); // new file size = actual size, no change - - //delete all files created - delete_file( $filename ); - }//end of inner for loop -}//end of outer foreach loop -echo "Done\n"; -?> ---EXPECTF-- -*** Testing ftruncate() : usage variations *** - --- Testing ftruncate() with file having data of type numeric -- --- Testing ftruncate() with file opening using r mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using rb mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using rt mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using r+ mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using r+b mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using r+t mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using w mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using wb mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using wt mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using w+ mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using w+b mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using w+t mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using x mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using xb mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using xt mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using x+ mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using x+b mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using x+t mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using a mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using ab mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using at mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using a+ mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using a+b mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using a+t mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) - --- Testing ftruncate() with file having data of type text_with_new_line -- --- Testing ftruncate() with file opening using r mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using rb mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using rt mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using r+ mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using r+b mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using r+t mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using w mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using wb mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using wt mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1137) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1137) --- Testing ftruncate() with file opening using w+ mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using w+b mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using w+t mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1137) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1137) --- Testing ftruncate() with file opening using x mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using xb mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using xt mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1137) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1137) --- Testing ftruncate() with file opening using x+ mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using x+b mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using x+t mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1137) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1137) --- Testing ftruncate() with file opening using a mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using ab mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using at mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using a+ mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using a+b mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) --- Testing ftruncate() with file opening using a+t mode -- --- Testing ftruncate(): try truncating file to a negative size -- -int(1024) -int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) -int(0) -bool(false) -int(1024) -Done diff --git a/ext/standard/tests/file/ftruncate_variation4.phpt b/ext/standard/tests/file/ftruncate_variation4.phpt index 3d06d1eb8e..865b6ff902 100644 --- a/ext/standard/tests/file/ftruncate_variation4.phpt +++ b/ext/standard/tests/file/ftruncate_variation4.phpt @@ -1,18 +1,7 @@ --TEST-- Test ftruncate() function : usage variations - truncate file to negative size ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. Not valid for Windows'); -} -?> --FILE-- <?php -/* - Prototype: bool ftruncate ( resource $handle, int $size ); - Description: Truncates a file to a given length -*/ - // include common file related test functions include ("file.inc"); @@ -27,532 +16,442 @@ $file_modes = array("r", "rb", "rt", "r+", "r+b", "r+t", $file_content_types = array("numeric","text_with_new_line"); foreach($file_content_types as $file_content_type) { - echo "\n-- Testing ftruncate() with file having data of type ". $file_content_type ." --\n"; - - for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - echo "-- Testing ftruncate() with file opening using $file_modes[$mode_counter] mode --\n"; - - // create 1 file with some contents - $filename = __DIR__."/ftruncate_variation4.tmp"; - if( strstr($file_modes[$mode_counter], "x") || strstr($file_modes[$mode_counter], "w") ) { - // fopen the file using the $file_modes - $file_handle = fopen($filename, $file_modes[$mode_counter]); - fill_file($file_handle, $file_content_type, 1024); - } else { - create_files ( __DIR__, 1, $file_content_type, 0755, 1, "w", "ftruncate_variation", 4); - // fopen the file using the $file_modes - $file_handle = fopen($filename, $file_modes[$mode_counter]); - } - if (!$file_handle) { - echo "Error: failed to open file $filename!\n"; - exit(); - } - - rewind($file_handle); // file pointer to 0 - - echo "-- Testing ftruncate(): try truncating file to a negative size --\n"; - /* try to truncate it to a negative size, size should not change*/ - - $new_size = -1000; - var_dump( filesize($filename) ); // current filesize - var_dump( ftell($file_handle) ); - var_dump( ftruncate($file_handle, $new_size) ); // truncate it - var_dump( ftell($file_handle) ); - var_dump( feof($file_handle) ); - fclose($file_handle); - clearstatcache(); // clear previous size value in cache - var_dump( filesize($filename) ); // new file size = actual size, no change - - //delete all files created - delete_file( $filename ); - }//end of inner for loop + echo "\n-- Testing ftruncate() with file having data of type ". $file_content_type ." --\n"; + + for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { + echo "-- Testing ftruncate() with file opening using $file_modes[$mode_counter] mode --\n"; + + // create 1 file with some contents + $filename = __DIR__."/ftruncate_variation4.tmp"; + if( strstr($file_modes[$mode_counter], "x") || strstr($file_modes[$mode_counter], "w") ) { + // fopen the file using the $file_modes + $file_handle = fopen($filename, $file_modes[$mode_counter]); + fill_file($file_handle, $file_content_type, 1024); + } else { + create_files ( __DIR__, 1, $file_content_type, 0755, 1, "w", "ftruncate_variation", 4); + // fopen the file using the $file_modes + $file_handle = fopen($filename, $file_modes[$mode_counter]); + } + if (!$file_handle) { + echo "Error: failed to open file $filename!\n"; + exit(); + } + + rewind($file_handle); // file pointer to 0 + + echo "-- Testing ftruncate(): try truncating file to a negative size --\n"; + /* try to truncate it to a negative size, size should not change*/ + + $new_size = -1000; + $file_size = filesize($filename); // current filesize + var_dump($file_size === 1024 || $file_size === 1137); // 1137 is for Windows with 't' mode + var_dump( ftell($file_handle) ); + try { + var_dump( ftruncate($file_handle, $new_size) ); // truncate it + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; + } + var_dump( ftell($file_handle) ); + var_dump( feof($file_handle) ); + fclose($file_handle); + clearstatcache(); // clear previous size value in cache + $file_size = filesize($filename); // new file size = actual size, no change + var_dump($file_size === 1024 || $file_size === 1137); // 1137 is for Windows with 't' mode + + //delete all files created + delete_file( $filename ); + }//end of inner for loop }//end of outer foreach loop echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing ftruncate() : usage variations *** -- Testing ftruncate() with file having data of type numeric -- -- Testing ftruncate() with file opening using r mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using rb mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using rt mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using r+ mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using r+b mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using r+t mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using w mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using wb mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using wt mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using w+ mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using w+b mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using w+t mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using x mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using xb mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using xt mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using x+ mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using x+b mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using x+t mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using a mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using ab mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using at mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using a+ mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using a+b mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using a+t mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file having data of type text_with_new_line -- -- Testing ftruncate() with file opening using r mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using rb mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using rt mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using r+ mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using r+b mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using r+t mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using w mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using wb mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using wt mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using w+ mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using w+b mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using w+t mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using x mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using xb mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using xt mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using x+ mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using x+b mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using x+t mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using a mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using ab mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using at mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using a+ mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using a+b mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) -- Testing ftruncate() with file opening using a+t mode -- -- Testing ftruncate(): try truncating file to a negative size -- -int(1024) +bool(true) int(0) - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) -int(1024) +bool(true) Done diff --git a/ext/standard/tests/file/ftruncate_variation5-win32.phpt b/ext/standard/tests/file/ftruncate_variation5-win32.phpt index e796129658..7d20e16ca6 100644 --- a/ext/standard/tests/file/ftruncate_variation5-win32.phpt +++ b/ext/standard/tests/file/ftruncate_variation5-win32.phpt @@ -8,11 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* - Prototype: bool ftruncate ( resource $handle, int $size ); - Description: Truncates a file to a given length -*/ - // include common file related test functions include ("file.inc"); diff --git a/ext/standard/tests/file/ftruncate_variation5.phpt b/ext/standard/tests/file/ftruncate_variation5.phpt index a072d1a7e3..dcc517f5ba 100644 --- a/ext/standard/tests/file/ftruncate_variation5.phpt +++ b/ext/standard/tests/file/ftruncate_variation5.phpt @@ -8,11 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* - Prototype: bool ftruncate ( resource $handle, int $size ); - Description: Truncates a file to a given length -*/ - // include common file related test functions include ("file.inc"); diff --git a/ext/standard/tests/file/ftruncate_variation6-win32.phpt b/ext/standard/tests/file/ftruncate_variation6-win32.phpt index 710a6ed731..4b785ffbe1 100644 --- a/ext/standard/tests/file/ftruncate_variation6-win32.phpt +++ b/ext/standard/tests/file/ftruncate_variation6-win32.phpt @@ -8,11 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* - Prototype: bool ftruncate ( resource $handle, int $size ); - Description: Truncates a file to a given length -*/ - /* truncate the file to smaller size and display the content */ // include common file related test functions diff --git a/ext/standard/tests/file/ftruncate_variation6.phpt b/ext/standard/tests/file/ftruncate_variation6.phpt index 5e492763ab..fdbfa91607 100644 --- a/ext/standard/tests/file/ftruncate_variation6.phpt +++ b/ext/standard/tests/file/ftruncate_variation6.phpt @@ -8,11 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* - Prototype: bool ftruncate ( resource $handle, int $size ); - Description: Truncates a file to a given length -*/ - /* truncate the file to smaller size and display the content */ // include common file related test functions diff --git a/ext/standard/tests/file/ftruncate_variation7-win32.phpt b/ext/standard/tests/file/ftruncate_variation7-win32.phpt index 1d367669cd..aba4a66479 100644 --- a/ext/standard/tests/file/ftruncate_variation7-win32.phpt +++ b/ext/standard/tests/file/ftruncate_variation7-win32.phpt @@ -8,11 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* - Prototype: bool ftruncate ( resource $handle, int $size ); - Description: Truncates a file to a given length -*/ - /* truncate the file when file pointer is positioned at end of the file */ // include common file related test functions include ("file.inc"); diff --git a/ext/standard/tests/file/ftruncate_variation7.phpt b/ext/standard/tests/file/ftruncate_variation7.phpt index 5e8b431bfa..64e5df158b 100644 --- a/ext/standard/tests/file/ftruncate_variation7.phpt +++ b/ext/standard/tests/file/ftruncate_variation7.phpt @@ -8,11 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* - Prototype: bool ftruncate ( resource $handle, int $size ); - Description: Truncates a file to a given length -*/ - /* truncate the file when file pointer is positioned at end of the file */ // include common file related test functions include ("file.inc"); diff --git a/ext/standard/tests/file/fwrite.phpt b/ext/standard/tests/file/fwrite.phpt index 7cdb270ae3..90e158d048 100644 --- a/ext/standard/tests/file/fwrite.phpt +++ b/ext/standard/tests/file/fwrite.phpt @@ -6,8 +6,7 @@ fwrite() tests $filename = __DIR__."/fwrite.dat"; $fp = fopen($filename, "w"); -var_dump(fwrite($fp)); -var_dump(fwrite($fp, array())); +var_dump(fwrite($fp, "")); fclose($fp); $fp = fopen($filename, "r"); @@ -20,35 +19,18 @@ fclose($fp); var_dump(fwrite($fp, "data", -1)); -var_dump(fwrite(array(), "data", -1)); -var_dump(fwrite(array(), "data")); -var_dump(fwrite(array())); - var_dump(file_get_contents($filename)); @unlink($filename); echo "Done\n"; ?> --EXPECTF-- -Warning: fwrite() expects at least 2 parameters, 1 given in %s on line %d -bool(false) - -Warning: fwrite() expects parameter 2 to be string, array given in %s on line %d -bool(false) +int(0) -Notice: fwrite(): write of 4 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 4 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) int(4) int(0) - -Warning: fwrite() expects parameter 1 to be resource, array given in %s on line %d -bool(false) - -Warning: fwrite() expects parameter 1 to be resource, array given in %s on line %d -bool(false) - -Warning: fwrite() expects at least 2 parameters, 1 given in %s on line %d -bool(false) string(4) "data" Done diff --git a/ext/standard/tests/file/fwrite_basic-win32-mb.phpt b/ext/standard/tests/file/fwrite_basic-win32-mb.phpt index 8dde247c43..5406f78f3c 100644 --- a/ext/standard/tests/file/fwrite_basic-win32-mb.phpt +++ b/ext/standard/tests/file/fwrite_basic-win32-mb.phpt @@ -8,14 +8,6 @@ if( substr(PHP_OS, 0, 3) != 'WIN' ) { ?> --FILE-- <?php -/* - Prototype: int fwrite ( resource $handle,string string, [, int $length] ); - Description: fwrite() writes the contents of string to the file stream pointed to by handle. - If the length arquement is given,writing will stop after length bytes have been - written or the end of string reached, whichever comes first. - fwrite() returns the number of bytes written or FALSE on error -*/ - // include the file.inc for Function: function delete_file($filename) include ("file.inc"); diff --git a/ext/standard/tests/file/fwrite_basic-win32.phpt b/ext/standard/tests/file/fwrite_basic-win32.phpt index de7754ddad..f67d66fb45 100644 --- a/ext/standard/tests/file/fwrite_basic-win32.phpt +++ b/ext/standard/tests/file/fwrite_basic-win32.phpt @@ -8,14 +8,6 @@ if( substr(PHP_OS, 0, 3) != 'WIN' ) { ?> --FILE-- <?php -/* - Prototype: int fwrite ( resource $handle,string string, [, int $length] ); - Description: fwrite() writes the contents of string to the file stream pointed to by handle. - If the length arquement is given,writing will stop after length bytes have been - written or the end of string reached, whichever comes first. - fwrite() returns the number of bytes written or FALSE on error -*/ - // include the file.inc for Function: function delete_file($filename) include ("file.inc"); diff --git a/ext/standard/tests/file/fwrite_basic.phpt b/ext/standard/tests/file/fwrite_basic.phpt index 07af967a58..3b9d1158c9 100644 --- a/ext/standard/tests/file/fwrite_basic.phpt +++ b/ext/standard/tests/file/fwrite_basic.phpt @@ -8,14 +8,6 @@ if( substr(PHP_OS, 0, 3) == 'WIN' ) { ?> --FILE-- <?php -/* - Prototype: int fwrite ( resource $handle,string string, [, int $length] ); - Description: fwrite() writes the contents of string to the file stream pointed to by handle. - If the length arquement is given,writing will stop after length bytes have been - written or the end of string reached, whichever comes first. - fwrite() returns the number of bytes written or FALSE on error -*/ - // include the file.inc for Function: function delete_file($filename) include ("file.inc"); diff --git a/ext/standard/tests/file/fwrite_error.phpt b/ext/standard/tests/file/fwrite_error.phpt index a54550a6c8..d24f7b8084 100644 --- a/ext/standard/tests/file/fwrite_error.phpt +++ b/ext/standard/tests/file/fwrite_error.phpt @@ -2,32 +2,14 @@ Test fwrite() function : error conditions --FILE-- <?php -/* - Prototype: int fwrite ( resource $handle,string string, [, int $length] ); - Description: fwrite() writes the contents of string to the file stream pointed to by handle. - If the length arquement is given,writing will stop after length bytes have been - written or the end of string reached, whichever comes first. - fwrite() returns the number of bytes written or FALSE on error -*/ - // include the file.inc for Function: function delete_file($filename) include ("file.inc"); echo "*** Testing fwrite() : error conditions ***\n"; $filename = __DIR__."/fwrite_error.tmp"; - -echo "-- Testing fwrite() with less than expected number of arguments --\n"; -// zero argument -var_dump( fwrite() ); -// less than expected, 1 arg $file_handle = fopen ( $filename, "w"); -var_dump( fwrite($file_handle) ); - -// more than expected no. of args -echo "-- Testing fwrite() with more than expected number of arguments --\n"; $data = "data"; -var_dump( fwrite($file_handle, $data, strlen($data), 10) ); // invalid length argument echo "-- Testing fwrite() with invalid length arguments --\n"; @@ -36,31 +18,14 @@ var_dump( fwrite($file_handle, $data, $len) ); $len = -10; var_dump( fwrite($file_handle, $data, $len) ); -// test invalid arguments : non-resources -echo "-- Testing fwrite() with invalid arguments --\n"; -$invalid_args = array ( - "string", - 10, - 10.5, - true, - array(1,2,3), - new stdclass, -); -/* loop to test fwrite() with different invalid type of args */ -for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++) { - echo "-- Iteration $loop_counter --\n"; - var_dump( fwrite($invalid_args[$loop_counter - 1], 10) ); -} - // fwrite() on a file handle which is already closed echo "-- Testing fwrite() with closed/unset file handle --\n"; fclose($file_handle); -var_dump(fwrite($file_handle,"data")); - -// fwrite on a file handle which is unset -$fp = fopen($filename, "w"); -unset($fp); //unset file handle -var_dump( fwrite(@$fp,"data")); +try { + var_dump(fwrite($file_handle,"data")); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done\n"; ?> @@ -69,52 +34,11 @@ echo "Done\n"; $filename = __DIR__."/fwrite_error.tmp"; unlink( $filename ); ?> ---EXPECTF-- +--EXPECT-- *** Testing fwrite() : error conditions *** --- Testing fwrite() with less than expected number of arguments -- - -Warning: fwrite() expects at least 2 parameters, 0 given in %s on line %d -bool(false) - -Warning: fwrite() expects at least 2 parameters, 1 given in %s on line %d -bool(false) --- Testing fwrite() with more than expected number of arguments -- - -Warning: fwrite() expects at most 3 parameters, 4 given in %s on line %d -bool(false) -- Testing fwrite() with invalid length arguments -- int(0) int(0) --- Testing fwrite() with invalid arguments -- --- Iteration 1 -- - -Warning: fwrite() expects parameter 1 to be resource, string given in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: fwrite() expects parameter 1 to be resource, int given in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: fwrite() expects parameter 1 to be resource, float given in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: fwrite() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: fwrite() expects parameter 1 to be resource, array given in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: fwrite() expects parameter 1 to be resource, object given in %s on line %d -bool(false) -- Testing fwrite() with closed/unset file handle -- - -Warning: fwrite(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: fwrite() expects parameter 1 to be resource, null given in %s on line %d -bool(false) +fwrite(): supplied resource is not a valid stream resource Done diff --git a/ext/standard/tests/file/fwrite_variation1-win32-mb.phpt b/ext/standard/tests/file/fwrite_variation1-win32-mb.phpt index 706c765f8c..94104a4b0f 100644 --- a/ext/standard/tests/file/fwrite_variation1-win32-mb.phpt +++ b/ext/standard/tests/file/fwrite_variation1-win32-mb.phpt @@ -8,15 +8,6 @@ if( substr(PHP_OS, 0, 3) != 'WIN' ) { ?> --FILE-- <?php -/* - Prototype: int fwrite ( resource $handle,string string, [, int $length] ); - Description: fwrite() writes the contents of string to the file stream pointed to by handle. - If the length arquement is given,writing will stop after length bytes have been - written or the end of string reached, whichever comes first. - fwrite() returns the number of bytes written or FALSE on error -*/ - - echo "*** Testing fwrite() various operations ***\n"; // include the file.inc for Function: function delete_file($filename) @@ -85,13 +76,13 @@ echo "Done\n"; -- Opening file in r -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -101,13 +92,13 @@ string(32) "950b7457d1deb6332f2fc5d42f3129d6" -- Opening file in rb -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -117,13 +108,13 @@ string(32) "950b7457d1deb6332f2fc5d42f3129d6" -- Opening file in rt -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -135,13 +126,13 @@ string(32) "950b7457d1deb6332f2fc5d42f3129d6" -- Opening file in r -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -151,13 +142,13 @@ string(32) "e486000c4c8452774f746a27658d87fa" -- Opening file in rb -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -167,13 +158,13 @@ string(32) "e486000c4c8452774f746a27658d87fa" -- Opening file in rt -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -185,13 +176,13 @@ string(32) "e486000c4c8452774f746a27658d87fa" -- Opening file in r -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -201,13 +192,13 @@ string(32) "b09c8026a64a88d36d4c2f17983964bb" -- Opening file in rb -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -217,13 +208,13 @@ string(32) "b09c8026a64a88d36d4c2f17983964bb" -- Opening file in rt -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -235,13 +226,13 @@ string(32) "b09c8026a64a88d36d4c2f17983964bb" -- Opening file in r -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -251,13 +242,13 @@ string(32) "3fabd48d8eaa65c14e0d93d6880c560c" -- Opening file in rb -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -267,13 +258,13 @@ string(32) "3fabd48d8eaa65c14e0d93d6880c560c" -- Opening file in rt -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) diff --git a/ext/standard/tests/file/fwrite_variation1.phpt b/ext/standard/tests/file/fwrite_variation1.phpt index 20bde9b71a..34a1c89c69 100644 --- a/ext/standard/tests/file/fwrite_variation1.phpt +++ b/ext/standard/tests/file/fwrite_variation1.phpt @@ -2,15 +2,6 @@ Test fwrite() function : usage variations - r, rb & rt modes --FILE-- <?php -/* - Prototype: int fwrite ( resource $handle,string string, [, int $length] ); - Description: fwrite() writes the contents of string to the file stream pointed to by handle. - If the length arquement is given,writing will stop after length bytes have been - written or the end of string reached, whichever comes first. - fwrite() returns the number of bytes written or FALSE on error -*/ - - echo "*** Testing fwrite() various operations ***\n"; // include the file.inc for Function: function delete_file($filename) @@ -77,13 +68,13 @@ echo "Done\n"; -- Opening file in r -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -93,13 +84,13 @@ string(32) "950b7457d1deb6332f2fc5d42f3129d6" -- Opening file in rb -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -109,13 +100,13 @@ string(32) "950b7457d1deb6332f2fc5d42f3129d6" -- Opening file in rt -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -127,13 +118,13 @@ string(32) "950b7457d1deb6332f2fc5d42f3129d6" -- Opening file in r -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -143,13 +134,13 @@ string(32) "e486000c4c8452774f746a27658d87fa" -- Opening file in rb -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -159,13 +150,13 @@ string(32) "e486000c4c8452774f746a27658d87fa" -- Opening file in rt -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -177,13 +168,13 @@ string(32) "e486000c4c8452774f746a27658d87fa" -- Opening file in r -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -193,13 +184,13 @@ string(32) "b09c8026a64a88d36d4c2f17983964bb" -- Opening file in rb -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -209,13 +200,13 @@ string(32) "b09c8026a64a88d36d4c2f17983964bb" -- Opening file in rt -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -227,13 +218,13 @@ string(32) "b09c8026a64a88d36d4c2f17983964bb" -- Opening file in r -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -243,13 +234,13 @@ string(32) "3fabd48d8eaa65c14e0d93d6880c560c" -- Opening file in rb -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) @@ -259,13 +250,13 @@ string(32) "3fabd48d8eaa65c14e0d93d6880c560c" -- Opening file in rt -- int(0) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d bool(false) int(2) bool(false) diff --git a/ext/standard/tests/file/fwrite_variation2-win32.phpt b/ext/standard/tests/file/fwrite_variation2-win32.phpt index aa04e777dc..fa6b76a937 100644 --- a/ext/standard/tests/file/fwrite_variation2-win32.phpt +++ b/ext/standard/tests/file/fwrite_variation2-win32.phpt @@ -8,15 +8,6 @@ if( substr(PHP_OS, 0, 3) != 'WIN' ) { ?> --FILE-- <?php -/* - Prototype: int fwrite ( resource $handle,string string, [, int $length] ); - Description: fwrite() writes the contents of string to the file stream pointed to by handle. - If the length arquement is given,writing will stop after length bytes have been - written or the end of string reached, whichever comes first. - fwrite() returns the number of bytes written or FALSE on error -*/ - - echo "*** Testing fwrite() various operations ***\n"; // include the file.inc for Function: function delete_file($filename) diff --git a/ext/standard/tests/file/fwrite_variation2.phpt b/ext/standard/tests/file/fwrite_variation2.phpt index 639231e0f6..ef153d98b3 100644 --- a/ext/standard/tests/file/fwrite_variation2.phpt +++ b/ext/standard/tests/file/fwrite_variation2.phpt @@ -8,15 +8,6 @@ if( substr(PHP_OS, 0, 3) == 'WIN' ) { ?> --FILE-- <?php -/* - Prototype: int fwrite ( resource $handle,string string, [, int $length] ); - Description: fwrite() writes the contents of string to the file stream pointed to by handle. - If the length arquement is given,writing will stop after length bytes have been - written or the end of string reached, whichever comes first. - fwrite() returns the number of bytes written or FALSE on error -*/ - - echo "*** Testing fwrite() various operations ***\n"; // include the file.inc for Function: function delete_file($filename) diff --git a/ext/standard/tests/file/fwrite_variation3-win32.phpt b/ext/standard/tests/file/fwrite_variation3-win32.phpt index 89fb44088d..5d9681d38e 100644 --- a/ext/standard/tests/file/fwrite_variation3-win32.phpt +++ b/ext/standard/tests/file/fwrite_variation3-win32.phpt @@ -8,15 +8,6 @@ if( substr(PHP_OS, 0, 3) != 'WIN' ) { ?> --FILE-- <?php -/* - Prototype: int fwrite ( resource $handle,string string, [, int $length] ); - Description: fwrite() writes the contents of string to the file stream pointed to by handle. - If the length arquement is given,writing will stop after length bytes have been - written or the end of string reached, whichever comes first. - fwrite() returns the number of bytes written or FALSE on error -*/ - - echo "*** Testing fwrite() various operations ***\n"; // include the file.inc for Function: function delete_file($filename) diff --git a/ext/standard/tests/file/fwrite_variation3.phpt b/ext/standard/tests/file/fwrite_variation3.phpt index 509b21eb03..c0e0bb988e 100644 --- a/ext/standard/tests/file/fwrite_variation3.phpt +++ b/ext/standard/tests/file/fwrite_variation3.phpt @@ -8,15 +8,6 @@ if( substr(PHP_OS, 0, 3) == 'WIN' ) { ?> --FILE-- <?php -/* - Prototype: int fwrite ( resource $handle,string string, [, int $length] ); - Description: fwrite() writes the contents of string to the file stream pointed to by handle. - If the length arquement is given,writing will stop after length bytes have been - written or the end of string reached, whichever comes first. - fwrite() returns the number of bytes written or FALSE on error -*/ - - echo "*** Testing fwrite() various operations ***\n"; // include the file.inc for Function: function delete_file($filename) diff --git a/ext/standard/tests/file/fwrite_variation4-win32.phpt b/ext/standard/tests/file/fwrite_variation4-win32.phpt index 094b11776b..4beef23078 100644 --- a/ext/standard/tests/file/fwrite_variation4-win32.phpt +++ b/ext/standard/tests/file/fwrite_variation4-win32.phpt @@ -8,15 +8,6 @@ if( substr(PHP_OS, 0, 3) != 'WIN' ) { ?> --FILE-- <?php -/* - Prototype: int fwrite ( resource $handle,string string, [, int $length] ); - Description: fwrite() writes the contents of string to the file stream pointed to by handle. - If the length arquement is given,writing will stop after length bytes have been - written or the end of string reached, whichever comes first. - fwrite() returns the number of bytes written or FALSE on error -*/ - - echo "*** Testing fwrite() various operations ***\n"; // include the file.inc for Function: function delete_file($filename) diff --git a/ext/standard/tests/file/fwrite_variation4.phpt b/ext/standard/tests/file/fwrite_variation4.phpt index bbf5602a20..207cc53821 100644 --- a/ext/standard/tests/file/fwrite_variation4.phpt +++ b/ext/standard/tests/file/fwrite_variation4.phpt @@ -8,15 +8,6 @@ if( substr(PHP_OS, 0, 3) == 'WIN' ) { ?> --FILE-- <?php -/* - Prototype: int fwrite ( resource $handle,string string, [, int $length] ); - Description: fwrite() writes the contents of string to the file stream pointed to by handle. - If the length arquement is given,writing will stop after length bytes have been - written or the end of string reached, whichever comes first. - fwrite() returns the number of bytes written or FALSE on error -*/ - - echo "*** Testing fwrite() various operations ***\n"; // include the file.inc for Function: function delete_file($filename) diff --git a/ext/standard/tests/file/get_current_user.phpt b/ext/standard/tests/file/get_current_user.phpt index f23d2fabef..04938e3d6b 100644 --- a/ext/standard/tests/file/get_current_user.phpt +++ b/ext/standard/tests/file/get_current_user.phpt @@ -3,13 +3,10 @@ get_current_user() tests --FILE-- <?php -var_dump(get_current_user("blah")); var_dump(get_current_user()); echo "Done\n"; ?> --EXPECTF-- -Warning: get_current_user() expects exactly 0 parameters, 1 given in %s on line %d -NULL string(%d) %s Done diff --git a/ext/standard/tests/file/glob_basic.phpt b/ext/standard/tests/file/glob_basic.phpt index b130afc95f..85d6929223 100644 --- a/ext/standard/tests/file/glob_basic.phpt +++ b/ext/standard/tests/file/glob_basic.phpt @@ -2,10 +2,6 @@ Test glob() function: basic functions --FILE-- <?php -/* Prototype: array glob ( string $pattern [, int $flags] ); - Description: Find pathnames matching a pattern -*/ - echo "*** Testing glob() : basic functions ***\n"; $file_path = __DIR__; diff --git a/ext/standard/tests/file/glob_error_002-win32.phpt b/ext/standard/tests/file/glob_error_002-win32.phpt index a61efd108c..4597e28e4b 100644 --- a/ext/standard/tests/file/glob_error_002-win32.phpt +++ b/ext/standard/tests/file/glob_error_002-win32.phpt @@ -9,10 +9,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype: array glob ( string $pattern [, int $flags] ); - Description: Find pathnames matching a pattern -*/ - echo "*** Testing glob() : error condition - pattern too long. ***\n"; var_dump(glob(str_repeat('x', 3000))); diff --git a/ext/standard/tests/file/glob_variation-win32-mb.phpt b/ext/standard/tests/file/glob_variation-win32-mb.phpt index fd068b01ad..77e176d6b9 100644 --- a/ext/standard/tests/file/glob_variation-win32-mb.phpt +++ b/ext/standard/tests/file/glob_variation-win32-mb.phpt @@ -8,10 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: array glob ( string $pattern [, int $flags] ); - Description: Find pathnames matching a pattern -*/ - echo "*** Testing glob() : usage variations ***\n"; $file_path = __DIR__; @@ -46,12 +42,16 @@ $counter = 1; using glob() */ foreach($patterns as $pattern) { echo "\n-- Iteration $counter --\n"; - var_dump( glob($pattern) ); // default arguments - var_dump( glob($pattern, GLOB_MARK) ); - var_dump( glob($pattern, GLOB_NOSORT) ); - var_dump( glob($pattern, GLOB_NOCHECK) ); - var_dump( glob($pattern, GLOB_NOESCAPE) ); - var_dump( glob($pattern, GLOB_ERR) ); + try { + var_dump( glob($pattern) ); // default arguments + var_dump( glob($pattern, GLOB_MARK) ); + var_dump( glob($pattern, GLOB_NOSORT) ); + var_dump( glob($pattern, GLOB_NOCHECK) ); + var_dump( glob($pattern, GLOB_NOESCAPE) ); + var_dump( glob($pattern, GLOB_ERR) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter++; } @@ -73,7 +73,11 @@ $counter = 1; using glob() */ foreach($patterns as $pattern) { echo "-- Iteration $counter --\n"; - var_dump( glob($pattern, GLOB_ONLYDIR) ); + try { + var_dump( glob($pattern, GLOB_ONLYDIR) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter++; } @@ -326,24 +330,7 @@ array(0) { } -- Iteration 8 -- - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32-mb.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32-mb.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32-mb.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32-mb.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32-mb.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32-mb.php on line %d -NULL +glob(): Argument #1 ($pattern) must be a valid path, string given -- Iteration 9 -- array(0) { @@ -446,9 +433,7 @@ array(1) { array(0) { } -- Iteration 8 -- - -Warning: glob() expects parameter 1 to be a valid path, string given in %sglob_variation-win32-mb.php on line %d -NULL +glob(): Argument #1 ($pattern) must be a valid path, string given -- Iteration 9 -- array(0) { } diff --git a/ext/standard/tests/file/glob_variation-win32.phpt b/ext/standard/tests/file/glob_variation-win32.phpt index 9a1528bb1f..ad93ad7dac 100644 --- a/ext/standard/tests/file/glob_variation-win32.phpt +++ b/ext/standard/tests/file/glob_variation-win32.phpt @@ -8,10 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: array glob ( string $pattern [, int $flags] ); - Description: Find pathnames matching a pattern -*/ - echo "*** Testing glob() : usage variations ***\n"; $file_path = __DIR__; @@ -45,12 +41,16 @@ $counter = 1; using glob() */ foreach($patterns as $pattern) { echo "\n-- Iteration $counter --\n"; - var_dump( glob($pattern) ); // default arguments - var_dump( glob($pattern, GLOB_MARK) ); - var_dump( glob($pattern, GLOB_NOSORT) ); - var_dump( glob($pattern, GLOB_NOCHECK) ); - var_dump( glob($pattern, GLOB_NOESCAPE) ); - var_dump( glob($pattern, GLOB_ERR) ); + try { + var_dump( glob($pattern) ); // default arguments + var_dump( glob($pattern, GLOB_MARK) ); + var_dump( glob($pattern, GLOB_NOSORT) ); + var_dump( glob($pattern, GLOB_NOCHECK) ); + var_dump( glob($pattern, GLOB_NOESCAPE) ); + var_dump( glob($pattern, GLOB_ERR) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter++; } @@ -72,7 +72,11 @@ $counter = 1; using glob() */ foreach($patterns as $pattern) { echo "-- Iteration $counter --\n"; - var_dump( glob($pattern, GLOB_ONLYDIR) ); + try { + var_dump( glob($pattern, GLOB_ONLYDIR) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter++; } @@ -325,24 +329,7 @@ array(0) { } -- Iteration 8 -- - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32.php on line %d -NULL +glob(): Argument #1 ($pattern) must be a valid path, string given -- Iteration 9 -- array(0) { @@ -445,9 +432,7 @@ array(1) { array(0) { } -- Iteration 8 -- - -Warning: glob() expects parameter 1 to be a valid path, string given in %sglob_variation-win32.php on line %d -NULL +glob(): Argument #1 ($pattern) must be a valid path, string given -- Iteration 9 -- array(0) { } diff --git a/ext/standard/tests/file/glob_variation.phpt b/ext/standard/tests/file/glob_variation.phpt index 056cf62bec..0950c31aab 100644 --- a/ext/standard/tests/file/glob_variation.phpt +++ b/ext/standard/tests/file/glob_variation.phpt @@ -11,10 +11,6 @@ if (!defined('GLOB_BRACE')) { ?> --FILE-- <?php -/* Prototype: array glob ( string $pattern [, int $flags] ); - Description: Find pathnames matching a pattern -*/ - echo "*** Testing glob() : usage variations ***\n"; $file_path = __DIR__; @@ -48,12 +44,16 @@ $counter = 1; using glob() */ foreach($patterns as $pattern) { echo "\n-- Iteration $counter --\n"; - var_dump( glob($pattern) ); // default arguments - var_dump( glob($pattern, GLOB_MARK) ); - var_dump( glob($pattern, GLOB_NOSORT) ); - var_dump( glob($pattern, GLOB_NOCHECK) ); - var_dump( glob($pattern, GLOB_NOESCAPE) ); - var_dump( glob($pattern, GLOB_ERR) ); + try { + var_dump( glob($pattern) ); // default arguments + var_dump( glob($pattern, GLOB_MARK) ); + var_dump( glob($pattern, GLOB_NOSORT) ); + var_dump( glob($pattern, GLOB_NOCHECK) ); + var_dump( glob($pattern, GLOB_NOESCAPE) ); + var_dump( glob($pattern, GLOB_ERR) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter++; } @@ -75,7 +75,11 @@ $counter = 1; using glob() */ foreach($patterns as $pattern) { echo "-- Iteration $counter --\n"; - var_dump( glob($pattern, GLOB_ONLYDIR) ); + try { + var_dump( glob($pattern, GLOB_ONLYDIR) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter++; } @@ -328,24 +332,7 @@ array(0) { } -- Iteration 8 -- - -Warning: glob() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +glob(): Argument #1 ($pattern) must be a valid path, string given -- Iteration 9 -- array(0) { @@ -448,9 +435,7 @@ array(1) { array(0) { } -- Iteration 8 -- - -Warning: glob() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +glob(): Argument #1 ($pattern) must be a valid path, string given -- Iteration 9 -- array(0) { } diff --git a/ext/standard/tests/file/glob_variation2.phpt b/ext/standard/tests/file/glob_variation2.phpt index 297db00dba..883225d779 100644 --- a/ext/standard/tests/file/glob_variation2.phpt +++ b/ext/standard/tests/file/glob_variation2.phpt @@ -2,10 +2,6 @@ Test glob() function with relative path --FILE-- <?php -/* Prototype: array glob ( string $pattern [, int $flags] ); - Description: Find pathnames matching a pattern -*/ - $file_path = __DIR__; // temp dirname used here diff --git a/ext/standard/tests/file/glob_variation3.phpt b/ext/standard/tests/file/glob_variation3.phpt index 5db242825e..4bf008a9a7 100644 --- a/ext/standard/tests/file/glob_variation3.phpt +++ b/ext/standard/tests/file/glob_variation3.phpt @@ -15,7 +15,6 @@ var_dump(glob("$path/directly_not_exists")); var_dump(empty(ini_get('open_basedir'))); ?> -==DONE== --EXPECT-- array(0) { } @@ -30,4 +29,3 @@ array(0) { array(0) { } bool(true) -==DONE== diff --git a/ext/standard/tests/file/glob_variation4.phpt b/ext/standard/tests/file/glob_variation4.phpt index 6544c96944..b96f14fb38 100644 --- a/ext/standard/tests/file/glob_variation4.phpt +++ b/ext/standard/tests/file/glob_variation4.phpt @@ -15,7 +15,6 @@ var_dump(glob("$path/directly_not_exists")); var_dump($path == ini_get('open_basedir')); ?> -==DONE== --EXPECT-- array(0) { } @@ -30,4 +29,3 @@ array(0) { array(0) { } bool(true) -==DONE== diff --git a/ext/standard/tests/file/glob_variation5.phpt b/ext/standard/tests/file/glob_variation5.phpt index 800305aabd..e03bc08d56 100644 --- a/ext/standard/tests/file/glob_variation5.phpt +++ b/ext/standard/tests/file/glob_variation5.phpt @@ -17,7 +17,6 @@ var_dump(glob("$path/directly_not_exists")); var_dump('/tmp' == ini_get('open_basedir')); ?> -==DONE== --EXPECT-- bool(false) bool(false) @@ -26,4 +25,3 @@ bool(false) bool(false) bool(false) bool(true) -==DONE== diff --git a/ext/standard/tests/file/glob_variation6.phpt b/ext/standard/tests/file/glob_variation6.phpt index e0eaeb8c6e..553819326f 100644 --- a/ext/standard/tests/file/glob_variation6.phpt +++ b/ext/standard/tests/file/glob_variation6.phpt @@ -17,7 +17,6 @@ var_dump(glob("$path/directly_not_exists")); var_dump('c:\\windows' == ini_get('open_basedir')); ?> -==DONE== --EXPECT-- array(0) { } @@ -32,4 +31,3 @@ array(0) { array(0) { } bool(true) -==DONE== diff --git a/ext/standard/tests/file/include_streams.phpt b/ext/standard/tests/file/include_streams.phpt index 0b9446ff9e..90629d3ffc 100644 --- a/ext/standard/tests/file/include_streams.phpt +++ b/ext/standard/tests/file/include_streams.phpt @@ -10,99 +10,99 @@ EOD; class mystream { - public $path; - public $mode; - public $options; - - public $position; - public $varname; - - function url_stat($path, $flags) { - return array(); - } - - function stream_stat() { - return array(); - } - - function stream_open($path, $mode, $options, &$opened_path) - { - $this->path = $path; - $this->mode = $mode; - $this->options = $options; - - $split = parse_url($path); - if ($split["host"] !== "GLOBALS" || - empty($split["path"]) || - empty($GLOBALS[substr($split["path"],1)])) { - return false; - } - $this->varname = substr($split["path"],1); - - if (strchr($mode, 'a')) - $this->position = strlen($GLOBALS[$this->varname]); - else - $this->position = 0; - - return true; - } - - function stream_read($count) - { - $ret = substr($GLOBALS[$this->varname], $this->position, $count); - $this->position += strlen($ret); - return $ret; - } - - function stream_tell() - { - return $this->position; - } - - function stream_eof() - { - return $this->position >= strlen($GLOBALS[$this->varname]); - } - - function stream_seek($offset, $whence) - { - switch($whence) { - case SEEK_SET: - if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { - $this->position = $offset; - return true; - } else { - return false; - } - break; - case SEEK_CUR: - if ($offset >= 0) { - $this->position += $offset; - return true; - } else { - return false; - } - break; - case SEEK_END: - if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { - $this->position = strlen($GLOBALS[$this->varname]) + $offset; - return true; - } else { - return false; - } - break; - default: - return false; - } - } - - function stream_set_option($option, $arg1, $arg2) { - return false; - } + public $path; + public $mode; + public $options; + + public $position; + public $varname; + + function url_stat($path, $flags) { + return array(); + } + + function stream_stat() { + return array(); + } + + function stream_open($path, $mode, $options, &$opened_path) + { + $this->path = $path; + $this->mode = $mode; + $this->options = $options; + + $split = parse_url($path); + if ($split["host"] !== "GLOBALS" || + empty($split["path"]) || + empty($GLOBALS[substr($split["path"],1)])) { + return false; + } + $this->varname = substr($split["path"],1); + + if (strchr($mode, 'a')) + $this->position = strlen($GLOBALS[$this->varname]); + else + $this->position = 0; + + return true; + } + + function stream_read($count) + { + $ret = substr($GLOBALS[$this->varname], $this->position, $count); + $this->position += strlen($ret); + return $ret; + } + + function stream_tell() + { + return $this->position; + } + + function stream_eof() + { + return $this->position >= strlen($GLOBALS[$this->varname]); + } + + function stream_seek($offset, $whence) + { + switch($whence) { + case SEEK_SET: + if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { + $this->position = $offset; + return true; + } else { + return false; + } + break; + case SEEK_CUR: + if ($offset >= 0) { + $this->position += $offset; + return true; + } else { + return false; + } + break; + case SEEK_END: + if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { + $this->position = strlen($GLOBALS[$this->varname]) + $offset; + return true; + } else { + return false; + } + break; + default: + return false; + } + } + + function stream_set_option($option, $arg1, $arg2) { + return false; + } } if (!stream_wrapper_register("test", "mystream")) { - die("test wrapper registration failed"); + die("test wrapper registration failed"); } echo file_get_contents("test://GLOBALS/data1"); diff --git a/ext/standard/tests/file/include_userstream_001.phpt b/ext/standard/tests/file/include_userstream_001.phpt index d769a4f3b2..988a8bf085 100644 --- a/ext/standard/tests/file/include_userstream_001.phpt +++ b/ext/standard/tests/file/include_userstream_001.phpt @@ -7,66 +7,66 @@ allow_url_include=0 <?php class test { private $data = '<?php echo "Hello World\n";?>'; - private $pos; + private $pos; - function stream_open($path, $mode, $options, &$opened_path) - { - if (strchr($mode, 'a')) - $this->pos = strlen($this->data); - else - $this->po = 0; + function stream_open($path, $mode, $options, &$opened_path) + { + if (strchr($mode, 'a')) + $this->pos = strlen($this->data); + else + $this->po = 0; - return true; - } + return true; + } - function stream_read($count) - { - $ret = substr($this->data, $this->pos, $count); - $this->pos += strlen($ret); - return $ret; - } + function stream_read($count) + { + $ret = substr($this->data, $this->pos, $count); + $this->pos += strlen($ret); + return $ret; + } - function stream_tell() - { - return $this->pos; - } + function stream_tell() + { + return $this->pos; + } - function stream_eof() - { - return $this->pos >= strlen($this->data); - } + function stream_eof() + { + return $this->pos >= strlen($this->data); + } - function stream_seek($offset, $whence) - { - switch($whence) { - case SEEK_SET: - if ($offset < $this->data && $offset >= 0) { - $this->pos = $offset; - return true; - } else { - return false; - } - break; - case SEEK_CUR: - if ($offset >= 0) { - $this->pos += $offset; - return true; - } else { - return false; - } - break; - case SEEK_END: - if (strlen($this->data) + $offset >= 0) { - $this->pos = strlen($this->data) + $offset; - return true; - } else { - return false; - } - break; - default: - return false; - } - } + function stream_seek($offset, $whence) + { + switch($whence) { + case SEEK_SET: + if ($offset < $this->data && $offset >= 0) { + $this->pos = $offset; + return true; + } else { + return false; + } + break; + case SEEK_CUR: + if ($offset >= 0) { + $this->pos += $offset; + return true; + } else { + return false; + } + break; + case SEEK_END: + if (strlen($this->data) + $offset >= 0) { + $this->pos = strlen($this->data) + $offset; + return true; + } else { + return false; + } + break; + default: + return false; + } + } } diff --git a/ext/standard/tests/file/include_userstream_002.phpt b/ext/standard/tests/file/include_userstream_002.phpt index cc1887c446..15c05314a5 100644 --- a/ext/standard/tests/file/include_userstream_002.phpt +++ b/ext/standard/tests/file/include_userstream_002.phpt @@ -7,83 +7,83 @@ allow_url_include=0 <?php class test { private $data = '<?php echo "Hello World\n";?>'; - private $pos; - private $stream = null; + private $pos; + private $stream = null; - function stream_open($path, $mode, $options, &$opened_path) - { - if (strpos($path, "test2://") === 0) { - $this->stream = fopen("test1://".substr($path, 8), $mode); - return !empty($this->stream); - } - if (strchr($mode, 'a')) - $this->pos = strlen($this->data); - else - $this->po = 0; + function stream_open($path, $mode, $options, &$opened_path) + { + if (strpos($path, "test2://") === 0) { + $this->stream = fopen("test1://".substr($path, 8), $mode); + return !empty($this->stream); + } + if (strchr($mode, 'a')) + $this->pos = strlen($this->data); + else + $this->po = 0; - return true; - } + return true; + } - function stream_read($count) - { - if (!empty($this->stream)) { - return fread($this->stream, $count); - } - $ret = substr($this->data, $this->pos, $count); - $this->pos += strlen($ret); - return $ret; - } + function stream_read($count) + { + if (!empty($this->stream)) { + return fread($this->stream, $count); + } + $ret = substr($this->data, $this->pos, $count); + $this->pos += strlen($ret); + return $ret; + } - function stream_tell() - { - if (!empty($this->stream)) { - return ftell($this->stream); - } - return $this->pos; - } + function stream_tell() + { + if (!empty($this->stream)) { + return ftell($this->stream); + } + return $this->pos; + } - function stream_eof() - { - if (!empty($this->stream)) { - return feof($this->stream); - } - return $this->pos >= strlen($this->data); - } + function stream_eof() + { + if (!empty($this->stream)) { + return feof($this->stream); + } + return $this->pos >= strlen($this->data); + } - function stream_seek($offset, $whence) - { - if (!empty($this->stream)) { - return fseek($this->stream, $offset, $whence); - } - switch($whence) { - case SEEK_SET: - if ($offset < $this->data && $offset >= 0) { - $this->pos = $offset; - return true; - } else { - return false; - } - break; - case SEEK_CUR: - if ($offset >= 0) { - $this->pos += $offset; - return true; - } else { - return false; - } - break; - case SEEK_END: - if (strlen($this->data) + $offset >= 0) { - $this->pos = strlen($this->data) + $offset; - return true; - } else { - return false; - } - break; - default: - return false; - } - } + function stream_seek($offset, $whence) + { + if (!empty($this->stream)) { + return fseek($this->stream, $offset, $whence); + } + switch($whence) { + case SEEK_SET: + if ($offset < $this->data && $offset >= 0) { + $this->pos = $offset; + return true; + } else { + return false; + } + break; + case SEEK_CUR: + if ($offset >= 0) { + $this->pos += $offset; + return true; + } else { + return false; + } + break; + case SEEK_END: + if (strlen($this->data) + $offset >= 0) { + $this->pos = strlen($this->data) + $offset; + return true; + } else { + return false; + } + break; + default: + return false; + } + } } @@ -99,8 +99,8 @@ include "test2://hello"; Warning: fopen(): test1:// wrapper is disabled in the server configuration by allow_url_include=0 in %sinclude_userstream_002.php on line 10 -Warning: fopen(test1://hello): failed to open stream: no suitable wrapper could be found in %sinclude_userstream_002.php on line 10 +Warning: fopen(test1://hello): Failed to open stream: no suitable wrapper could be found in %sinclude_userstream_002.php on line 10 -Warning: include(test2://hello): failed to open stream: "test::stream_open" call failed in %sinclude_userstream_002.php on line 89 +Warning: include(test2://hello): Failed to open stream: "test::stream_open" call failed in %sinclude_userstream_002.php on line 89 Warning: include(): Failed opening 'test2://hello' for inclusion (include_path='%s') in %sinclude_userstream_002.php on line 89 diff --git a/ext/standard/tests/file/include_userstream_003.phpt b/ext/standard/tests/file/include_userstream_003.phpt index 71f8920d53..ae6ec62649 100644 --- a/ext/standard/tests/file/include_userstream_003.phpt +++ b/ext/standard/tests/file/include_userstream_003.phpt @@ -7,83 +7,83 @@ allow_url_include=1 <?php class test { private $data = '<?php echo "Hello World\n";?>'; - private $pos; - private $stream = null; - - function stream_open($path, $mode, $options, &$opened_path) - { - if (strpos($path, "test2://") === 0) { - $this->stream = fopen("test1://".substr($path, 8), $mode); - return !empty($this->stream); - } - if (strchr($mode, 'a')) - $this->pos = strlen($this->data); - else - $this->po = 0; - - return true; - } - - function stream_read($count) - { - if (!empty($this->stream)) { - return fread($this->stream, $count); - } - $ret = substr($this->data, $this->pos, $count); - $this->pos += strlen($ret); - return $ret; - } - - function stream_tell() - { - if (!empty($this->stream)) { - return ftell($this->stream); - } - return $this->pos; - } - - function stream_eof() - { - if (!empty($this->stream)) { - return feof($this->stream); - } - return $this->pos >= strlen($this->data); - } - - function stream_seek($offset, $whence) - { - if (!empty($this->stream)) { - return fseek($this->stream, $offset, $whence); - } - switch($whence) { - case SEEK_SET: - if ($offset < $this->data && $offset >= 0) { - $this->pos = $offset; - return true; - } else { - return false; - } - break; - case SEEK_CUR: - if ($offset >= 0) { - $this->pos += $offset; - return true; - } else { - return false; - } - break; - case SEEK_END: - if (strlen($this->data) + $offset >= 0) { - $this->pos = strlen($this->data) + $offset; - return true; - } else { - return false; - } - break; - default: - return false; - } - } + private $pos; + private $stream = null; + + function stream_open($path, $mode, $options, &$opened_path) + { + if (strpos($path, "test2://") === 0) { + $this->stream = fopen("test1://".substr($path, 8), $mode); + return !empty($this->stream); + } + if (strchr($mode, 'a')) + $this->pos = strlen($this->data); + else + $this->po = 0; + + return true; + } + + function stream_read($count) + { + if (!empty($this->stream)) { + return fread($this->stream, $count); + } + $ret = substr($this->data, $this->pos, $count); + $this->pos += strlen($ret); + return $ret; + } + + function stream_tell() + { + if (!empty($this->stream)) { + return ftell($this->stream); + } + return $this->pos; + } + + function stream_eof() + { + if (!empty($this->stream)) { + return feof($this->stream); + } + return $this->pos >= strlen($this->data); + } + + function stream_seek($offset, $whence) + { + if (!empty($this->stream)) { + return fseek($this->stream, $offset, $whence); + } + switch($whence) { + case SEEK_SET: + if ($offset < $this->data && $offset >= 0) { + $this->pos = $offset; + return true; + } else { + return false; + } + break; + case SEEK_CUR: + if ($offset >= 0) { + $this->pos += $offset; + return true; + } else { + return false; + } + break; + case SEEK_END: + if (strlen($this->data) + $offset >= 0) { + $this->pos = strlen($this->data) + $offset; + return true; + } else { + return false; + } + break; + default: + return false; + } + } } @@ -98,26 +98,26 @@ Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0 Warning: file_get_contents(): test1:// wrapper is disabled in the server configuration by allow_url_fopen=0 in %sinclude_userstream_003.php on line 86 -Warning: file_get_contents(test1://hello): failed to open stream: no suitable wrapper could be found in %sinclude_userstream_003.php on line 86 +Warning: file_get_contents(test1://hello): Failed to open stream: no suitable wrapper could be found in %sinclude_userstream_003.php on line 86 Warning: include(): test1:// wrapper is disabled in the server configuration by allow_url_fopen=0 in %sinclude_userstream_003.php on line 87 -Warning: include(test1://hello): failed to open stream: no suitable wrapper could be found in %sinclude_userstream_003.php on line 87 +Warning: include(test1://hello): Failed to open stream: no suitable wrapper could be found in %sinclude_userstream_003.php on line 87 Warning: include(): Failed opening 'test1://hello' for inclusion (include_path='%s') in %sinclude_userstream_003.php on line 87 Warning: fopen(): test1:// wrapper is disabled in the server configuration by allow_url_fopen=0 in %sinclude_userstream_003.php on line 10 -Warning: fopen(test1://hello): failed to open stream: no suitable wrapper could be found in %sinclude_userstream_003.php on line 10 +Warning: fopen(test1://hello): Failed to open stream: no suitable wrapper could be found in %sinclude_userstream_003.php on line 10 -Warning: file_get_contents(test2://hello): failed to open stream: "test::stream_open" call failed in %sinclude_userstream_003.php on line 88 +Warning: file_get_contents(test2://hello): Failed to open stream: "test::stream_open" call failed in %sinclude_userstream_003.php on line 88 Warning: fopen(): test1:// wrapper is disabled in the server configuration by allow_url_fopen=0 in %sinclude_userstream_003.php on line 10 -Warning: fopen(test1://hello): failed to open stream: no suitable wrapper could be found in %sinclude_userstream_003.php on line 10 +Warning: fopen(test1://hello): Failed to open stream: no suitable wrapper could be found in %sinclude_userstream_003.php on line 10 -Warning: include(test2://hello): failed to open stream: "test::stream_open" call failed in %sinclude_userstream_003.php on line 89 +Warning: include(test2://hello): Failed to open stream: "test::stream_open" call failed in %sinclude_userstream_003.php on line 89 Warning: include(): Failed opening 'test2://hello' for inclusion (include_path='%s') in %sinclude_userstream_003.php on line 89 diff --git a/ext/standard/tests/file/is_dir_basic.phpt b/ext/standard/tests/file/is_dir_basic.phpt index ceaa34df9b..a78b990cd9 100644 --- a/ext/standard/tests/file/is_dir_basic.phpt +++ b/ext/standard/tests/file/is_dir_basic.phpt @@ -2,11 +2,6 @@ Test is_dir() function: basic functionality --FILE-- <?php -/* Prototype: bool is_dir ( string $filename ); - Description: Tells whether the filename is a regular file - Returns TRUE if the filename exists and is a regular file -*/ - echo "*** Testing is_dir(): basic functionality ***\n"; $file_path = __DIR__; var_dump( is_dir($file_path) ); diff --git a/ext/standard/tests/file/is_dir_variation1.phpt b/ext/standard/tests/file/is_dir_variation1.phpt index 90084f32e9..8fb179f510 100644 --- a/ext/standard/tests/file/is_dir_variation1.phpt +++ b/ext/standard/tests/file/is_dir_variation1.phpt @@ -2,11 +2,6 @@ Test is_dir() function: usage variations - dir/subdir --FILE-- <?php -/* Prototype: bool is_dir ( string $dirname ); - Description: Tells whether the dirname is a directory - Returns TRUE if the dirname exists and is a directory, FALSE otherwise. -*/ - /* Testing is_dir() with base and sub dirs */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/is_dir_variation2.phpt b/ext/standard/tests/file/is_dir_variation2.phpt index 2a2f14d753..67a44d30eb 100644 --- a/ext/standard/tests/file/is_dir_variation2.phpt +++ b/ext/standard/tests/file/is_dir_variation2.phpt @@ -7,11 +7,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { } --FILE-- <?php -/* Prototype: bool is_dir ( string $dirname ); - Description: Tells whether the dirname is a directory - Returns TRUE if the dirname exists and is a directory, FALSE otherwise. -*/ - /* Testing is_dir() with dir, soft & hard link to dir, and with file, soft & hard link to file */ diff --git a/ext/standard/tests/file/is_dir_variation3.phpt b/ext/standard/tests/file/is_dir_variation3.phpt index 3f9d196e64..ef875c34f8 100644 --- a/ext/standard/tests/file/is_dir_variation3.phpt +++ b/ext/standard/tests/file/is_dir_variation3.phpt @@ -4,15 +4,8 @@ Test is_dir() function: usage variations - invalid arguments obscure_filename --FILE-- <?php -/* Prototype: bool is_dir ( string $dirname ); - Description: Tells whether the dirname is a directory - Returns TRUE if the dirname exists and is a directory, FALSE otherwise. -*/ - /* Passing invalid arguments to is_dir() */ -$dir_handle = opendir( __DIR__ ); - echo "*** Testing is_dir() with Invalid arguments: expected bool(false) ***\n"; $dirnames = array( /* Invalid dirnames */ @@ -21,7 +14,6 @@ $dirnames = array( FALSE, NULL, " ", - $dir_handle, /* scalars */ 0, @@ -32,17 +24,13 @@ $dirnames = array( foreach($dirnames as $dirname) { var_dump( is_dir($dirname) ); } -closedir($dir_handle); ?> ---EXPECTF-- +--EXPECT-- *** Testing is_dir() with Invalid arguments: expected bool(false) *** bool(false) bool(false) bool(false) bool(false) bool(false) - -Warning: is_dir() expects parameter 1 to be a valid path, resource given in %s on line %d -NULL bool(false) bool(false) diff --git a/ext/standard/tests/file/is_dir_variation4.phpt b/ext/standard/tests/file/is_dir_variation4.phpt index 543533f8ed..1c219d51c2 100644 --- a/ext/standard/tests/file/is_dir_variation4.phpt +++ b/ext/standard/tests/file/is_dir_variation4.phpt @@ -2,11 +2,6 @@ Test is_dir() function: usage variations - diff. path notations --FILE-- <?php -/* Prototype: bool is_dir ( string $dirname ); - Description: Tells whether the dirname is a directory - Returns TRUE if the dirname exists and is a directory, FALSE otherwise. -*/ - /* Passing dir names with different notations, using slashes, wild-card chars */ $file_path = __DIR__; @@ -38,7 +33,11 @@ $count = 1; /* loop through to test each element the above array */ foreach($dirs_arr as $dir) { echo "\n-- Iteration $count --\n"; - var_dump( is_dir($file_path."/".$dir ) ); + try { + var_dump( is_dir($file_path."/".$dir ) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $count++; } @@ -50,7 +49,7 @@ $file_path = __DIR__; $dir_name = $file_path."/is_dir_variation4"; rmdir($dir_name); ?> ---EXPECTF-- +--EXPECT-- *** Testing is_dir() with different notations of dir names *** -- Iteration 1 -- bool(true) @@ -77,13 +76,9 @@ bool(true) bool(false) -- Iteration 9 -- - -Warning: is_dir() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_dir(): Argument #1 ($filename) must be a valid path, string given -- Iteration 10 -- - -Warning: is_dir() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_dir(): Argument #1 ($filename) must be a valid path, string given *** Done *** diff --git a/ext/standard/tests/file/is_executable_basic-win32-mb.phpt b/ext/standard/tests/file/is_executable_basic-win32-mb.phpt index 69f5f2dc7d..e42ff3d918 100644 --- a/ext/standard/tests/file/is_executable_basic-win32-mb.phpt +++ b/ext/standard/tests/file/is_executable_basic-win32-mb.phpt @@ -8,9 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: bool is_executable ( string $filename ); - Description: Tells whether the filename is executable -*/ require __DIR__.'/file.inc'; echo "*** Testing is_executable(): basic functionality ***\n"; diff --git a/ext/standard/tests/file/is_executable_basic-win32.phpt b/ext/standard/tests/file/is_executable_basic-win32.phpt index 80059d8218..09d11b78ac 100644 --- a/ext/standard/tests/file/is_executable_basic-win32.phpt +++ b/ext/standard/tests/file/is_executable_basic-win32.phpt @@ -8,9 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: bool is_executable ( string $filename ); - Description: Tells whether the filename is executable -*/ require __DIR__.'/file.inc'; echo "*** Testing is_executable(): basic functionality ***\n"; diff --git a/ext/standard/tests/file/is_executable_basic.phpt b/ext/standard/tests/file/is_executable_basic.phpt index 6c78d2be03..5bdd985e35 100644 --- a/ext/standard/tests/file/is_executable_basic.phpt +++ b/ext/standard/tests/file/is_executable_basic.phpt @@ -9,10 +9,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype: bool is_executable ( string $filename ); - Description: Tells whether the filename is executable -*/ - // include common file test functions require __DIR__.'/file.inc'; diff --git a/ext/standard/tests/file/is_executable_error.phpt b/ext/standard/tests/file/is_executable_error.phpt index 99c218b514..c8d296d93e 100644 --- a/ext/standard/tests/file/is_executable_error.phpt +++ b/ext/standard/tests/file/is_executable_error.phpt @@ -2,28 +2,11 @@ Test is_executable() function: error conditions --FILE-- <?php -/* Prototype: bool is_executable ( string $filename ); - Description: Tells whether the filename is executable -*/ - -echo "*** Testing is_executable(): error conditions ***\n"; -var_dump( is_executable() ); // args < expected no of arguments - -var_dump( is_executable(1, 2) ); // args > expected no. of arguments - echo "\n*** Testing is_exceutable() on non-existent directory ***\n"; var_dump( is_executable(__DIR__."/is_executable") ); echo "Done\n"; ---EXPECTF-- -*** Testing is_executable(): error conditions *** - -Warning: is_executable() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: is_executable() expects exactly 1 parameter, 2 given in %s on line %d -NULL - +--EXPECT-- *** Testing is_exceutable() on non-existent directory *** bool(false) Done diff --git a/ext/standard/tests/file/is_executable_variation1.phpt b/ext/standard/tests/file/is_executable_variation1.phpt index 1e8d8f5faf..f88133e591 100644 --- a/ext/standard/tests/file/is_executable_variation1.phpt +++ b/ext/standard/tests/file/is_executable_variation1.phpt @@ -8,10 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype: bool is_executable ( string $filename ); - Description: Tells whether the filename is executable -*/ - /* test is_executable() with file having different filepath notation */ require __DIR__.'/file.inc'; @@ -51,7 +47,11 @@ $counter = 1; is an executable file */ foreach($files_arr as $file) { echo "-- Iteration $counter --\n"; - var_dump( is_executable($file) ); + try { + var_dump( is_executable($file) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter++; clearstatcache(); } @@ -63,7 +63,7 @@ echo "Done\n"; unlink(__DIR__."/is_executable_variation1/bar.tmp"); rmdir(__DIR__."/is_executable_variation1/"); ?> ---EXPECTF-- +--EXPECT-- *** Testing is_executable(): usage variations *** -- Iteration 1 -- bool(false) @@ -76,13 +76,9 @@ bool(false) -- Iteration 5 -- bool(false) -- Iteration 6 -- - -Warning: is_executable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_executable(): Argument #1 ($filename) must be a valid path, string given -- Iteration 7 -- - -Warning: is_executable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_executable(): Argument #1 ($filename) must be a valid path, string given -- Iteration 8 -- bool(false) -- Iteration 9 -- diff --git a/ext/standard/tests/file/is_executable_variation2.phpt b/ext/standard/tests/file/is_executable_variation2.phpt index 5b07f683d3..b723482cc1 100644 --- a/ext/standard/tests/file/is_executable_variation2.phpt +++ b/ext/standard/tests/file/is_executable_variation2.phpt @@ -9,10 +9,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype: bool is_executable ( string $filename ); - Description: Tells whether the filename is executable -*/ - /* test is_executable() with file/dir having different permissions */ require __DIR__.'/file.inc'; @@ -26,7 +22,7 @@ chmod("$file_path/is_executable_variation2", 0444); var_dump( is_executable("$file_path/is_executable_variation2") ); // exp: bool(false) chmod("$file_path/is_executable_variation2", 0777); // chmod to enable deletion of directory -echo "\n*** Testing miscelleneous input for is_executable() function ***\n"; +echo "\n*** Testing miscellaneous input for is_executable() function ***\n"; $name_prefix = "is_executable_variation2"; create_files(__DIR__, 1, "numeric", 0755, 1, "w", $name_prefix, 1); create_files(__DIR__, 1, "text", 0755, 1, "w", $name_prefix, 2); @@ -77,7 +73,7 @@ rmdir(__DIR__."/is_executable_variation2/"); *** Testing is_executable() on directory without execute permission *** bool(false) -*** Testing miscelleneous input for is_executable() function *** +*** Testing miscellaneous input for is_executable() function *** -- Iteration 1 -- bool(true) -- Iteration 2 -- diff --git a/ext/standard/tests/file/is_executable_variation3.phpt b/ext/standard/tests/file/is_executable_variation3.phpt index 1a71a5a005..42e37f5731 100644 --- a/ext/standard/tests/file/is_executable_variation3.phpt +++ b/ext/standard/tests/file/is_executable_variation3.phpt @@ -9,10 +9,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype: bool is_executable ( string $filename ); - Description: Tells whether the filename is executable -*/ - /* test is_executable() with invalid arguments */ echo "*** Testing is_executable(): usage variations ***\n"; @@ -29,7 +25,6 @@ $invalid_files = array( FALSE, NULL, " ", - @array(), @$file_handle ); /* loop through to test each element in the above array @@ -41,7 +36,7 @@ foreach( $invalid_files as $invalid_file ) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing is_executable(): usage variations *** *** Testing is_executable() on invalid files *** @@ -52,8 +47,5 @@ bool(false) bool(false) bool(false) bool(false) - -Warning: is_executable() expects parameter 1 to be a valid path, array given in %s on line %d -NULL bool(false) Done diff --git a/ext/standard/tests/file/is_file_basic.phpt b/ext/standard/tests/file/is_file_basic.phpt index d5d46b5fda..8ca9158931 100644 --- a/ext/standard/tests/file/is_file_basic.phpt +++ b/ext/standard/tests/file/is_file_basic.phpt @@ -2,11 +2,6 @@ Test is_file() function: basic functionality --FILE-- <?php -/* Prototype: bool is_file ( string $filename ); - Description: Tells whether the filename is a regular file - Returns TRUE if the filename exists and is a regular file -*/ - echo "*** Testing is_file(): basic functionality ***\n"; /* Checking with current file */ diff --git a/ext/standard/tests/file/is_file_variation1.phpt b/ext/standard/tests/file/is_file_variation1.phpt index c8a26ea7c7..0cc7e4b643 100644 --- a/ext/standard/tests/file/is_file_variation1.phpt +++ b/ext/standard/tests/file/is_file_variation1.phpt @@ -2,11 +2,6 @@ Test is_file() function: usage variations - diff. files --FILE-- <?php -/* Prototype: bool is_file ( string $filename ); - Description: Tells whether the filename is a regular file - Returns TRUE if the filename exists and is a regular file -*/ - /* Testing is_file() with file containing data, truncating its size and the file created by touch() */ @@ -15,7 +10,7 @@ $file_path = __DIR__; echo "-- Testing is_file() with file containing data --\n"; $filename = $file_path."/is_file_variation1.tmp"; $file_handle = fopen($filename, "w" ); -fwrite( $file_handle, "Hello, world....." ); // exptected true +fwrite( $file_handle, "Hello, world....." ); // expected true fclose($file_handle); var_dump( is_file($filename) ); clearstatcache(); diff --git a/ext/standard/tests/file/is_file_variation2.phpt b/ext/standard/tests/file/is_file_variation2.phpt index 7803410ac2..4db395a6aa 100644 --- a/ext/standard/tests/file/is_file_variation2.phpt +++ b/ext/standard/tests/file/is_file_variation2.phpt @@ -7,11 +7,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { } --FILE-- <?php -/* Prototype: bool is_file ( string $filename ); - Description: Tells whether the filename is a regular file - Returns TRUE if the filename exists and is a regular file -*/ - /* Creating soft and hard links to a file and applying is_file() on links */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/is_file_variation3.phpt b/ext/standard/tests/file/is_file_variation3.phpt index d18bef52f1..9e8b74594b 100644 --- a/ext/standard/tests/file/is_file_variation3.phpt +++ b/ext/standard/tests/file/is_file_variation3.phpt @@ -4,12 +4,7 @@ Test is_file() function: usage variations - invalid filenames obscure_filename --FILE-- <?php -/* Prototype: bool is_file ( string $filename ); - Description: Tells whether the filename is a regular file - Returns TRUE if the filename exists and is a regular file -*/ - -/* Testing is_file() with invalid arguments -int, float, bool, NULL, resource */ +/* Testing is_file() with invalid arguments -int, float, bool, NULL */ function flatten($variable) { \ob_start(); @@ -31,10 +26,7 @@ foreach([ /* scalars */ 1234, - 0, - - /* resource */ - fopen(__FILE__, "r") + 0 ] as $filename ) { printf( "%s: %d\n", @@ -42,7 +34,7 @@ foreach([ clearstatcache(); } ?> ---EXPECTF-- +--EXPECT-- float(-2.34555): 0 string(1) " ": 0 string(0) "": 0 @@ -51,4 +43,3 @@ bool(false): 0 NULL: 0 int(1234): 0 int(0): 0 -resource(%d) of type (stream): 0 diff --git a/ext/standard/tests/file/is_file_variation4.phpt b/ext/standard/tests/file/is_file_variation4.phpt index 39a640e7eb..85bc4252c1 100644 --- a/ext/standard/tests/file/is_file_variation4.phpt +++ b/ext/standard/tests/file/is_file_variation4.phpt @@ -2,11 +2,6 @@ Test is_file() function: usage variations - diff. path notations (Bug #42027) --FILE-- <?php -/* Prototype: bool is_file ( string $filename ); - Description: Tells whether the filename is a regular file - Returns TRUE if the filename exists and is a regular file -*/ - /* Passing file names with different notations, using slashes, wild-card chars */ $file_path = __DIR__; @@ -38,7 +33,11 @@ $count = 1; /* loop through to test each element in the above array */ foreach($files_arr as $file) { echo "- Iteration $count -\n"; - var_dump( is_file( $file_path."/".$file ) ); + try { + var_dump( is_file( $file_path."/".$file ) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } clearstatcache(); $count++; } @@ -52,7 +51,7 @@ $dir_name = $file_path."/is_file_variation4"; unlink($dir_name."/is_file_variation4.tmp"); rmdir($dir_name); ?> ---EXPECTF-- +--EXPECT-- *** Testing is_file() with different notations of file names *** - Iteration 1 - bool(true) @@ -67,12 +66,8 @@ bool(false) - Iteration 6 - bool(false) - Iteration 7 - - -Warning: is_file() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_file(): Argument #1 ($filename) must be a valid path, string given - Iteration 8 - - -Warning: is_file() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_file(): Argument #1 ($filename) must be a valid path, string given *** Done *** diff --git a/ext/standard/tests/file/is_readable_basic-win32-mb.phpt b/ext/standard/tests/file/is_readable_basic-win32-mb.phpt index 150510b884..26faa0226d 100644 --- a/ext/standard/tests/file/is_readable_basic-win32-mb.phpt +++ b/ext/standard/tests/file/is_readable_basic-win32-mb.phpt @@ -8,10 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: bool is_readable ( string $filename ); - Description: Tells whether the filename is readable -*/ - // include common file test functions require __DIR__.'/file.inc'; diff --git a/ext/standard/tests/file/is_readable_basic-win32.phpt b/ext/standard/tests/file/is_readable_basic-win32.phpt index 1432141c91..2685ed48ca 100644 --- a/ext/standard/tests/file/is_readable_basic-win32.phpt +++ b/ext/standard/tests/file/is_readable_basic-win32.phpt @@ -8,10 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: bool is_readable ( string $filename ); - Description: Tells whether the filename is readable -*/ - // include common file test functions require __DIR__.'/file.inc'; diff --git a/ext/standard/tests/file/is_readable_basic.phpt b/ext/standard/tests/file/is_readable_basic.phpt index a3f72a3048..7f1b85501a 100644 --- a/ext/standard/tests/file/is_readable_basic.phpt +++ b/ext/standard/tests/file/is_readable_basic.phpt @@ -9,10 +9,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype: bool is_readable ( string $filename ); - Description: Tells whether the filename is readable -*/ - // include common file test functions require __DIR__.'/file.inc'; diff --git a/ext/standard/tests/file/is_readable_error.phpt b/ext/standard/tests/file/is_readable_error.phpt index ad6c2b8c62..8df7ff92d5 100644 --- a/ext/standard/tests/file/is_readable_error.phpt +++ b/ext/standard/tests/file/is_readable_error.phpt @@ -2,28 +2,12 @@ Test is_readable() function: error conditions --FILE-- <?php -/* Prototype: bool is_readable ( string $filename ); - Description: Tells whether the filename is readable -*/ - -echo "*** Testing is_readable(): error conditions ***\n"; -var_dump( is_readable() ); // args < expected -var_dump( is_readable(1, 2) ); // args > expected - echo "\n*** Testing is_readable() on non-existent file ***\n"; var_dump( is_readable(__DIR__."/is_readable.tmp") ); echo "Done\n"; ?> ---EXPECTF-- -*** Testing is_readable(): error conditions *** - -Warning: is_readable() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: is_readable() expects exactly 1 parameter, 2 given in %s on line %d -NULL - +--EXPECT-- *** Testing is_readable() on non-existent file *** bool(false) Done diff --git a/ext/standard/tests/file/is_readable_variation1.phpt b/ext/standard/tests/file/is_readable_variation1.phpt index 60729b5ac2..e4347b04a8 100644 --- a/ext/standard/tests/file/is_readable_variation1.phpt +++ b/ext/standard/tests/file/is_readable_variation1.phpt @@ -6,10 +6,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype: bool is_readable ( string $filename ); - Description: Tells whether the filename is readable. -*/ - /* test is_readable() with file having different filepath notation */ require __DIR__.'/file.inc'; @@ -50,7 +46,11 @@ $counter = 1; is a writable file */ foreach($files_arr as $file) { echo "-- Iteration $counter --\n"; - var_dump( is_readable($file) ); + try { + var_dump( is_readable($file) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter++; clearstatcache(); } @@ -77,17 +77,11 @@ bool(false) -- Iteration 6 -- bool(false) -- Iteration 7 -- - -Warning: is_readable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_readable(): Argument #1 ($filename) must be a valid path, string given -- Iteration 8 -- - -Warning: is_readable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_readable(): Argument #1 ($filename) must be a valid path, string given -- Iteration 9 -- - -Warning: is_readable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_readable(): Argument #1 ($filename) must be a valid path, string given -- Iteration 10 -- bool(true) -- Iteration 11 -- diff --git a/ext/standard/tests/file/is_readable_variation2.phpt b/ext/standard/tests/file/is_readable_variation2.phpt index 1dd4ffd06a..1102d0067f 100644 --- a/ext/standard/tests/file/is_readable_variation2.phpt +++ b/ext/standard/tests/file/is_readable_variation2.phpt @@ -9,10 +9,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype: bool is_readable ( string $filename ); - Description: Tells whether the filename is readable. -*/ - /* test is_executable() with file/dir having different permissions */ require __DIR__.'/file.inc'; @@ -26,7 +22,7 @@ chmod("$file_path/is_readable_variation2", 0001); var_dump( is_readable("$file_path/is_readable_variation2") ); // exp: bool(false) chmod("$file_path/is_readable_variation2", 0777); // chmod to enable deletion of directory -echo "\n*** Testing miscelleneous input for is_readable() function ***\n"; +echo "\n*** Testing miscellaneous input for is_readable() function ***\n"; $name_prefix = "is_readable_variation2"; create_files(__DIR__, 1, "numeric", 0755, 1, "w", $name_prefix, 1); create_files(__DIR__, 1, "text", 0755, 1, "w", $name_prefix, 2); @@ -77,7 +73,7 @@ rmdir(__DIR__."/is_readable_variation2/"); *** Testing is_readable() on directory without read permission *** bool(false) -*** Testing miscelleneous input for is_readable() function *** +*** Testing miscellaneous input for is_readable() function *** -- Iteration 1 -- bool(true) -- Iteration 2 -- diff --git a/ext/standard/tests/file/is_readable_variation3.phpt b/ext/standard/tests/file/is_readable_variation3.phpt index c73a28520f..320e6d49b9 100644 --- a/ext/standard/tests/file/is_readable_variation3.phpt +++ b/ext/standard/tests/file/is_readable_variation3.phpt @@ -6,10 +6,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype: bool is_readable ( string $filename ); - Description: Tells whether the filename is readable. -*/ - /* test is_executable() with invalid arguments */ echo "*** Testing is_readable(): usage variations ***\n"; @@ -17,7 +13,7 @@ echo "*** Testing is_readable(): usage variations ***\n"; $file_handle = fopen(__FILE__, "r"); unset($file_handle); -echo "\n*** Testing is_readable() on miscelleneous filenames ***\n"; +echo "\n*** Testing is_readable() on miscellaneous filenames ***\n"; $misc_files = array( 0, 1234, @@ -26,7 +22,6 @@ $misc_files = array( FALSE, NULL, " ", - @array(), @$file_handle ); /* loop through to test each element in the above array @@ -38,10 +33,10 @@ foreach( $misc_files as $misc_file ) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing is_readable(): usage variations *** -*** Testing is_readable() on miscelleneous filenames *** +*** Testing is_readable() on miscellaneous filenames *** bool(false) bool(false) bool(false) @@ -49,8 +44,5 @@ bool(false) bool(false) bool(false) bool(false) - -Warning: is_readable() expects parameter 1 to be a valid path, array given in %s on line %d -NULL bool(false) Done diff --git a/ext/standard/tests/file/is_uploaded_file_basic.phpt b/ext/standard/tests/file/is_uploaded_file_basic.phpt index 1721935549..3e5bf6320c 100644 --- a/ext/standard/tests/file/is_uploaded_file_basic.phpt +++ b/ext/standard/tests/file/is_uploaded_file_basic.phpt @@ -29,19 +29,9 @@ var_dump(is_uploaded_file('random_filename.txt')); // not an uploaded file var_dump(is_uploaded_file('__FILE__')); -// Error cases -var_dump(is_uploaded_file()); -var_dump(is_uploaded_file('a', 'b')); - ?> ---EXPECTF-- +--EXPECT-- bool(true) bool(false) bool(false) bool(false) - -Warning: is_uploaded_file() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: is_uploaded_file() expects exactly 1 parameter, 2 given in %s on line %d -NULL diff --git a/ext/standard/tests/file/is_writable_basic.phpt b/ext/standard/tests/file/is_writable_basic.phpt index ba6676836d..e486db3727 100644 --- a/ext/standard/tests/file/is_writable_basic.phpt +++ b/ext/standard/tests/file/is_writable_basic.phpt @@ -6,12 +6,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype: bool is_writable ( string $filename ); - Description: Tells whether the filename is writable. - - is_writeable() is an alias of is_writable() -*/ - // include common file test functions require __DIR__.'/file.inc'; diff --git a/ext/standard/tests/file/is_writable_error.phpt b/ext/standard/tests/file/is_writable_error.phpt index a9633f2284..3020124d4e 100644 --- a/ext/standard/tests/file/is_writable_error.phpt +++ b/ext/standard/tests/file/is_writable_error.phpt @@ -2,43 +2,13 @@ Test is_writable() and its alias is_writeable() function: error conditions --FILE-- <?php -/* Prototype: bool is_writable ( string $filename ); - Description: Tells whether the filename is writable. - - is_writeable() is an alias of is_writable() -*/ - -echo "*** Testing is_writable(): error conditions ***\n"; -var_dump( is_writable() ); // args < expected -var_dump( is_writeable() ); - -echo "\n*** Testing is_writeable(): error conditions ***\n"; -var_dump( is_writable(1, 2) ); // args > expected -var_dump( is_writeable(1, 2) ); - echo "\n*** Testing is_writable() on non-existent file ***\n"; var_dump( is_writable(__DIR__."/is_writable") ); var_dump( is_writeable(__DIR__."/is_writable") ); echo "Done\n"; ?> ---EXPECTF-- -*** Testing is_writable(): error conditions *** - -Warning: is_writable() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: is_writeable() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -*** Testing is_writeable(): error conditions *** - -Warning: is_writable() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: is_writeable() expects exactly 1 parameter, 2 given in %s on line %d -NULL - +--EXPECT-- *** Testing is_writable() on non-existent file *** bool(false) bool(false) diff --git a/ext/standard/tests/file/is_writable_variation1.phpt b/ext/standard/tests/file/is_writable_variation1.phpt index 6ce05f172e..f781f871ff 100644 --- a/ext/standard/tests/file/is_writable_variation1.phpt +++ b/ext/standard/tests/file/is_writable_variation1.phpt @@ -6,11 +6,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype: bool is_writable ( string $filename ); - Description: Tells whether the filename is writable. - - is_writeable() is an alias of is_writable() -*/ /* test is_writable() & is_writeable() with file having different filepath notation */ require __DIR__.'/file.inc'; echo "*** Testing is_writable(): usage variations ***\n"; @@ -50,8 +45,16 @@ $counter = 1; is a writable file */ foreach($files_arr as $file) { echo "-- Iteration $counter --\n"; - var_dump( is_writable($file) ); - var_dump( is_writeable($file) ); + try { + var_dump( is_writable($file) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + try { + var_dump( is_writeable($file) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter++; clearstatcache(); } @@ -84,26 +87,14 @@ bool(false) bool(false) bool(false) -- Iteration 7 -- - -Warning: is_writable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: is_writeable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_writable(): Argument #1 ($filename) must be a valid path, string given +is_writeable(): Argument #1 ($filename) must be a valid path, string given -- Iteration 8 -- - -Warning: is_writable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: is_writeable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_writable(): Argument #1 ($filename) must be a valid path, string given +is_writeable(): Argument #1 ($filename) must be a valid path, string given -- Iteration 9 -- - -Warning: is_writable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: is_writeable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_writable(): Argument #1 ($filename) must be a valid path, string given +is_writeable(): Argument #1 ($filename) must be a valid path, string given -- Iteration 10 -- bool(true) bool(true) diff --git a/ext/standard/tests/file/is_writable_variation2.phpt b/ext/standard/tests/file/is_writable_variation2.phpt index def45bd2a0..ea8437d630 100644 --- a/ext/standard/tests/file/is_writable_variation2.phpt +++ b/ext/standard/tests/file/is_writable_variation2.phpt @@ -9,12 +9,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype: bool is_writable ( string $filename ); - Description: Tells whether the filename is writable. - - is_writeable() is an alias of is_writable() -*/ - /* test is_executable() with file/dir having different permissions */ require __DIR__.'/file.inc'; @@ -29,7 +23,7 @@ var_dump( is_writable("$file_path/is_writable_variation2") ); // exp: bool(fals var_dump( is_writeable("$file_path/is_writable_variation2") ); // exp: bool(false) chmod("$file_path/is_writable_variation2", 0777); // chmod to enable deletion of directory -echo "\n*** Testing miscelleneous input for is_writable() function ***\n"; +echo "\n*** Testing miscellaneous input for is_writable() function ***\n"; $name_prefix = "is_writable_variation2"; create_files(__DIR__, 1, "numeric", 0755, 1, "w", $name_prefix, 1); create_files(__DIR__, 1, "text", 0755, 1, "w", $name_prefix, 2); @@ -83,7 +77,7 @@ rmdir(__DIR__."/is_writable_variation2/"); bool(false) bool(false) -*** Testing miscelleneous input for is_writable() function *** +*** Testing miscellaneous input for is_writable() function *** -- Iteration 1 -- bool(true) bool(true) diff --git a/ext/standard/tests/file/is_writable_variation3.phpt b/ext/standard/tests/file/is_writable_variation3.phpt index e49270bcf4..286b64c4d3 100644 --- a/ext/standard/tests/file/is_writable_variation3.phpt +++ b/ext/standard/tests/file/is_writable_variation3.phpt @@ -8,12 +8,6 @@ require __DIR__ . '/../skipif_root.inc'; obscure_filename --FILE-- <?php -/* Prototype: bool is_writable ( string $filename ); - Description: Tells whether the filename is writable. - - is_writeable() is an alias of is_writable() -*/ - /* test is_writable() & is_writeable() with invalid arguments */ echo "*** Testing is_writable(): usage variations ***\n"; @@ -27,7 +21,6 @@ $misc_files = array( FALSE, NULL, " ", - @array(), @$file_handle ); /* loop through to test each element in the above array @@ -38,7 +31,7 @@ foreach( $misc_files as $misc_file ) { clearstatcache(); } ?> ---EXPECTF-- +--EXPECT-- *** Testing is_writable(): usage variations *** *** Testing is_writable() with invalid filenames *** @@ -56,11 +49,5 @@ bool(false) bool(false) bool(false) bool(false) - -Warning: is_writable() expects parameter 1 to be a valid path, array given in %s on line %d -NULL - -Warning: is_writeable() expects parameter 1 to be a valid path, array given in %s on line %d -NULL bool(false) bool(false) diff --git a/ext/standard/tests/file/lchgrp_basic.phpt b/ext/standard/tests/file/lchgrp_basic.phpt index fa97ce86ef..283d805a94 100644 --- a/ext/standard/tests/file/lchgrp_basic.phpt +++ b/ext/standard/tests/file/lchgrp_basic.phpt @@ -18,7 +18,6 @@ var_dump( lchgrp( $filename, $gid ) ); var_dump( filegroup( $symlink ) === $gid ); ?> -===DONE=== --CLEAN-- <?php @@ -33,4 +32,3 @@ bool(true) bool(true) bool(true) bool(true) -===DONE=== diff --git a/ext/standard/tests/file/lchown_basic.phpt b/ext/standard/tests/file/lchown_basic.phpt index e38bbda1be..189ccb6fe8 100644 --- a/ext/standard/tests/file/lchown_basic.phpt +++ b/ext/standard/tests/file/lchown_basic.phpt @@ -7,12 +7,6 @@ if (!function_exists("posix_getuid")) die("skip no posix_getuid()"); ?> --FILE-- <?php -/* Prototype : bool lchown (string filename, mixed user) - * Description: Change file owner of a symlink - * Source code: ext/standard/filestat.c - * Alias to functions: - */ - echo "*** Testing lchown() : basic functionality ***\n"; $filename = __DIR__ . DIRECTORY_SEPARATOR . 'lchown_basic.txt'; $symlink = __DIR__ . DIRECTORY_SEPARATOR . 'lchown_basic_symlink.txt'; @@ -25,7 +19,6 @@ var_dump( lchown( $filename, $uid ) ); var_dump( fileowner( $symlink ) === $uid ); ?> -===DONE=== --CLEAN-- <?php @@ -41,4 +34,3 @@ bool(true) bool(true) bool(true) bool(true) -===DONE=== diff --git a/ext/standard/tests/file/lchown_error.phpt b/ext/standard/tests/file/lchown_error.phpt index dbd9a7bbe8..2ad0a37d35 100644 --- a/ext/standard/tests/file/lchown_error.phpt +++ b/ext/standard/tests/file/lchown_error.phpt @@ -8,12 +8,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype : bool lchown (string filename, mixed user) - * Description: Change file owner of a symlink - * Source code: ext/standard/filestat.c - * Alias to functions: - */ - echo "*** Testing lchown() : error functionality ***\n"; // Set up @@ -21,25 +15,13 @@ $filename = __DIR__ . DIRECTORY_SEPARATOR . 'lchown.txt'; touch( $filename ); $uid = posix_getuid(); - -// Less than expected arguments -var_dump( lchown( $filename ) ); - -// More than expected arguments -var_dump( lchown( $filename, $uid, 'foobar' ) ); - // Non-existent filename var_dump( lchown( 'foobar_lchown.txt', $uid ) ); -// Wrong argument types -var_dump( lchown( new StdClass(), $uid ) ); -var_dump( lchown( array(), $uid ) ); - // Bad user var_dump( lchown( $filename, -5 ) ); ?> -===DONE=== --CLEAN-- <?php @@ -50,21 +32,8 @@ unlink($filename); --EXPECTF-- *** Testing lchown() : error functionality *** -Warning: lchown() expects exactly 2 parameters, 1 given in %s on line %d -bool(true) - -Warning: lchown() expects exactly 2 parameters, 3 given in %s on line %d -bool(true) - Warning: lchown(): No such file or directory in %s on line %d bool(false) -Warning: lchown() expects parameter 1 to be a valid path, object given in %s on line %d -bool(true) - -Warning: lchown() expects parameter 1 to be a valid path, array given in %s on line %d -bool(true) - Warning: lchown(): %r(Operation not permitted|Invalid argument)%r in %s on line %d bool(false) -===DONE=== diff --git a/ext/standard/tests/file/lstat_stat_basic.phpt b/ext/standard/tests/file/lstat_stat_basic.phpt index 8a488f644b..3d5e56b412 100644 --- a/ext/standard/tests/file/lstat_stat_basic.phpt +++ b/ext/standard/tests/file/lstat_stat_basic.phpt @@ -9,13 +9,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - $file_path = __DIR__; require("$file_path/file.inc"); diff --git a/ext/standard/tests/file/lstat_stat_error.phpt b/ext/standard/tests/file/lstat_stat_error.phpt index fe0c8a978b..d2e4518f73 100644 --- a/ext/standard/tests/file/lstat_stat_error.phpt +++ b/ext/standard/tests/file/lstat_stat_error.phpt @@ -2,63 +2,30 @@ Test lstat() and stat() functions: error conditions --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - echo "*** Testing lstat() for error conditions ***\n"; $file_path = __DIR__; -var_dump( lstat() ); // args < expected -var_dump( lstat(__FILE__, 2) ); // args > expected var_dump( lstat("$file_path/temp.tmp") ); // non existing file var_dump( lstat(22) ); // scalar argument -$arr = array(__FILE__); -var_dump( lstat($arr) ); // array argument echo "\n*** Testing stat() for error conditions ***\n"; -var_dump( stat() ); // args < expected -var_dump( stat(__FILE__, 2) ); // file, args > expected -var_dump( stat(__DIR__, 2) ); //dir, args > expected var_dump( stat("$file_path/temp.tmp") ); // non existing file var_dump( stat("$file_path/temp/") ); // non existing dir var_dump( stat(22) ); // scalar argument -var_dump( stat($arr) ); // array argument echo "Done\n"; ?> --EXPECTF-- *** Testing lstat() for error conditions *** -Warning: lstat() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: lstat() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: lstat(): Lstat failed for %s in %s on line %d bool(false) Warning: lstat(): Lstat failed for 22 in %s on line %d bool(false) -Warning: lstat() expects parameter 1 to be a valid path, array given in %s on line %d -NULL - *** Testing stat() for error conditions *** -Warning: stat() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: stat() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: stat() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: stat(): stat failed for %s in %s on line %d bool(false) @@ -67,7 +34,4 @@ bool(false) Warning: stat(): stat failed for 22 in %s on line %d bool(false) - -Warning: stat() expects parameter 1 to be a valid path, array given in %s on line %d -NULL Done diff --git a/ext/standard/tests/file/lstat_stat_variation1.phpt b/ext/standard/tests/file/lstat_stat_variation1.phpt index c6054f8f94..9776cdea4d 100644 --- a/ext/standard/tests/file/lstat_stat_variation1.phpt +++ b/ext/standard/tests/file/lstat_stat_variation1.phpt @@ -2,13 +2,6 @@ Test lstat() and stat() functions: usage variations - effects of rename() on file --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - /* test the effects of rename() on stats of file */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/lstat_stat_variation10.phpt b/ext/standard/tests/file/lstat_stat_variation10.phpt index ca4a170e12..d4d142405d 100644 --- a/ext/standard/tests/file/lstat_stat_variation10.phpt +++ b/ext/standard/tests/file/lstat_stat_variation10.phpt @@ -6,13 +6,6 @@ if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); ?> --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - /* test the effects of is_dir() on stats of a dir */ $file_path = __DIR__; @@ -28,7 +21,7 @@ echo "*** Testing stat() on directory after using is_dir() on it ***\n"; $old_stat = stat($dirname); // clear the cache clearstatcache(); -sleep(2); +sleep(1); var_dump( is_dir($dirname) ); $new_stat = stat($dirname); diff --git a/ext/standard/tests/file/lstat_stat_variation11.phpt b/ext/standard/tests/file/lstat_stat_variation11.phpt index 8fbfd99ef7..91510209a6 100644 --- a/ext/standard/tests/file/lstat_stat_variation11.phpt +++ b/ext/standard/tests/file/lstat_stat_variation11.phpt @@ -6,13 +6,6 @@ if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); ?> --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - $file_path = __DIR__; require "$file_path/file.inc"; @@ -28,7 +21,7 @@ echo "*** Testing stat() on a file after using is_file() on it ***\n"; $old_stat = stat($filename); // clear the stat clearstatcache(); -sleep(2); +sleep(1); var_dump( is_file($filename) ); $new_stat = stat($filename); // compare self stats diff --git a/ext/standard/tests/file/lstat_stat_variation12.phpt b/ext/standard/tests/file/lstat_stat_variation12.phpt index 08e870a6de..71ebd5c51c 100644 --- a/ext/standard/tests/file/lstat_stat_variation12.phpt +++ b/ext/standard/tests/file/lstat_stat_variation12.phpt @@ -10,13 +10,6 @@ if (PHP_OS_FAMILY === 'Windows') { ?> --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - /* test the effects of is_link() on stats of link */ $file_path = __DIR__; @@ -37,7 +30,7 @@ $linkname = "$file_path/lstat_stat_variation12_link.tmp"; $old_stat = lstat($linkname); // clear the stat clearstatcache(); -sleep(2); +sleep(1); var_dump( is_link($linkname) ); $new_stat = lstat($linkname); // compare self stats diff --git a/ext/standard/tests/file/lstat_stat_variation13.phpt b/ext/standard/tests/file/lstat_stat_variation13.phpt index 2ff25c2f9c..45f7a17c57 100644 --- a/ext/standard/tests/file/lstat_stat_variation13.phpt +++ b/ext/standard/tests/file/lstat_stat_variation13.phpt @@ -6,13 +6,6 @@ if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); ?> --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - /* use stat on file created using "w" and "r" mode of fopen */ $file_path = __DIR__; @@ -27,7 +20,7 @@ fclose($file_handle); $old_stat = stat($filename); // clear the stat clearstatcache(); -sleep(2); +sleep(1); // opening file again in read mode $file_handle = fopen($filename, "r"); // read file fclose($file_handle); diff --git a/ext/standard/tests/file/lstat_stat_variation14.phpt b/ext/standard/tests/file/lstat_stat_variation14.phpt index 67d64b79a1..9da7e65875 100644 --- a/ext/standard/tests/file/lstat_stat_variation14.phpt +++ b/ext/standard/tests/file/lstat_stat_variation14.phpt @@ -2,13 +2,6 @@ Test lstat() and stat() functions: usage variations - hardlink --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - /* test the effects of is_link() on stats of hard link */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/lstat_stat_variation15.phpt b/ext/standard/tests/file/lstat_stat_variation15.phpt index 106b9fd8ad..2d1157d401 100644 --- a/ext/standard/tests/file/lstat_stat_variation15.phpt +++ b/ext/standard/tests/file/lstat_stat_variation15.phpt @@ -10,13 +10,6 @@ if (PHP_OS_FAMILY === 'Windows') { ?> --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - /* test the effects on stats by changing permissions of link */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/lstat_stat_variation16.phpt b/ext/standard/tests/file/lstat_stat_variation16.phpt index 652f5c29c7..2a21bdf411 100644 --- a/ext/standard/tests/file/lstat_stat_variation16.phpt +++ b/ext/standard/tests/file/lstat_stat_variation16.phpt @@ -9,13 +9,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - /* test the effects on stats with changing permissions of file */ $file_path = __DIR__; @@ -28,7 +21,7 @@ fclose($fp); // checking stat() on file after changing its permission echo "*** Testing lstat() on a file after changing its access permission ***\n"; $old_stat = stat($filename); -sleep(2); +sleep(1); var_dump( chmod($filename, 0777) ); // clear the stat clearstatcache(); diff --git a/ext/standard/tests/file/lstat_stat_variation17.phpt b/ext/standard/tests/file/lstat_stat_variation17.phpt index 208cc0b388..62eb842134 100644 --- a/ext/standard/tests/file/lstat_stat_variation17.phpt +++ b/ext/standard/tests/file/lstat_stat_variation17.phpt @@ -9,13 +9,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - /* test the effects on stats by changing permissions of a dir */ $file_path = __DIR__; @@ -27,7 +20,7 @@ $dirname = "$file_path/lstat_stat_variation17"; mkdir($dirname); $old_stat = stat($dirname); -sleep(2); +sleep(1); var_dump( chmod($dirname, 0777) ); // clear the stat clearstatcache(); diff --git a/ext/standard/tests/file/lstat_stat_variation18.phpt b/ext/standard/tests/file/lstat_stat_variation18.phpt index a1c5cf0ca7..d68fdb6c7b 100644 --- a/ext/standard/tests/file/lstat_stat_variation18.phpt +++ b/ext/standard/tests/file/lstat_stat_variation18.phpt @@ -2,13 +2,6 @@ Test lstat() and stat() functions: usage variations - dir/file name stored in object --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - /* test for stats of dir/file when their names are stored in objects */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/lstat_stat_variation19.phpt b/ext/standard/tests/file/lstat_stat_variation19.phpt index b19b38024a..d73fbcebf8 100644 --- a/ext/standard/tests/file/lstat_stat_variation19.phpt +++ b/ext/standard/tests/file/lstat_stat_variation19.phpt @@ -2,13 +2,6 @@ Test lstat() and stat() functions: usage variations - dir/file names in array --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - /* test for stats of dir/file when their names are stored in an array */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/lstat_stat_variation2.phpt b/ext/standard/tests/file/lstat_stat_variation2.phpt index 8bf7dc1959..efc03096a7 100644 --- a/ext/standard/tests/file/lstat_stat_variation2.phpt +++ b/ext/standard/tests/file/lstat_stat_variation2.phpt @@ -2,13 +2,6 @@ Test lstat() and stat() functions: usage variations - effects of rename() on dir --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - /* test the effects of rename() on stats of dir */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/lstat_stat_variation20.phpt b/ext/standard/tests/file/lstat_stat_variation20.phpt index 565a63bfa7..f9feba40f0 100644 --- a/ext/standard/tests/file/lstat_stat_variation20.phpt +++ b/ext/standard/tests/file/lstat_stat_variation20.phpt @@ -9,13 +9,6 @@ if (PHP_OS_FAMILY === 'Windows') { ?> --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - /* test for stats of link when their names are stored in object and array */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/lstat_stat_variation21.phpt b/ext/standard/tests/file/lstat_stat_variation21.phpt index 23ed53e566..cd3a8865c5 100644 --- a/ext/standard/tests/file/lstat_stat_variation21.phpt +++ b/ext/standard/tests/file/lstat_stat_variation21.phpt @@ -9,13 +9,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - /* test the effects of truncate() on stats of a file */ $file_path = __DIR__; @@ -33,7 +26,7 @@ echo "*** Testing stat() on file by truncating it to given size ***\n"; $old_stat = stat($filename); // clear the cache clearstatcache(); -sleep(2); +sleep(1); // opening file in r/w mode $file_handle = fopen($filename, "r+"); var_dump( ftruncate($file_handle, 512) ); // truncate it diff --git a/ext/standard/tests/file/lstat_stat_variation22.phpt b/ext/standard/tests/file/lstat_stat_variation22.phpt index 9d8f3d3f01..b89c5c5298 100644 --- a/ext/standard/tests/file/lstat_stat_variation22.phpt +++ b/ext/standard/tests/file/lstat_stat_variation22.phpt @@ -12,12 +12,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { obscure_filename --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ echo "*** testing stat ***\n"; var_dump(stat(NULL)); var_dump(stat(false)); diff --git a/ext/standard/tests/file/lstat_stat_variation3.phpt b/ext/standard/tests/file/lstat_stat_variation3.phpt index 7f11619f7e..231510dd07 100644 --- a/ext/standard/tests/file/lstat_stat_variation3.phpt +++ b/ext/standard/tests/file/lstat_stat_variation3.phpt @@ -9,13 +9,6 @@ if (PHP_OS_FAMILY === 'Windows') { ?> --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - /* test the effects of rename() on stats of link */ $file_path = __DIR__; @@ -47,7 +40,6 @@ $keys_to_compare = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, "rdev", "size", "atime", "mtime", "blksize", "blocks"); var_dump( compare_stats($old_stat, $new_stat, $keys_to_compare) ); ?> -===Done=== --CLEAN-- <?php $file_path = __DIR__; @@ -60,4 +52,3 @@ bool(true) bool(true) bool(true) bool(true) -===Done=== diff --git a/ext/standard/tests/file/lstat_stat_variation4.phpt b/ext/standard/tests/file/lstat_stat_variation4.phpt index 2d41fba19d..27ea0bf248 100644 --- a/ext/standard/tests/file/lstat_stat_variation4.phpt +++ b/ext/standard/tests/file/lstat_stat_variation4.phpt @@ -6,13 +6,6 @@ if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); ?> --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - /* test the effects of touch() on stats of file */ $file_path = __DIR__; @@ -30,7 +23,7 @@ echo "*** Testing stat() for file after using touch() on the file ***\n"; $old_stat = stat($file_name); // clear the cache clearstatcache(); -sleep(2); +sleep(1); var_dump( touch($file_name) ); $new_stat = stat($file_name); diff --git a/ext/standard/tests/file/lstat_stat_variation5.phpt b/ext/standard/tests/file/lstat_stat_variation5.phpt index b5c03c3f08..ae19d3d1b7 100644 --- a/ext/standard/tests/file/lstat_stat_variation5.phpt +++ b/ext/standard/tests/file/lstat_stat_variation5.phpt @@ -9,13 +9,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - /* test the effects of touch() on stats of dir */ $file_path = __DIR__; @@ -33,7 +26,7 @@ echo "*** Testing stat() for directory after using touch() on the directory ***\ $old_stat = stat($dir_name); // clear the cache clearstatcache(); -sleep(2); +sleep(1); var_dump( touch($dir_name) ); $new_stat = stat($dir_name); diff --git a/ext/standard/tests/file/lstat_stat_variation6.phpt b/ext/standard/tests/file/lstat_stat_variation6.phpt index 986dd8d3b4..729da4624f 100644 --- a/ext/standard/tests/file/lstat_stat_variation6.phpt +++ b/ext/standard/tests/file/lstat_stat_variation6.phpt @@ -18,13 +18,6 @@ if (PHP_OS_FAMILY === 'Windows') { ?> --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - /* test the effects of touch() on stats of link */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/lstat_stat_variation7.phpt b/ext/standard/tests/file/lstat_stat_variation7.phpt index f3aaec2275..fab011dd20 100644 --- a/ext/standard/tests/file/lstat_stat_variation7.phpt +++ b/ext/standard/tests/file/lstat_stat_variation7.phpt @@ -2,13 +2,6 @@ Test lstat() and stat() functions: usage variations - writing data into file --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - $file_path = __DIR__; require "$file_path/file.inc"; diff --git a/ext/standard/tests/file/lstat_stat_variation8.phpt b/ext/standard/tests/file/lstat_stat_variation8.phpt index 5dc45e02f5..4be3a4b15d 100644 --- a/ext/standard/tests/file/lstat_stat_variation8.phpt +++ b/ext/standard/tests/file/lstat_stat_variation8.phpt @@ -9,13 +9,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype: array lstat ( string $filename ); - Description: Gives information about a file or symbolic link - - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - $file_path = __DIR__; require "$file_path/file.inc"; @@ -30,7 +23,7 @@ echo "*** Testing stat() on dir after subdir and file is created in it ***\n"; $dirname = "$file_path/lstat_stat_variation8"; $old_stat = stat($dirname); clearstatcache(); -sleep(2); +sleep(1); mkdir("$dirname/lstat_stat_variation8_subdir"); $file_handle = fopen("$dirname/lstat_stat_variation8a.tmp", "w"); fclose($file_handle); diff --git a/ext/standard/tests/file/mkdir_rmdir_error.phpt b/ext/standard/tests/file/mkdir_rmdir_error.phpt index 17f908c3f6..4500de0276 100644 --- a/ext/standard/tests/file/mkdir_rmdir_error.phpt +++ b/ext/standard/tests/file/mkdir_rmdir_error.phpt @@ -2,22 +2,6 @@ Test mkdir() and rmdir() functions : error conditions --FILE-- <?php -/* Prototype: bool mkdir ( string $pathname [, int $mode [, bool $recursive [, resource $context]]] ); - Description: Makes directory - - Prototype: bool rmdir ( string $dirname [, resource $context] ); - Description: Removes directory -*/ - -echo "*** Testing mkdir(): error conditions ***\n"; -var_dump( mkdir() ); // args < expected -var_dump( mkdir(1, 2, 3, 4, 5) ); // args > expected -var_dump( mkdir("testdir", 0777, false, $context, "test") ); // args > expected - -echo "\n*** Testing rmdir(): error conditions ***\n"; -var_dump( rmdir() ); // args < expected -var_dump( rmdir(1, 2, 3) ); // args > expected -var_dump( rmdir("testdir", $context, "test") ); // args > expected echo "\n*** Testing rmdir() on non-existent directory ***\n"; var_dump( rmdir("temp") ); @@ -25,32 +9,6 @@ var_dump( rmdir("temp") ); echo "Done\n"; ?> --EXPECTF-- -*** Testing mkdir(): error conditions *** - -Warning: mkdir() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: mkdir() expects at most 4 parameters, 5 given in %s on line %d -bool(false) - -Notice: Undefined variable: context in %s on line %d - -Warning: mkdir() expects at most 4 parameters, 5 given in %s on line %d -bool(false) - -*** Testing rmdir(): error conditions *** - -Warning: rmdir() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: rmdir() expects at most 2 parameters, 3 given in %s on line %d -bool(false) - -Notice: Undefined variable: context in %s on line %d - -Warning: rmdir() expects at most 2 parameters, 3 given in %s on line %d -bool(false) - *** Testing rmdir() on non-existent directory *** Warning: rmdir(temp): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/mkdir_rmdir_variation-win32-mb.phpt b/ext/standard/tests/file/mkdir_rmdir_variation-win32-mb.phpt index 20535a0536..b6c186ed0b 100644 --- a/ext/standard/tests/file/mkdir_rmdir_variation-win32-mb.phpt +++ b/ext/standard/tests/file/mkdir_rmdir_variation-win32-mb.phpt @@ -8,9 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: bool mkdir ( string $pathname [, int $mode [, bool $recursive [, resource $context]]] ); - Description: Makes directory -*/ echo "*** Testing mkdir() and rmdir() for different permissions ***\n"; @@ -38,7 +35,7 @@ echo "\n*** Testing mkdir() and rmdir() for binary safe functionality ***\n"; var_dump( mkdir("$file_path/tempx000/") ); var_dump( rmdir("$file_path/tempx000/") ); -echo "\n*** Testing mkdir() with miscelleneous input ***\n"; +echo "\n*** Testing mkdir() with miscellaneous input ***\n"; /* changing mode of mkdir to prevent creating sub-directory under it */ var_dump( chmod("$file_path/mkdirç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™/", 0000) ); /* creating sub-directory test1 under mkdir, expected: false */ @@ -1606,7 +1603,7 @@ bool(false) bool(true) bool(true) -*** Testing mkdir() with miscelleneous input *** +*** Testing mkdir() with miscellaneous input *** bool(true) bool(true) bool(true) diff --git a/ext/standard/tests/file/mkdir_rmdir_variation-win32.phpt b/ext/standard/tests/file/mkdir_rmdir_variation-win32.phpt index 3391472f99..f4f412e802 100644 --- a/ext/standard/tests/file/mkdir_rmdir_variation-win32.phpt +++ b/ext/standard/tests/file/mkdir_rmdir_variation-win32.phpt @@ -8,9 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: bool mkdir ( string $pathname [, int $mode [, bool $recursive [, resource $context]]] ); - Description: Makes directory -*/ echo "*** Testing mkdir() and rmdir() for different permissions ***\n"; @@ -38,7 +35,7 @@ echo "\n*** Testing mkdir() and rmdir() for binary safe functionality ***\n"; var_dump( mkdir("$file_path/tempx000/") ); var_dump( rmdir("$file_path/tempx000/") ); -echo "\n*** Testing mkdir() with miscelleneous input ***\n"; +echo "\n*** Testing mkdir() with miscellaneous input ***\n"; /* changing mode of mkdir to prevent creating sub-directory under it */ var_dump( chmod("$file_path/mkdir/", 0000) ); /* creating sub-directory test1 under mkdir, expected: false */ @@ -1606,7 +1603,7 @@ bool(false) bool(true) bool(true) -*** Testing mkdir() with miscelleneous input *** +*** Testing mkdir() with miscellaneous input *** bool(true) bool(true) bool(true) diff --git a/ext/standard/tests/file/mkdir_rmdir_variation1.phpt b/ext/standard/tests/file/mkdir_rmdir_variation1.phpt index 6fe177250c..129fcd7785 100644 --- a/ext/standard/tests/file/mkdir_rmdir_variation1.phpt +++ b/ext/standard/tests/file/mkdir_rmdir_variation1.phpt @@ -9,9 +9,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype: bool mkdir ( string $pathname [, int $mode [, bool $recursive [, resource $context]]] ); - Description: Makes directory -*/ echo "*** Testing mkdir() and rmdir() for different permissions ***\n"; diff --git a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt index 22c055ddb5..667a00187e 100644 --- a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt +++ b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt @@ -9,9 +9,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype: bool mkdir ( string $pathname [, int $mode [, bool $recursive [, resource $context]]] ); - Description: Makes directory -*/ $context = stream_context_create(); @@ -26,10 +23,18 @@ var_dump( mkdir("$file_path/mkdir_variation2/test/", 0777, true) ); var_dump( rmdir("$file_path/mkdir_variation2/") ); echo "\n*** Testing mkdir() and rmdir() for binary safe functionality ***\n"; -var_dump( mkdir("$file_path/temp".chr(0)."/") ); -var_dump( rmdir("$file_path/temp".chr(0)."/") ); +try { + var_dump( mkdir("$file_path/temp".chr(0)."/") ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump( rmdir("$file_path/temp".chr(0)."/") ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} -echo "\n*** Testing mkdir() with miscelleneous input ***\n"; +echo "\n*** Testing mkdir() with miscellaneous input ***\n"; /* changing mode of mkdir to prevent creating sub-directory under it */ var_dump( chmod("$file_path/mkdir_variation2/", 0000) ); /* creating sub-directory test1 under mkdir, expected: false */ @@ -55,14 +60,10 @@ Warning: rmdir(%s/mkdir_variation2/): %s on line %d bool(false) *** Testing mkdir() and rmdir() for binary safe functionality *** +mkdir(): Argument #1 ($pathname) must be a valid path, string given +rmdir(): Argument #1 ($dirname) must be a valid path, string given -Warning: mkdir() expects parameter 1 to be a valid path, string given in %s on line %d -bool(false) - -Warning: rmdir() expects parameter 1 to be a valid path, string given in %s on line %d -bool(false) - -*** Testing mkdir() with miscelleneous input *** +*** Testing mkdir() with miscellaneous input *** bool(true) Warning: mkdir(): Permission denied in %s on line %d diff --git a/ext/standard/tests/file/mkdir_variation5-win32.phpt b/ext/standard/tests/file/mkdir_variation5-win32.phpt index b805dee3be..b6af2bf986 100644 --- a/ext/standard/tests/file/mkdir_variation5-win32.phpt +++ b/ext/standard/tests/file/mkdir_variation5-win32.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype : bool mkdir(string pathname [, int mode [, bool recursive [, resource context]]]) - * Description: Create a directory - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing mkdir() : variation ***\n"; $workDir = "mkdirVar5.tmp"; @@ -68,7 +62,6 @@ foreach($dirs as $dir) { rmdir($workDir); ?> -===DONE=== --EXPECTF-- *** Testing mkdir() : variation *** -- creating mkdirVar5.tmp\aSubDir -- @@ -102,4 +95,3 @@ Directory created Directory created -- creating /%s/mkdirVar5.tmp/aSubDir -- Directory created -===DONE=== diff --git a/ext/standard/tests/file/mkdir_variation5.phpt b/ext/standard/tests/file/mkdir_variation5.phpt index ea60edf42f..0d753a46a2 100644 --- a/ext/standard/tests/file/mkdir_variation5.phpt +++ b/ext/standard/tests/file/mkdir_variation5.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype : bool mkdir(string pathname [, int mode [, bool recursive [, resource context]]]) - * Description: Create a directory - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing mkdir() : variation ***\n"; $workDir = "mkdirVar5.tmp"; @@ -63,7 +57,6 @@ foreach($dirs as $dir) { rmdir($workDir); ?> -===DONE=== --EXPECTF-- *** Testing mkdir() : variation *** -- creating mkdirVar5.tmp/aSubDir -- @@ -95,4 +88,3 @@ Directory created Directory created -- creating %s//mkdirVar5.tmp//aSubDir -- Directory created -===DONE=== diff --git a/ext/standard/tests/file/move_uploaded_file_basic.phpt b/ext/standard/tests/file/move_uploaded_file_basic.phpt index c6cfdd3203..b80c052691 100644 --- a/ext/standard/tests/file/move_uploaded_file_basic.phpt +++ b/ext/standard/tests/file/move_uploaded_file_basic.phpt @@ -49,13 +49,8 @@ fclose($fd); var_dump(move_uploaded_file($_FILES['file2']['tmp_name'], $destination4)); unlink($destination4); -echo "Wrong parameters\n"; -var_dump(move_uploaded_file()); -var_dump(move_uploaded_file(1, 2, 3)); - - ?> ---EXPECTF-- +--EXPECT-- Valid move bool(true) bool(true) @@ -66,10 +61,3 @@ Non-uploaded source file bool(false) Valid move to existing file bool(true) -Wrong parameters - -Warning: move_uploaded_file() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: move_uploaded_file() expects exactly 2 parameters, 3 given in %s on line %d -NULL diff --git a/ext/standard/tests/file/parse_ini_file.phpt b/ext/standard/tests/file/parse_ini_file.phpt index eed17c0093..7f134d02a0 100644 --- a/ext/standard/tests/file/parse_ini_file.phpt +++ b/ext/standard/tests/file/parse_ini_file.phpt @@ -2,11 +2,6 @@ Test parse_ini_file() function --FILE-- <?php -/* Prototype: array parse_ini_file(string $filename [,bool $process_sections]); - Description: parse_ini_file() loads in the ini file specified in filename, - and returns the settings in it in an associative array. -*/ - $file_path = __DIR__; $parse_string = <<<EOD @@ -25,7 +20,7 @@ PHP_CONSTANT = 1.2345678 HELLO = HELLO [date] -date = +date = time = [paths] @@ -64,7 +59,7 @@ Non_alpha11 = / Non_alpha12 = \ ;These chars have a special meaning when used in the value, ; hence parser throws an error -;Non_alpha13 = & +;Non_alpha13 = & ;Non_alpha14 = ^ ;Non_alpha15 = {} ;Non_alpha16 = | @@ -172,7 +167,7 @@ Key16 = Null Key17 = nuLL Key18 = null -[ReservedKeys_as_Keys] +[ReservedKeys_as_Keys] ; Expected:error, reserved key words must not be used as keys for ini file ;YES = 1 ;Yes = 2 diff --git a/ext/standard/tests/file/parse_ini_file_error.phpt b/ext/standard/tests/file/parse_ini_file_error.phpt index 29e022fb13..ce4952f108 100644 --- a/ext/standard/tests/file/parse_ini_file_error.phpt +++ b/ext/standard/tests/file/parse_ini_file_error.phpt @@ -2,18 +2,8 @@ Test parse_ini_file() function : error conditions --FILE-- <?php -/* Prototype : proto array parse_ini_file(string filename [, bool process_sections]) - * Description: Parse configuration file - * Source code: ext/standard/basic_functions.c - * Alias to functions: - */ - echo "*** Testing parse_ini_file() : error conditions ***\n"; -// Zero arguments -echo "\n-- Testing parse_ini_file() function with Zero arguments --\n"; -var_dump( parse_ini_file() ); - //Test parse_ini_file with one more than the expected number of arguments echo "\n-- Testing parse_ini_file() function with more than expected no. of arguments --\n"; $filename = 'string_val'; @@ -30,18 +20,13 @@ echo "Done"; --EXPECTF-- *** Testing parse_ini_file() : error conditions *** --- Testing parse_ini_file() function with Zero arguments -- - -Warning: parse_ini_file() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -- Testing parse_ini_file() function with more than expected no. of arguments -- -Warning: parse_ini_file(%s): failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(%s): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Testing parse_ini_file() function with a non-existent file -- -Warning: parse_ini_file(%s): failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(%s): Failed to open stream: No such file or directory in %s on line %d bool(false) Done diff --git a/ext/standard/tests/file/parse_ini_file_variation1.phpt b/ext/standard/tests/file/parse_ini_file_variation1.phpt index 666ea433b1..c9f2dc218c 100644 --- a/ext/standard/tests/file/parse_ini_file_variation1.phpt +++ b/ext/standard/tests/file/parse_ini_file_variation1.phpt @@ -4,12 +4,6 @@ Test parse_ini_file() function : variation: identical properties and values are Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : array parse_ini_file(string filename [, bool process_sections]) - * Description: Parse configuration file - * Source code: ext/standard/basic_functions.c - * Alias to functions: - */ - echo "*** Testing parse_ini_file() : variation ***\n"; $output_file = __FILE__.".ini"; $iniFile = <<<FILE @@ -30,7 +24,6 @@ var_dump($a); unlink($output_file); ?> -===DONE=== --EXPECT-- *** Testing parse_ini_file() : variation *** array(2) { @@ -65,4 +58,3 @@ array(2) { string(9) "different" } } -===DONE=== diff --git a/ext/standard/tests/file/parse_ini_file_variation2.phpt b/ext/standard/tests/file/parse_ini_file_variation2.phpt index e7b9091737..65c0b45ade 100644 --- a/ext/standard/tests/file/parse_ini_file_variation2.phpt +++ b/ext/standard/tests/file/parse_ini_file_variation2.phpt @@ -4,12 +4,6 @@ Test parse_ini_file() function : variation: handling different boolean values Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : array parse_ini_file(string filename [, bool process_sections]) - * Description: Parse configuration file - * Source code: ext/standard/basic_functions.c - * Alias to functions: - */ - echo "*** Testing parse_ini_file() : variation ***\n"; $output_file = __FILE__.".ini"; $iniFile = <<<FILE @@ -47,7 +41,6 @@ $a = parse_ini_file($output_file, true); var_dump($a); unlink($output_file); ?> -===DONE=== --EXPECT-- *** Testing parse_ini_file() : variation *** array(8) { @@ -108,4 +101,3 @@ array(8) { string(0) "" } } -===DONE=== diff --git a/ext/standard/tests/file/parse_ini_file_variation3.phpt b/ext/standard/tests/file/parse_ini_file_variation3.phpt index 96d44433f7..81aeb46d02 100644 --- a/ext/standard/tests/file/parse_ini_file_variation3.phpt +++ b/ext/standard/tests/file/parse_ini_file_variation3.phpt @@ -4,12 +4,6 @@ Test parse_ini_file() function : variation: include path searching Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : array parse_ini_file(string filename [, bool process_sections]) - * Description: Parse configuration file - * Source code: ext/standard/basic_functions.c - * Alias to functions: - */ - echo "*** Testing parse_ini_file() : variation ***\n"; $pwd = getcwd(); $f = "parse_ini_file_variation3"; @@ -43,7 +37,6 @@ log_errors_max_len = 1024 ignore_repeated_errors = Off ignore_repeated_source = Off report_memleaks = On -track_errors = Off docref_root = "/phpmanual/" docref_ext = .html @@ -53,7 +46,6 @@ file_put_contents($output_file, $iniContent); var_dump(parse_ini_file($iniFile)); ?> -===Done=== --CLEAN-- <?php @@ -77,7 +69,7 @@ foreach($newdirs as $newdir) { --EXPECTF-- *** Testing parse_ini_file() : variation *** New include path is : %sparse_ini_file_variation3.dir1%sparse_ini_file_variation3.dir2%sparse_ini_file_variation3.dir3%S -array(11) { +array(10) { ["error_reporting"]=> string(5) "32767" ["display_errors"]=> @@ -94,11 +86,8 @@ array(11) { string(0) "" ["report_memleaks"]=> string(1) "1" - ["track_errors"]=> - string(0) "" ["docref_root"]=> string(11) "/phpmanual/" ["docref_ext"]=> string(5) ".html" } -===Done=== diff --git a/ext/standard/tests/file/parse_ini_file_variation6-win32-mb.phpt b/ext/standard/tests/file/parse_ini_file_variation6-win32-mb.phpt index df98a632b4..c5c5934062 100644 --- a/ext/standard/tests/file/parse_ini_file_variation6-win32-mb.phpt +++ b/ext/standard/tests/file/parse_ini_file_variation6-win32-mb.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype : array parse_ini_file(string filename [, bool process_sections]) - * Description: Parse configuration file - * Source code: ext/standard/basic_functions.c - * Alias to functions: - */ - echo "*** Testing parse_ini_file() : variation ***\n"; $mainDir = "parseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.dir"; $subDir = "parseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™Sub"; @@ -97,12 +91,12 @@ array(1) { -- Iteration 5 -- -Warning: parse_ini_file(%sparseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.dir\parseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™Sub\..\\\parseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™Sub\\..\\..\parseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™Sub\parseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.ini): failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(%sparseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.dir\parseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™Sub\..\\\parseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™Sub\\..\\..\parseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™Sub\parseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.ini): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 6 -- -Warning: parse_ini_file(%sparseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.dir\parseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™Sub\BADDIR\parseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.ini): failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(%sparseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.dir\parseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™Sub\BADDIR\parseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.ini): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 7 -- @@ -131,7 +125,7 @@ array(1) { -- Iteration 11 -- -Warning: parse_ini_file(BADDIR\parseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.ini): failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(BADDIR\parseIniFileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.ini): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 12 -- diff --git a/ext/standard/tests/file/parse_ini_file_variation6-win32.phpt b/ext/standard/tests/file/parse_ini_file_variation6-win32.phpt index 2ef1d88fcc..a7b005c6e9 100644 --- a/ext/standard/tests/file/parse_ini_file_variation6-win32.phpt +++ b/ext/standard/tests/file/parse_ini_file_variation6-win32.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype : array parse_ini_file(string filename [, bool process_sections]) - * Description: Parse configuration file - * Source code: ext/standard/basic_functions.c - * Alias to functions: - */ - echo "*** Testing parse_ini_file() : variation ***\n"; $mainDir = "parseIniFileVar6.dir"; $subDir = "parseIniFileVar6Sub"; @@ -97,12 +91,12 @@ array(1) { -- Iteration 5 -- -Warning: parse_ini_file(%sparseIniFileVar6.dir\parseIniFileVar6Sub\..\\\parseIniFileVar6Sub\\..\\..\parseIniFileVar6Sub\ParseIniFileVar6.ini): failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(%sparseIniFileVar6.dir\parseIniFileVar6Sub\..\\\parseIniFileVar6Sub\\..\\..\parseIniFileVar6Sub\ParseIniFileVar6.ini): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 6 -- -Warning: parse_ini_file(%sparseIniFileVar6.dir\parseIniFileVar6Sub\BADDIR\ParseIniFileVar6.ini): failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(%sparseIniFileVar6.dir\parseIniFileVar6Sub\BADDIR\ParseIniFileVar6.ini): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 7 -- @@ -131,7 +125,7 @@ array(1) { -- Iteration 11 -- -Warning: parse_ini_file(BADDIR\ParseIniFileVar6.ini): failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(BADDIR\ParseIniFileVar6.ini): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 12 -- diff --git a/ext/standard/tests/file/parse_ini_file_variation6.phpt b/ext/standard/tests/file/parse_ini_file_variation6.phpt index 7c6d8ab4cb..70e1a73f98 100644 --- a/ext/standard/tests/file/parse_ini_file_variation6.phpt +++ b/ext/standard/tests/file/parse_ini_file_variation6.phpt @@ -4,12 +4,6 @@ Test parse_ini_file() function : variation - various absolute and relative paths Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : array parse_ini_file(string filename [, bool process_sections]) - * Description: Parse configuration file - * Source code: ext/standard/basic_functions.c - * Alias to functions: - */ - echo "*** Testing parse_ini_file() : variation ***\n"; $mainDir = "parseIniFileVar6.dir"; $subDir = "parseIniFileVar6Sub"; @@ -89,12 +83,12 @@ array(1) { -- Iteration 5 -- -Warning: parse_ini_file(%sparseIniFileVar6.dir/parseIniFileVar6Sub/..///parseIniFileVar6Sub//..//../parseIniFileVar6Sub/ParseIniFileVar6.ini): failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(%sparseIniFileVar6.dir/parseIniFileVar6Sub/..///parseIniFileVar6Sub//..//../parseIniFileVar6Sub/ParseIniFileVar6.ini): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 6 -- -Warning: parse_ini_file(%sparseIniFileVar6.dir/parseIniFileVar6Sub/BADDIR/ParseIniFileVar6.ini): failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(%sparseIniFileVar6.dir/parseIniFileVar6Sub/BADDIR/ParseIniFileVar6.ini): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 7 -- @@ -123,7 +117,7 @@ array(1) { -- Iteration 11 -- -Warning: parse_ini_file(BADDIR/ParseIniFileVar6.ini): failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(BADDIR/ParseIniFileVar6.ini): Failed to open stream: No such file or directory in %s on line %d bool(false) *** Done *** diff --git a/ext/standard/tests/file/pathinfo_basic.phpt b/ext/standard/tests/file/pathinfo_basic.phpt index f44379847e..e16619a815 100644 --- a/ext/standard/tests/file/pathinfo_basic.phpt +++ b/ext/standard/tests/file/pathinfo_basic.phpt @@ -2,10 +2,6 @@ Test pathinfo() function: basic functionality --FILE-- <?php -/* Prototype: mixed pathinfo ( string $path [, int $options] ); - Description: Returns information about a file path -*/ - echo "*** Testing basic functions of pathinfo() ***\n"; $file_path = __DIR__; diff --git a/ext/standard/tests/file/pathinfo_basic1-win32.phpt b/ext/standard/tests/file/pathinfo_basic1-win32.phpt index acca647a97..69d0fa27d1 100644 --- a/ext/standard/tests/file/pathinfo_basic1-win32.phpt +++ b/ext/standard/tests/file/pathinfo_basic1-win32.phpt @@ -9,52 +9,48 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype: mixed pathinfo ( string $path [, int $options] ); - Description: Returns information about a file path -*/ - echo "*** Testing basic functions of pathinfo() ***\n"; $paths = array ( - '', - ' ', - 'c:', - 'c:\\', - 'c:/', - 'afile', - 'c:\test\adir', - 'c:\test\adir\\', - '/usr/include/arpa', - '/usr/include/arpa/', - 'usr/include/arpa', - 'usr/include/arpa/', - 'c:\test\afile', - 'c:\\test\\afile', - 'c://test//afile', - 'c:\test\afile\\', - 'c:\test\prog.exe', - 'c:\\test\\prog.exe', - 'c:/test/prog.exe', - '/usr/include/arpa/inet.h', - '//usr/include//arpa/inet.h', - '\\', - '\\\\', - '/', - '//', - '///', - '/usr/include/arpa/inet.h', - 'c:\windows/system32\drivers/etc\hosts', - '/usr\include/arpa\inet.h', - ' c:\test\adir\afile.txt', - 'c:\test\adir\afile.txt ', - ' c:\test\adir\afile.txt ', - ' /usr/include/arpa/inet.h', - '/usr/include/arpa/inet.h ', - ' /usr/include/arpa/inet.h ', - ' c:', - ' c:\test\adir\afile.txt', - '/usr', - '/usr/' + '', + ' ', + 'c:', + 'c:\\', + 'c:/', + 'afile', + 'c:\test\adir', + 'c:\test\adir\\', + '/usr/include/arpa', + '/usr/include/arpa/', + 'usr/include/arpa', + 'usr/include/arpa/', + 'c:\test\afile', + 'c:\\test\\afile', + 'c://test//afile', + 'c:\test\afile\\', + 'c:\test\prog.exe', + 'c:\\test\\prog.exe', + 'c:/test/prog.exe', + '/usr/include/arpa/inet.h', + '//usr/include//arpa/inet.h', + '\\', + '\\\\', + '/', + '//', + '///', + '/usr/include/arpa/inet.h', + 'c:\windows/system32\drivers/etc\hosts', + '/usr\include/arpa\inet.h', + ' c:\test\adir\afile.txt', + 'c:\test\adir\afile.txt ', + ' c:\test\adir\afile.txt ', + ' /usr/include/arpa/inet.h', + '/usr/include/arpa/inet.h ', + ' /usr/include/arpa/inet.h ', + ' c:', + ' c:\test\adir\afile.txt', + '/usr', + '/usr/' ); $counter = 1; diff --git a/ext/standard/tests/file/pathinfo_basic1.phpt b/ext/standard/tests/file/pathinfo_basic1.phpt index c9e84522a8..41a065e4e1 100644 --- a/ext/standard/tests/file/pathinfo_basic1.phpt +++ b/ext/standard/tests/file/pathinfo_basic1.phpt @@ -9,52 +9,48 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype: mixed pathinfo ( string $path [, int $options] ); - Description: Returns information about a file path -*/ - echo "*** Testing basic functions of pathinfo() ***\n"; $paths = array ( - '', - ' ', - 'c:', - 'c:\\', - 'c:/', - 'afile', - 'c:\test\adir', - 'c:\test\adir\\', - '/usr/include/arpa', - '/usr/include/arpa/', - 'usr/include/arpa', - 'usr/include/arpa/', - 'c:\test\afile', - 'c:\\test\\afile', - 'c://test//afile', - 'c:\test\afile\\', - 'c:\test\prog.exe', - 'c:\\test\\prog.exe', - 'c:/test/prog.exe', - '/usr/include/arpa/inet.h', - '//usr/include//arpa/inet.h', - '\\', - '\\\\', - '/', - '//', - '///', - '/usr/include/arpa/inet.h', - 'c:\windows/system32\drivers/etc\hosts', - '/usr\include/arpa\inet.h', - ' c:\test\adir\afile.txt', - 'c:\test\adir\afile.txt ', - ' c:\test\adir\afile.txt ', - ' /usr/include/arpa/inet.h', - '/usr/include/arpa/inet.h ', - ' /usr/include/arpa/inet.h ', - ' c:', - ' c:\test\adir\afile.txt', - '/usr', - '/usr/' + '', + ' ', + 'c:', + 'c:\\', + 'c:/', + 'afile', + 'c:\test\adir', + 'c:\test\adir\\', + '/usr/include/arpa', + '/usr/include/arpa/', + 'usr/include/arpa', + 'usr/include/arpa/', + 'c:\test\afile', + 'c:\\test\\afile', + 'c://test//afile', + 'c:\test\afile\\', + 'c:\test\prog.exe', + 'c:\\test\\prog.exe', + 'c:/test/prog.exe', + '/usr/include/arpa/inet.h', + '//usr/include//arpa/inet.h', + '\\', + '\\\\', + '/', + '//', + '///', + '/usr/include/arpa/inet.h', + 'c:\windows/system32\drivers/etc\hosts', + '/usr\include/arpa\inet.h', + ' c:\test\adir\afile.txt', + 'c:\test\adir\afile.txt ', + ' c:\test\adir\afile.txt ', + ' /usr/include/arpa/inet.h', + '/usr/include/arpa/inet.h ', + ' /usr/include/arpa/inet.h ', + ' c:', + ' c:\test\adir\afile.txt', + '/usr', + '/usr/' ); $counter = 1; diff --git a/ext/standard/tests/file/pathinfo_basic2-win32.phpt b/ext/standard/tests/file/pathinfo_basic2-win32.phpt index 5a88b648d3..c63f3162c3 100644 --- a/ext/standard/tests/file/pathinfo_basic2-win32.phpt +++ b/ext/standard/tests/file/pathinfo_basic2-win32.phpt @@ -9,28 +9,24 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype: mixed pathinfo ( string $path [, int $options] ); - Description: Returns information about a file path -*/ - echo "*** Testing basic functions of pathinfo() ***\n"; $paths = array ( - 'c:\..\dir1', - 'c:\test\..\test2\.\adir\afile.txt', - '/usr/include/../arpa/./inet.h', - 'c:\test\adir\afile..txt', - '/usr/include/arpa/inet..h', - 'c:\test\adir\afile.', - '/usr/include/arpa/inet.', - '/usr/include/arpa/inet,h', - 'c:afile.txt', - '..\.\..\test\afile.txt', - '.././../test/afile', - '.', - '..', - '...', - '/usr/lib/.../afile' + 'c:\..\dir1', + 'c:\test\..\test2\.\adir\afile.txt', + '/usr/include/../arpa/./inet.h', + 'c:\test\adir\afile..txt', + '/usr/include/arpa/inet..h', + 'c:\test\adir\afile.', + '/usr/include/arpa/inet.', + '/usr/include/arpa/inet,h', + 'c:afile.txt', + '..\.\..\test\afile.txt', + '.././../test/afile', + '.', + '..', + '...', + '/usr/lib/.../afile' ); diff --git a/ext/standard/tests/file/pathinfo_basic2.phpt b/ext/standard/tests/file/pathinfo_basic2.phpt index 51de45d33d..c3909295f9 100644 --- a/ext/standard/tests/file/pathinfo_basic2.phpt +++ b/ext/standard/tests/file/pathinfo_basic2.phpt @@ -9,28 +9,24 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype: mixed pathinfo ( string $path [, int $options] ); - Description: Returns information about a file path -*/ - echo "*** Testing basic functions of pathinfo() ***\n"; $paths = array ( - 'c:\..\dir1', - 'c:\test\..\test2\.\adir\afile.txt', - '/usr/include/../arpa/./inet.h', - 'c:\test\adir\afile..txt', - '/usr/include/arpa/inet..h', - 'c:\test\adir\afile.', - '/usr/include/arpa/inet.', - '/usr/include/arpa/inet,h', - 'c:afile.txt', - '..\.\..\test\afile.txt', - '.././../test/afile', - '.', - '..', - '...', - '/usr/lib/.../afile' + 'c:\..\dir1', + 'c:\test\..\test2\.\adir\afile.txt', + '/usr/include/../arpa/./inet.h', + 'c:\test\adir\afile..txt', + '/usr/include/arpa/inet..h', + 'c:\test\adir\afile.', + '/usr/include/arpa/inet.', + '/usr/include/arpa/inet,h', + 'c:afile.txt', + '..\.\..\test\afile.txt', + '.././../test/afile', + '.', + '..', + '...', + '/usr/lib/.../afile' ); diff --git a/ext/standard/tests/file/pathinfo_variation3.phpt b/ext/standard/tests/file/pathinfo_variation3.phpt index 014cc90e9a..aa1494b579 100644 --- a/ext/standard/tests/file/pathinfo_variation3.phpt +++ b/ext/standard/tests/file/pathinfo_variation3.phpt @@ -4,12 +4,6 @@ Test pathinfo() function : usage variation Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : array pathinfo(string path[, int options]) - * Description: Returns information about a certain string - * Source code: ext/standard/string.c - * Alias to functions: - */ - echo "*** Testing pathinfo() : usage variation ***\n"; $testfile = "/usr/include/arpa/inet.h"; @@ -32,7 +26,6 @@ var_dump(pathinfo($testfile, PATHINFO_DIRNAME|PATHINFO_BASENAME)); ?> -===DONE=== --EXPECTF-- *** Testing pathinfo() : usage variation *** array(4) { @@ -77,4 +70,3 @@ string(17) "/usr/include/arpa" string(6) "inet.h" string(17) "/usr/include/arpa" string(17) "/usr/include/arpa" -===DONE=== diff --git a/ext/standard/tests/file/pathinfo_variaton.phpt b/ext/standard/tests/file/pathinfo_variaton.phpt index 421f378e01..4447d07d6c 100644 --- a/ext/standard/tests/file/pathinfo_variaton.phpt +++ b/ext/standard/tests/file/pathinfo_variaton.phpt @@ -2,11 +2,7 @@ Test pathinfo() function: usage variations --FILE-- <?php -/* Prototype: mixed pathinfo ( string $path [, int $options] ); - Description: Returns information about a file path -*/ - -echo "*** Testing pathinfo() with miscelleneous input arguments ***\n"; +echo "*** Testing pathinfo() with miscellaneous input arguments ***\n"; $fp = fopen(__FILE__, "r"); unset($fp); @@ -43,9 +39,6 @@ $paths = array ( "./array(1, 2)", "array( array(), null)", - /* pathname as object */ - $obj, - /* pathname as spaces */ " ", ' ', @@ -91,9 +84,9 @@ foreach($paths as $path) { echo "Done\n"; ?> --EXPECTF-- -*** Testing pathinfo() with miscelleneous input arguments *** +*** Testing pathinfo() with miscellaneous input arguments *** -Notice: Undefined variable: fp in %s on line %d +Warning: Undefined variable $fp in %s on line %d -- Iteration 1 -- array(3) { ["dirname"]=> @@ -199,22 +192,6 @@ string(21) "array( array(), null)" string(0) "" string(21) "array( array(), null)" -- Iteration 9 -- - -Warning: pathinfo() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: pathinfo() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: pathinfo() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: pathinfo() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: pathinfo() expects parameter 1 to be string, object given in %s on line %d -NULL --- Iteration 10 -- array(3) { ["dirname"]=> string(1) "." @@ -227,7 +204,7 @@ string(1) "." string(1) " " string(0) "" string(1) " " --- Iteration 11 -- +-- Iteration 10 -- array(3) { ["dirname"]=> string(1) "." @@ -240,7 +217,7 @@ string(1) "." string(1) " " string(0) "" string(1) " " --- Iteration 12 -- +-- Iteration 11 -- array(2) { ["basename"]=> string(0) "" @@ -251,7 +228,7 @@ string(0) "" string(0) "" string(0) "" string(0) "" --- Iteration 13 -- +-- Iteration 12 -- array(2) { ["basename"]=> string(0) "" @@ -262,7 +239,7 @@ string(0) "" string(0) "" string(0) "" string(0) "" --- Iteration 14 -- +-- Iteration 13 -- array(2) { ["basename"]=> string(0) "" @@ -273,7 +250,7 @@ string(0) "" string(0) "" string(0) "" string(0) "" --- Iteration 15 -- +-- Iteration 14 -- array(2) { ["basename"]=> string(0) "" @@ -284,7 +261,7 @@ string(0) "" string(0) "" string(0) "" string(0) "" --- Iteration 16 -- +-- Iteration 15 -- array(2) { ["basename"]=> string(0) "" @@ -295,7 +272,7 @@ string(0) "" string(0) "" string(0) "" string(0) "" --- Iteration 17 -- +-- Iteration 16 -- array(4) { ["dirname"]=> string(1) "." @@ -310,7 +287,7 @@ string(1) "." string(11) "www.foo.com" string(3) "com" string(7) "www.foo" --- Iteration 18 -- +-- Iteration 17 -- array(4) { ["dirname"]=> string(17) "/var/html/testdir" @@ -325,7 +302,7 @@ string(17) "/var/html/testdir" string(12) "example.html" string(4) "html" string(7) "example" --- Iteration 19 -- +-- Iteration 18 -- array(3) { ["dirname"]=> string(12) "/testdir/foo" @@ -338,7 +315,7 @@ string(12) "/testdir/foo" string(4) "test" string(0) "" string(4) "test" --- Iteration 20 -- +-- Iteration 19 -- array(4) { ["dirname"]=> string(4) "/foo" @@ -353,7 +330,7 @@ string(4) "/foo" string(12) "symlink.link" string(4) "link" string(7) "symlink" --- Iteration 21 -- +-- Iteration 20 -- array(3) { ["dirname"]=> string(1) "." @@ -366,7 +343,7 @@ string(1) "." string(5) "12345" string(0) "" string(5) "12345" --- Iteration 22 -- +-- Iteration 21 -- array(4) { ["dirname"]=> string(1) "." @@ -381,7 +358,7 @@ string(1) "." string(15) "www.example.com" string(3) "com" string(11) "www.example" --- Iteration 23 -- +-- Iteration 22 -- array(3) { ["dirname"]=> string(12) "/testdir/foo" @@ -394,7 +371,7 @@ string(12) "/testdir/foo" string(4) "test" string(0) "" string(4) "test" --- Iteration 24 -- +-- Iteration 23 -- array(4) { ["dirname"]=> string(6) "../foo" @@ -409,7 +386,7 @@ string(6) "../foo" string(9) "test.link" string(4) "link" string(4) "test" --- Iteration 25 -- +-- Iteration 24 -- array(4) { ["dirname"]=> string(76) "./test/work/scratch/mydir/yourdir/ourdir/test1/test2/test3/test4/test5/test6" @@ -424,7 +401,7 @@ string(76) "./test/work/scratch/mydir/yourdir/ourdir/test1/test2/test3/test4/tes string(8) "test.tmp" string(3) "tmp" string(4) "test" --- Iteration 26 -- +-- Iteration 25 -- array(4) { ["dirname"]=> string(1) "." diff --git a/ext/standard/tests/file/php_fd_wrapper_03.phpt b/ext/standard/tests/file/php_fd_wrapper_03.phpt index c004a4319f..75e05620aa 100644 --- a/ext/standard/tests/file/php_fd_wrapper_03.phpt +++ b/ext/standard/tests/file/php_fd_wrapper_03.phpt @@ -11,12 +11,12 @@ echo "\nDone.\n"; --EXPECTF-- Warning: fopen(): Invalid php:// URL specified in %s on line %d -Warning: fopen(php://fd): failed to open stream: operation failed in %s on line 2 +Warning: fopen(php://fd): Failed to open stream: operation failed in %s on line 2 -Warning: fopen(php://fd/): failed to open stream: php://fd/ stream must be specified in the form php://fd/<orig fd> in %s on line %d +Warning: fopen(php://fd/): Failed to open stream: php://fd/ stream must be specified in the form php://fd/<orig fd> in %s on line %d -Warning: fopen(php://fd/-2): failed to open stream: The file descriptors must be non-negative numbers smaller than %d in %s on line %d +Warning: fopen(php://fd/-2): Failed to open stream: The file descriptors must be non-negative numbers smaller than %d in %s on line %d -Warning: fopen(php://fd/1/): failed to open stream: php://fd/ stream must be specified in the form php://fd/<orig fd> in %s on line %d +Warning: fopen(php://fd/1/): Failed to open stream: php://fd/ stream must be specified in the form php://fd/<orig fd> in %s on line %d Done. diff --git a/ext/standard/tests/file/php_fd_wrapper_04.phpt b/ext/standard/tests/file/php_fd_wrapper_04.phpt index ea3a1aff6e..142f70abb4 100644 --- a/ext/standard/tests/file/php_fd_wrapper_04.phpt +++ b/ext/standard/tests/file/php_fd_wrapper_04.phpt @@ -6,6 +6,6 @@ fopen("php://fd/1023", "w"); echo "\nDone.\n"; --EXPECTF-- -Warning: fopen(php://fd/1023): failed to open stream: Error duping file descriptor 1023; possibly it doesn't exist: [9]: %s in %s on line %d +Warning: fopen(php://fd/1023): Failed to open stream: Error duping file descriptor 1023; possibly it doesn't exist: [9]: %s in %s on line %d Done. diff --git a/ext/standard/tests/file/popen_pclose_basic-win32-mb.phpt b/ext/standard/tests/file/popen_pclose_basic-win32-mb.phpt index 2d9b2b92dc..7bb4c1be02 100644 --- a/ext/standard/tests/file/popen_pclose_basic-win32-mb.phpt +++ b/ext/standard/tests/file/popen_pclose_basic-win32-mb.phpt @@ -7,14 +7,6 @@ if(substr(PHP_OS, 0, 3) != 'WIN' ) ?> --FILE-- <?php -/* - * Prototype: resource popen ( string command, string mode ) - * Description: Opens process file pointer. - - * Prototype: int pclose ( resource handle ); - * Description: Closes process file pointer. - */ - echo "*** Testing popen(): reading from the pipe ***\n"; $file_path = __DIR__; @@ -28,7 +20,7 @@ echo "*** Testing popen(): writing to the pipe ***\n"; $arr = array("ggg", "ddd", "aaa", "sss"); // popen("sort", "w") fails if variables_order="GPCS" // this is set in the default INI file -// it doesn't seem to be changeable in the --INI-- section +// it doesn't seem to be changeable in the--INI-- section // also, doing: ini_set('variables_order', ''); doesn't work! // // the only solution is to either put the absolute path here, or diff --git a/ext/standard/tests/file/popen_pclose_basic-win32.phpt b/ext/standard/tests/file/popen_pclose_basic-win32.phpt index dfb00fbeb2..61f2fa302b 100644 --- a/ext/standard/tests/file/popen_pclose_basic-win32.phpt +++ b/ext/standard/tests/file/popen_pclose_basic-win32.phpt @@ -7,14 +7,6 @@ if(substr(PHP_OS, 0, 3) != 'WIN' ) ?> --FILE-- <?php -/* - * Prototype: resource popen ( string command, string mode ) - * Description: Opens process file pointer. - - * Prototype: int pclose ( resource handle ); - * Description: Closes process file pointer. - */ - echo "*** Testing popen(): reading from the pipe ***\n"; $file_path = __DIR__; @@ -28,7 +20,7 @@ echo "*** Testing popen(): writing to the pipe ***\n"; $arr = array("ggg", "ddd", "aaa", "sss"); // popen("sort", "w") fails if variables_order="GPCS" // this is set in the default INI file -// it doesn't seem to be changeable in the --INI-- section +// it doesn't seem to be changeable in the--INI-- section // also, doing: ini_set('variables_order', ''); doesn't work! // // the only solution is to either put the absolute path here, or diff --git a/ext/standard/tests/file/popen_pclose_basic.phpt b/ext/standard/tests/file/popen_pclose_basic.phpt index 4e17c29cde..4964a4fa85 100644 --- a/ext/standard/tests/file/popen_pclose_basic.phpt +++ b/ext/standard/tests/file/popen_pclose_basic.phpt @@ -7,14 +7,6 @@ if(substr(PHP_OS, 0, 3) == 'WIN' ) ?> --FILE-- <?php -/* - * Prototype: resource popen ( string command, string mode ) - * Description: Opens process file pointer. - * - * Prototype: int pclose ( resource handle ); - * Description: Closes process file pointer. - */ - $file_path = __DIR__; require($file_path."/file.inc"); diff --git a/ext/standard/tests/file/popen_pclose_error-sunos.phpt b/ext/standard/tests/file/popen_pclose_error-sunos.phpt index ee015750b4..981f1d5a6e 100644 --- a/ext/standard/tests/file/popen_pclose_error-sunos.phpt +++ b/ext/standard/tests/file/popen_pclose_error-sunos.phpt @@ -7,13 +7,7 @@ if( substr(PHP_OS, 0, 3) != 'Sun') ?> --FILE-- <?php -/* - * Prototype: resource popen ( string command, string mode ) - * Description: Opens process file pointer. - * Prototype: int pclose ( resource handle ); - * Description: Closes process file pointer. - */ $file_path = __DIR__; echo "*** Testing for error conditions ***\n"; var_dump( popen() ); // Zero Arguments diff --git a/ext/standard/tests/file/popen_pclose_error.phpt b/ext/standard/tests/file/popen_pclose_error.phpt index b0e86be65c..2f05e7788d 100644 --- a/ext/standard/tests/file/popen_pclose_error.phpt +++ b/ext/standard/tests/file/popen_pclose_error.phpt @@ -7,23 +7,11 @@ if (strtoupper( substr(PHP_OS, 0, 3) ) == 'SUN') ?> --FILE-- <?php -/* - * Prototype: resource popen ( string command, string mode ) - * Description: Opens process file pointer. - - * Prototype: int pclose ( resource handle ); - * Description: Closes process file pointer. - */ $file_path = __DIR__; echo "*** Testing for error conditions ***\n"; -var_dump( popen() ); // Zero Arguments -var_dump( popen("abc.txt") ); // Single Argument var_dump( popen("abc.txt", "rw") ); // Invalid mode Argument -var_dump( pclose() ); $file_handle = fopen($file_path."/popen.tmp", "w"); -var_dump( pclose($file_handle, $file_handle) ); fclose($file_handle); -var_dump( pclose(1) ); echo "\n--- Done ---"; ?> --CLEAN-- @@ -34,22 +22,7 @@ unlink($file_path."/popen.tmp"); --EXPECTF-- *** Testing for error conditions *** -Warning: popen() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: popen() expects exactly 2 parameters, 1 given in %s on line %d -NULL - Warning: popen(abc.txt,rw): %s on line %d bool(false) -Warning: pclose() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: pclose() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -Warning: pclose() expects parameter 1 to be resource, int given in %s on line %d -bool(false) - --- Done --- diff --git a/ext/standard/tests/file/proc_open01.phpt b/ext/standard/tests/file/proc_open01.phpt index 66c601fb91..2f74a17464 100644 --- a/ext/standard/tests/file/proc_open01.phpt +++ b/ext/standard/tests/file/proc_open01.phpt @@ -6,15 +6,15 @@ $pipes = array(1, 2, 3); $orig_pipes = $pipes; $php = getenv('TEST_PHP_EXECUTABLE'); if ($php === false) { - die("no php executable defined"); + die("no php executable defined"); } $proc = proc_open( - "$php -n", - array(0 => array('pipe', 'r'), 1 => array('pipe', 'w')), - $pipes, getcwd(), array(), array() + "$php -n", + array(0 => array('pipe', 'r'), 1 => array('pipe', 'w')), + $pipes, getcwd(), array(), array() ); if ($proc === false) { - print "something went wrong.\n"; + print "something went wrong.\n"; } var_dump($pipes); stream_set_blocking($pipes[1], FALSE); @@ -25,25 +25,25 @@ fclose($pipes[0]); $cnt = ''; $n=0; for ($left = strlen($test_string); $left > 0;) { - if (++$n >1000) { - print "terminated after 1000 iterations\n"; - break; - } - $read_fds = array($pipes[1]); - $write_fds = NULL; - $exp_fds = NULL; - $retval = stream_select($read_fds, $write_fds, $exp_fds, 5); - if ($retval === false) { - print "select() failed\n"; - break; - } - if ($retval === 0) { - print "timed out\n"; - break; - } - $buf = fread($pipes[1], 1024); - $cnt .= $buf; - $left -= strlen($buf); + if (++$n >1000) { + print "terminated after 1000 iterations\n"; + break; + } + $read_fds = array($pipes[1]); + $write_fds = NULL; + $exp_fds = NULL; + $retval = stream_select($read_fds, $write_fds, $exp_fds, 5); + if ($retval === false) { + print "select() failed\n"; + break; + } + if ($retval === 0) { + print "timed out\n"; + break; + } + $buf = fread($pipes[1], 1024); + $cnt .= $buf; + $left -= strlen($buf); } var_dump($cnt); fclose($pipes[1]); diff --git a/ext/standard/tests/file/proc_open_with_wrong_resource_type.phpt b/ext/standard/tests/file/proc_open_with_wrong_resource_type.phpt new file mode 100644 index 0000000000..f48c7b8720 --- /dev/null +++ b/ext/standard/tests/file/proc_open_with_wrong_resource_type.phpt @@ -0,0 +1,14 @@ +--TEST-- +proc_open does not leak memory when called with wrong resource type in descriptorspec +--FILE-- +<?php + $context = stream_context_create(); + try { + proc_open('not_a_real_command_but_I_dont_care', array(0 => $context), $pipes); + echo "Not reached"; + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } +?> +--EXPECT-- +proc_open(): supplied resource is not a valid stream resource diff --git a/ext/standard/tests/file/readfile_basic-win32.phpt b/ext/standard/tests/file/readfile_basic-win32.phpt index 06e0813d57..843e0ff5d8 100644 --- a/ext/standard/tests/file/readfile_basic-win32.phpt +++ b/ext/standard/tests/file/readfile_basic-win32.phpt @@ -8,9 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: int readfile ( string $filename [, bool $use_include_path [, resource $context]] ); - Description: Outputs a file -*/ // common file used require(__DIR__ . '/file.inc'); diff --git a/ext/standard/tests/file/readfile_basic.phpt b/ext/standard/tests/file/readfile_basic.phpt index 1c05f494a6..d2b888a034 100644 --- a/ext/standard/tests/file/readfile_basic.phpt +++ b/ext/standard/tests/file/readfile_basic.phpt @@ -8,9 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype: int readfile ( string $filename [, bool $use_include_path [, resource $context]] ); - Description: Outputs a file -*/ // common file used require(__DIR__ . '/file.inc'); diff --git a/ext/standard/tests/file/readfile_error.phpt b/ext/standard/tests/file/readfile_error.phpt index 0dc1f7b82f..6ae9f9a4de 100644 --- a/ext/standard/tests/file/readfile_error.phpt +++ b/ext/standard/tests/file/readfile_error.phpt @@ -2,24 +2,15 @@ Test readfile() function: error conditions --FILE-- <?php -/* Prototype: int readfile ( string $filename [, bool $use_include_path [, resource $context]] ); - Description: Outputs a file -*/ - $context = stream_context_create(); echo "*** Test readfile(): error conditions ***\n"; -echo "-- Testing readfile() with unexpected no. of arguments --\n"; -var_dump( readfile() ); // args < expected -var_dump( readfile(__FILE__, true, $context, 4) ); // args > expected echo "\n-- Testing readfile() with invalid arguments --\n"; // invalid arguments var_dump( readfile(NULL) ); // NULL as $filename var_dump( readfile('') ); // empty string as $filename var_dump( readfile(false) ); // boolean false as $filename -var_dump( readfile(__FILE__, false, '') ); // empty string as $context -var_dump( readfile(__FILE__, true, false) ); // boolean false as $context echo "\n-- Testing readfile() with non-existent file --\n"; $non_existent_file = __DIR__."/non_existent_file.tmp"; @@ -29,13 +20,6 @@ echo "Done\n"; ?> --EXPECTF-- *** Test readfile(): error conditions *** --- Testing readfile() with unexpected no. of arguments -- - -Warning: readfile() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: readfile() expects at most 3 parameters, 4 given in %s on line %d -bool(false) -- Testing readfile() with invalid arguments -- @@ -48,14 +32,8 @@ bool(false) Warning: readfile(): Filename cannot be empty in %s on line %d bool(false) -Warning: readfile() expects parameter 3 to be resource, string given in %s on line %d -bool(false) - -Warning: readfile() expects parameter 3 to be resource, bool given in %s on line %d -bool(false) - -- Testing readfile() with non-existent file -- -Warning: readfile(%s/non_existent_file.tmp): failed to open stream: %s in %s on line %d +Warning: readfile(%s/non_existent_file.tmp): Failed to open stream: %s in %s on line %d bool(false) Done diff --git a/ext/standard/tests/file/readfile_variation1.phpt b/ext/standard/tests/file/readfile_variation1.phpt index 6348bb3dfe..97ddf6a284 100644 --- a/ext/standard/tests/file/readfile_variation1.phpt +++ b/ext/standard/tests/file/readfile_variation1.phpt @@ -2,10 +2,6 @@ Test readfile() function: usage variation - stream_context --FILE-- <?php -/* Prototype: int readfile ( string $filename [, bool $use_include_path [, resource $context]] ); - Description: Outputs a file -*/ - /* test readfile() with third argument : context */ // include file.inc diff --git a/ext/standard/tests/file/readfile_variation10-win32.phpt b/ext/standard/tests/file/readfile_variation10-win32.phpt index 5824a8fe15..ecd850eb59 100644 --- a/ext/standard/tests/file/readfile_variation10-win32.phpt +++ b/ext/standard/tests/file/readfile_variation10-win32.phpt @@ -11,12 +11,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") obscure_filename --FILE-- <?php -/* Prototype : int readfile(string filename [, bool use_include_path[, resource context]]) - * Description: Output a file or a URL - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing readfile() : variation ***\n"; /* An array of files */ @@ -38,8 +32,12 @@ $names_arr = array( ); foreach($names_arr as $key => $value) { - echo "\n-- Filename: $key --\n"; - readfile($value); + echo "\n-- Filename: $key --\n"; + try { + readfile($value); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } }; ?> @@ -48,11 +46,11 @@ foreach($names_arr as $key => $value) { -- Filename: -1 -- -Warning: readfile(-1): failed to open stream: No such file or directory in %s on line %d +Warning: readfile(-1): Failed to open stream: No such file or directory in %s on line %d -- Filename: TRUE -- -Warning: readfile(1): failed to open stream: No such file or directory in %s on line %d +Warning: readfile(1): Failed to open stream: No such file or directory in %s on line %d -- Filename: FALSE -- @@ -68,20 +66,18 @@ Warning: readfile(): Filename cannot be empty in %s on line %d -- Filename: " " -- -Warning: readfile( ): failed to open stream: Permission denied in %s on line %d +Warning: readfile( ): Failed to open stream: Permission denied in %s on line %d -- Filename: \0 -- - -Warning: readfile() expects parameter 1 to be a valid path, string given in %s on line %d +readfile(): Argument #1 ($filename) must be a valid path, string given -- Filename: array() -- - -Warning: readfile() expects parameter 1 to be a valid path, array given in %s on line %d +readfile(): Argument #1 ($filename) must be a valid path, array given -- Filename: /no/such/file/dir -- -Warning: readfile(/no/such/file/dir): failed to open stream: No such file or directory in %s on line %d +Warning: readfile(/no/such/file/dir): Failed to open stream: No such file or directory in %s on line %d -- Filename: php/php -- -Warning: readfile(php/php): failed to open stream: No such file or directory in %s on line %d +Warning: readfile(php/php): Failed to open stream: No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/readfile_variation10.phpt b/ext/standard/tests/file/readfile_variation10.phpt Binary files differindex e9655377a3..304f57154c 100644 --- a/ext/standard/tests/file/readfile_variation10.phpt +++ b/ext/standard/tests/file/readfile_variation10.phpt diff --git a/ext/standard/tests/file/readfile_variation2.phpt b/ext/standard/tests/file/readfile_variation2.phpt index 029890404e..5407d3710d 100644 --- a/ext/standard/tests/file/readfile_variation2.phpt +++ b/ext/standard/tests/file/readfile_variation2.phpt @@ -8,10 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype: int readfile ( string $filename [, bool $use_include_path [, resource $context]] ); - Description: Outputs a file -*/ - /* Variation 2 : Create file Create soft/hard link to it Read link using readfile() diff --git a/ext/standard/tests/file/readfile_variation3.phpt b/ext/standard/tests/file/readfile_variation3.phpt index b2571d3ac5..20078def12 100644 --- a/ext/standard/tests/file/readfile_variation3.phpt +++ b/ext/standard/tests/file/readfile_variation3.phpt @@ -2,9 +2,6 @@ Test readfile() function: usage variation - include path --FILE-- <?php -/* Prototype: int readfile ( string $filename [, bool $use_include_path [, resource $context]] ); - Description: Outputs a file -*/ /* test readfile() by providing an include path, second argument */ // include file.inc diff --git a/ext/standard/tests/file/readfile_variation6.phpt b/ext/standard/tests/file/readfile_variation6.phpt index 38e0f23958..aa92c11369 100644 --- a/ext/standard/tests/file/readfile_variation6.phpt +++ b/ext/standard/tests/file/readfile_variation6.phpt @@ -4,12 +4,6 @@ Test readfile() function : variation - test include path Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : int readfile(string filename [, bool use_include_path[, resource context]]) - * Description: Output a file or a URL - * Source code: ext/standard/file.c - * Alias to functions: - */ - require_once('fopen_include_path.inc'); echo "*** Testing readfile() : variation ***\n"; @@ -42,8 +36,6 @@ function runtest() { } ?> -===DONE=== --EXPECT-- *** Testing readfile() : variation *** File in include path -===DONE=== diff --git a/ext/standard/tests/file/readfile_variation7.phpt b/ext/standard/tests/file/readfile_variation7.phpt index 955d77bd27..0e2616ff01 100644 --- a/ext/standard/tests/file/readfile_variation7.phpt +++ b/ext/standard/tests/file/readfile_variation7.phpt @@ -4,12 +4,6 @@ Test readfile() function : variation Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : int readfile(string filename [, bool use_include_path[, resource context]]) - * Description: Output a file or a URL - * Source code: ext/standard/file.c - * Alias to functions: - */ - require_once('fopen_include_path.inc'); echo "*** Testing readfile() : variation ***\n"; @@ -42,8 +36,6 @@ function runtest() { } ?> -===DONE=== --EXPECT-- *** Testing readfile() : variation *** File in script location -===DONE=== diff --git a/ext/standard/tests/file/readfile_variation8-win32-mb.phpt b/ext/standard/tests/file/readfile_variation8-win32-mb.phpt index 4ca719266f..5db61a3b2e 100644 --- a/ext/standard/tests/file/readfile_variation8-win32-mb.phpt +++ b/ext/standard/tests/file/readfile_variation8-win32-mb.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype : int readfile(string filename [, bool use_include_path[, resource context]]) - * Description: Output a file or a URL - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing readfile() : variation ***\n"; $mainDir = "readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8"; $subDir = "readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8Sub"; @@ -86,11 +80,11 @@ The File Contents The File Contents -- %s\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8Sub\..\\\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8Sub\\..\\..\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8Sub -- -Warning: readfile(%s\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8Sub\..\\\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8Sub\\..\\..\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8Sub\fileToRead.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: readfile(%s\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8Sub\..\\\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8Sub\\..\\..\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8Sub\fileToRead.tmp): Failed to open stream: No such file or directory in %s on line %d -- %s\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8Sub\BADDIR -- -Warning: readfile(%s\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8Sub\BADDIR\fileToRead.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: readfile(%s\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8Sub\BADDIR\fileToRead.tmp): Failed to open stream: No such file or directory in %s on line %d -- readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8\readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8Sub -- The File Contents @@ -102,7 +96,7 @@ The File Contents The File Contents -- BADDIR -- -Warning: readfile(BADDIR\fileToRead.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: readfile(BADDIR\fileToRead.tmp): Failed to open stream: No such file or directory in %s on line %d -- /%s/readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8/readfileVarç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™8Sub -- The File Contents diff --git a/ext/standard/tests/file/readfile_variation8-win32.phpt b/ext/standard/tests/file/readfile_variation8-win32.phpt index c914786407..a44709b6b2 100644 --- a/ext/standard/tests/file/readfile_variation8-win32.phpt +++ b/ext/standard/tests/file/readfile_variation8-win32.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype : int readfile(string filename [, bool use_include_path[, resource context]]) - * Description: Output a file or a URL - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing readfile() : variation ***\n"; $mainDir = "readfileVar8"; $subDir = "readfileVar8Sub"; @@ -86,11 +80,11 @@ The File Contents The File Contents -- %s\readfileVar8\readfileVar8Sub\..\\\readfileVar8Sub\\..\\..\readfileVar8Sub -- -Warning: readfile(%s\readfileVar8\readfileVar8Sub\..\\\readfileVar8Sub\\..\\..\readfileVar8Sub\fileToRead.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: readfile(%s\readfileVar8\readfileVar8Sub\..\\\readfileVar8Sub\\..\\..\readfileVar8Sub\fileToRead.tmp): Failed to open stream: No such file or directory in %s on line %d -- %s\readfileVar8\readfileVar8Sub\BADDIR -- -Warning: readfile(%s\readfileVar8\readfileVar8Sub\BADDIR\fileToRead.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: readfile(%s\readfileVar8\readfileVar8Sub\BADDIR\fileToRead.tmp): Failed to open stream: No such file or directory in %s on line %d -- readfileVar8\readfileVar8Sub -- The File Contents @@ -102,7 +96,7 @@ The File Contents The File Contents -- BADDIR -- -Warning: readfile(BADDIR\fileToRead.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: readfile(BADDIR\fileToRead.tmp): Failed to open stream: No such file or directory in %s on line %d -- /%s/readfileVar8/readfileVar8Sub -- The File Contents diff --git a/ext/standard/tests/file/readfile_variation9.phpt b/ext/standard/tests/file/readfile_variation9.phpt index 1d536e61f1..a09846587a 100644 --- a/ext/standard/tests/file/readfile_variation9.phpt +++ b/ext/standard/tests/file/readfile_variation9.phpt @@ -4,12 +4,6 @@ Test readfile() function : variation - variable types of path Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : int readfile(string filename [, bool use_include_path[, resource context]]) - * Description: Output a file or a URL - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing readfile() : variation ***\n"; $mainDir = "readfileVar8"; $subDir = "readfileVar8Sub"; @@ -78,11 +72,11 @@ The File Contents The File Contents -- Iteration 5 -- -Warning: readfile(%sreadfileVar8Sub/..///readfileVar8Sub//..//../readfileVar8Sub/fileToRead.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: readfile(%sreadfileVar8Sub/..///readfileVar8Sub//..//../readfileVar8Sub/fileToRead.tmp): Failed to open stream: No such file or directory in %s on line %d -- Iteration 6 -- -Warning: readfile(%sreadfileVar8Sub/BADDIR/fileToRead.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: readfile(%sreadfileVar8Sub/BADDIR/fileToRead.tmp): Failed to open stream: No such file or directory in %s on line %d -- Iteration 7 -- The File Contents @@ -94,6 +88,6 @@ The File Contents The File Contents -- Iteration 11 -- -Warning: readfile(BADDIR/fileToRead.tmp): failed to open stream: No such file or directory in %s on line %d +Warning: readfile(BADDIR/fileToRead.tmp): Failed to open stream: No such file or directory in %s on line %d *** Done *** diff --git a/ext/standard/tests/file/readlink_realpath_basic1.phpt b/ext/standard/tests/file/readlink_realpath_basic1.phpt index 867aef1eb5..5adcbfbefd 100644 --- a/ext/standard/tests/file/readlink_realpath_basic1.phpt +++ b/ext/standard/tests/file/readlink_realpath_basic1.phpt @@ -9,13 +9,6 @@ if (PHP_OS_FAMILY === 'Windows') { ?> --FILE-- <?php -/* Prototype: string readlink ( string $path ); - Description: Returns the target of a symbolic link - - Prototype: string realpath ( string $path ); - Description: Returns canonicalized absolute pathname -*/ - /* creating directories, symbolic links and files */ $file_path = __DIR__; mkdir("$file_path/readlink_realpath_basic1/home/test/", 0777, true); diff --git a/ext/standard/tests/file/readlink_realpath_basic2-win32.phpt b/ext/standard/tests/file/readlink_realpath_basic2-win32.phpt index f0072eec9b..47023fc957 100644 --- a/ext/standard/tests/file/readlink_realpath_basic2-win32.phpt +++ b/ext/standard/tests/file/readlink_realpath_basic2-win32.phpt @@ -8,13 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: string readlink ( string $path ); - Description: Returns the target of a symbolic link - - Prototype: string realpath ( string $path ); - Description: Returns canonicalized absolute pathname -*/ - /* creating directories, symbolic links and files */ $file_path = __DIR__; mkdir("$file_path/readlink_realpath_basic2/home/test/", 0777, true); diff --git a/ext/standard/tests/file/readlink_realpath_basic2.phpt b/ext/standard/tests/file/readlink_realpath_basic2.phpt index 9971fd6f95..be73f43911 100644 --- a/ext/standard/tests/file/readlink_realpath_basic2.phpt +++ b/ext/standard/tests/file/readlink_realpath_basic2.phpt @@ -8,13 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype: string readlink ( string $path ); - Description: Returns the target of a symbolic link - - Prototype: string realpath ( string $path ); - Description: Returns canonicalized absolute pathname -*/ - /* creating directories, symbolic links and files */ $file_path = __DIR__; mkdir("$file_path/readlink_realpath_basic2/home/test/", 0777, true); diff --git a/ext/standard/tests/file/readlink_realpath_error-win32.phpt b/ext/standard/tests/file/readlink_realpath_error-win32.phpt index 679be4414c..c49beb2eda 100644 --- a/ext/standard/tests/file/readlink_realpath_error-win32.phpt +++ b/ext/standard/tests/file/readlink_realpath_error-win32.phpt @@ -8,17 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: string readlink ( string $path ); - Description: Returns the target of a symbolic link - - Prototype: string realpath ( string $path ); - Description: Returns canonicalized absolute pathname -*/ - -echo "*** Testing readlink(): error conditions ***\n"; -var_dump( readlink() ); // args < expected -var_dump( readlink(__FILE__, 2) ); // args > expected - echo "\n*** Testing readlink() on a non-existent link ***\n"; var_dump( readlink(__DIR__."/readlink_error.tmp") ); @@ -28,24 +17,12 @@ var_dump( readlink(__FILE__) ); echo "\n*** Testing readlink() on existing directory ***\n"; var_dump( readlink(__DIR__) ); -echo "*** Testing realpath(): error conditions ***\n"; -var_dump( realpath() ); // args < expected -var_dump( realpath(1, 2) ); // args > expected - echo "\n*** Testing realpath() on a non-existent file ***\n"; var_dump( realpath(__DIR__."/realpath_error.tmp") ); echo "Done\n"; ?> --EXPECTF-- -*** Testing readlink(): error conditions *** - -Warning: readlink() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: readlink() expects exactly 1 parameter, 2 given in %s on line %d -NULL - *** Testing readlink() on a non-existent link *** Warning: readlink(): readlink failed to read the symbolic link (%s, error %d) in %s on line %d @@ -56,13 +33,6 @@ string(%d) "%s%eext%estandard%etests%efile%ereadlink_realpath_error-win32.php" *** Testing readlink() on existing directory *** string(%d) "%s%eext%estandard%etests%efile" -*** Testing realpath(): error conditions *** - -Warning: realpath() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: realpath() expects exactly 1 parameter, 2 given in %s on line %d -NULL *** Testing realpath() on a non-existent file *** %s diff --git a/ext/standard/tests/file/readlink_realpath_error.phpt b/ext/standard/tests/file/readlink_realpath_error.phpt index 82743b7300..f595fb263d 100644 --- a/ext/standard/tests/file/readlink_realpath_error.phpt +++ b/ext/standard/tests/file/readlink_realpath_error.phpt @@ -8,17 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype: string readlink ( string $path ); - Description: Returns the target of a symbolic link - - Prototype: string realpath ( string $path ); - Description: Returns canonicalized absolute pathname -*/ - -echo "*** Testing readlink(): error conditions ***\n"; -var_dump( readlink() ); // args < expected -var_dump( readlink(__FILE__, 2) ); // args > expected - echo "\n*** Testing readlink() on a non-existent link ***\n"; var_dump( readlink(__DIR__."/readlink_error.tmp") ); @@ -28,24 +17,12 @@ var_dump( readlink(__FILE__) ); echo "\n*** Testing readlink() on existing directory ***\n"; var_dump( readlink(__DIR__) ); -echo "*** Testing realpath(): error conditions ***\n"; -var_dump( realpath() ); // args < expected -var_dump( realpath(1, 2) ); // args > expected - echo "\n*** Testing realpath() on a non-existent file ***\n"; var_dump( realpath(__DIR__."/realpath_error.tmp") ); echo "Done\n"; ?> --EXPECTF-- -*** Testing readlink(): error conditions *** - -Warning: readlink() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: readlink() expects exactly 1 parameter, 2 given in %s on line %d -NULL - *** Testing readlink() on a non-existent link *** Warning: readlink(): No such file or directory in %s on line %d @@ -60,13 +37,6 @@ bool(false) Warning: readlink(): Invalid argument in %s on line %d bool(false) -*** Testing realpath(): error conditions *** - -Warning: realpath() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: realpath() expects exactly 1 parameter, 2 given in %s on line %d -NULL *** Testing realpath() on a non-existent file *** %s diff --git a/ext/standard/tests/file/readlink_realpath_variation1-win32.phpt b/ext/standard/tests/file/readlink_realpath_variation1-win32.phpt index b46944b23d..5c7448f6a8 100644 --- a/ext/standard/tests/file/readlink_realpath_variation1-win32.phpt +++ b/ext/standard/tests/file/readlink_realpath_variation1-win32.phpt @@ -11,13 +11,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: string readlink ( string $path ); - Description: Returns the target of a symbolic link - - Prototype: string realpath ( string $path ); - Description: Returns canonicalized absolute pathname -*/ - echo "*** Testing readlink() and realpath() : usage variations ***\n"; $name_prefix = __DIR__; $filename = "$name_prefix/readlink_realpath_variation1/home/tests/link/readlink_realpath_variation1.tmp"; diff --git a/ext/standard/tests/file/readlink_realpath_variation1.phpt b/ext/standard/tests/file/readlink_realpath_variation1.phpt index 1530029daa..1ddbedcf64 100644 --- a/ext/standard/tests/file/readlink_realpath_variation1.phpt +++ b/ext/standard/tests/file/readlink_realpath_variation1.phpt @@ -8,13 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype: string readlink ( string $path ); - Description: Returns the target of a symbolic link - - Prototype: string realpath ( string $path ); - Description: Returns canonicalized absolute pathname -*/ - echo "*** Testing readlink() and realpath() : usage variations ***\n"; $name_prefix = __DIR__; $filename = "$name_prefix/readlink_realpath_variation1/home/tests/link/readlink_realpath_variation1.tmp"; diff --git a/ext/standard/tests/file/readlink_realpath_variation2-win32.phpt b/ext/standard/tests/file/readlink_realpath_variation2-win32.phpt index 7c75f09b03..aea1fd0cc0 100644 --- a/ext/standard/tests/file/readlink_realpath_variation2-win32.phpt +++ b/ext/standard/tests/file/readlink_realpath_variation2-win32.phpt @@ -11,13 +11,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: string readlink ( string $path ); - Description: Returns the target of a symbolic link - - Prototype: string realpath ( string $path ); - Description: Returns canonicalized absolute pathname -*/ - echo "*** Testing readlink() and realpath() : usage variations ***\n"; $name_prefix = __DIR__; // create temp dir diff --git a/ext/standard/tests/file/readlink_realpath_variation2.phpt b/ext/standard/tests/file/readlink_realpath_variation2.phpt index fe0d1305c6..e7d681036e 100644 --- a/ext/standard/tests/file/readlink_realpath_variation2.phpt +++ b/ext/standard/tests/file/readlink_realpath_variation2.phpt @@ -8,13 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype: string readlink ( string $path ); - Description: Returns the target of a symbolic link - - Prototype: string realpath ( string $path ); - Description: Returns canonicalized absolute pathname -*/ - echo "*** Testing readlink() and realpath() : usage variations ***\n"; $name_prefix = __DIR__; // create temp dir diff --git a/ext/standard/tests/file/readlink_realpath_variation3.phpt b/ext/standard/tests/file/readlink_realpath_variation3.phpt index b93d49e359..f256ffea42 100644 --- a/ext/standard/tests/file/readlink_realpath_variation3.phpt +++ b/ext/standard/tests/file/readlink_realpath_variation3.phpt @@ -2,13 +2,6 @@ Test readlink() and realpath() functions: usage variation - invalid args --FILE-- <?php -/* Prototype: string readlink ( string $path ); - Description: Returns the target of a symbolic link - - Prototype: string realpath ( string $path ); - Description: Returns canonicalized absolute pathname -*/ - echo "*** Testing readlink() and realpath() : usage variations ***\n"; echo "\n*** Testing readlink() and realpath() with linkname as empty string, NULL and single space ***\n"; diff --git a/ext/standard/tests/file/readlink_variation1.phpt b/ext/standard/tests/file/readlink_variation1.phpt index d641f20f26..b129de364f 100644 --- a/ext/standard/tests/file/readlink_variation1.phpt +++ b/ext/standard/tests/file/readlink_variation1.phpt @@ -6,13 +6,9 @@ Dave Kelsey <d_kelsey@uk.ibm.com> obscure_filename --FILE-- <?php -/* Prototype: string readlink ( string $path ); - Description: Returns the target of a symbolic link */ - /* Testing readlink() with invalid arguments -int, float, bool, NULL, resource */ $file_path = __DIR__; -$file_handle = fopen($file_path."/readlink_variation2.tmp", "w"); echo "*** Testing Invalid file types ***\n"; $filenames = array( @@ -22,7 +18,6 @@ $filenames = array( TRUE, FALSE, NULL, - $file_handle, /* scalars */ 1234, @@ -34,7 +29,6 @@ foreach( $filenames as $filename ) { var_dump( readlink($filename) ); clearstatcache(); } -fclose($file_handle); ?> --CLEAN-- <?php @@ -59,9 +53,6 @@ bool(false) Warning: readlink(): %s in %s on line %d bool(false) -Warning: readlink() expects parameter 1 to be a valid path, resource given in %s on line %d -NULL - Warning: readlink(): %s in %s on line %d bool(false) diff --git a/ext/standard/tests/file/realpath_basic-win32-mb.phpt b/ext/standard/tests/file/realpath_basic-win32-mb.phpt index e56d213631..4011f35fed 100644 --- a/ext/standard/tests/file/realpath_basic-win32-mb.phpt +++ b/ext/standard/tests/file/realpath_basic-win32-mb.phpt @@ -8,10 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: string realpath ( string $path ); - Description: Returns canonicalized absolute pathname -*/ - echo "\n*** Testing basic functions of realpath() with files ***\n"; /* creating directories and files */ diff --git a/ext/standard/tests/file/realpath_basic-win32.phpt b/ext/standard/tests/file/realpath_basic-win32.phpt index e8020d199e..f2242c827d 100644 --- a/ext/standard/tests/file/realpath_basic-win32.phpt +++ b/ext/standard/tests/file/realpath_basic-win32.phpt @@ -8,10 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: string realpath ( string $path ); - Description: Returns canonicalized absolute pathname -*/ - echo "\n*** Testing basic functions of realpath() with files ***\n"; /* creating directories and files */ diff --git a/ext/standard/tests/file/realpath_basic3.phpt b/ext/standard/tests/file/realpath_basic3.phpt index 622c1d6cce..33073ae5bf 100644 --- a/ext/standard/tests/file/realpath_basic3.phpt +++ b/ext/standard/tests/file/realpath_basic3.phpt @@ -2,10 +2,6 @@ Test realpath() with relative paths --FILE-- <?php -/* Prototype: string realpath ( string $path ); - Description: Returns canonicalized absolute pathname -*/ - echo "\n*** Testing basic functions of realpath() with files ***\n"; /* creating directories and files */ diff --git a/ext/standard/tests/file/realpath_error-win32.phpt b/ext/standard/tests/file/realpath_error-win32.phpt deleted file mode 100644 index 2fd221e45a..0000000000 --- a/ext/standard/tests/file/realpath_error-win32.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test realpath() function: error conditions ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die('skip only on Windows'); -} -?> ---FILE-- -<?php -/* Prototype: string realpath ( string $path ); - Description: Returns canonicalized absolute pathname -*/ - -echo "*** Testing realpath() for error conditions ***\n"; -var_dump( realpath() ); // args < expected -var_dump( realpath(1, 2) ); // args > expected - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing realpath() for error conditions *** - -Warning: realpath() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: realpath() expects exactly 1 parameter, 2 given in %s on line %d -NULL -Done diff --git a/ext/standard/tests/file/realpath_variation-win32-mb.phpt b/ext/standard/tests/file/realpath_variation-win32-mb.phpt index f0b79a0fd3..a3539f6106 100644 --- a/ext/standard/tests/file/realpath_variation-win32-mb.phpt +++ b/ext/standard/tests/file/realpath_variation-win32-mb.phpt @@ -8,10 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: string realpath ( string $path ); - Description: Returns canonicalized absolute pathname -*/ - require __DIR__.'/file.inc'; echo "*** Testing realpath(): usage variations ***\n"; diff --git a/ext/standard/tests/file/realpath_variation-win32.phpt b/ext/standard/tests/file/realpath_variation-win32.phpt index a685beb20b..9f46c62e7c 100644 --- a/ext/standard/tests/file/realpath_variation-win32.phpt +++ b/ext/standard/tests/file/realpath_variation-win32.phpt @@ -8,10 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: string realpath ( string $path ); - Description: Returns canonicalized absolute pathname -*/ - require __DIR__.'/file.inc'; echo "*** Testing realpath(): usage variations ***\n"; diff --git a/ext/standard/tests/file/realpath_variation2.phpt b/ext/standard/tests/file/realpath_variation2.phpt index 9b0393a5f8..6eb485785b 100644 --- a/ext/standard/tests/file/realpath_variation2.phpt +++ b/ext/standard/tests/file/realpath_variation2.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) == 'WIN' ) ?> --FILE-- <?php -/* Prototype : string realpath(string path) - * Description: Return the resolved path - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing realpath() : variation ***\n"; $paths = array('c:\\', @@ -35,7 +29,6 @@ foreach($paths as $path) { }; ?> -===DONE=== --EXPECTF-- *** Testing realpath() : variation *** @@ -71,4 +64,3 @@ bool(false) --\tmp\-- bool(false) -===DONE=== diff --git a/ext/standard/tests/file/rename_basic.phpt b/ext/standard/tests/file/rename_basic.phpt index 49de9ac042..0dd29a3607 100644 --- a/ext/standard/tests/file/rename_basic.phpt +++ b/ext/standard/tests/file/rename_basic.phpt @@ -2,10 +2,6 @@ Test rename() function: basic functionality --FILE-- <?php -/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] ); - Description: Renames a file or directory -*/ - echo "*** Testing rename() on non-existing file ***\n"; $file_path = __DIR__; require "$file_path/file.inc"; @@ -31,7 +27,6 @@ $keys_to_compare = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, var_dump( compare_stats($old_stat, $new_stat, $keys_to_compare) ); ?> -===Done=== --CLEAN-- <?php unlink(__DIR__."/rename_basic_new.tmp"); @@ -42,4 +37,3 @@ bool(true) bool(false) bool(true) bool(true) -===Done=== diff --git a/ext/standard/tests/file/rename_variation-win32.phpt b/ext/standard/tests/file/rename_variation-win32.phpt index 9b194c689c..76f337fe1f 100644 --- a/ext/standard/tests/file/rename_variation-win32.phpt +++ b/ext/standard/tests/file/rename_variation-win32.phpt @@ -8,10 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] ); - Description: Renames a file or directory -*/ - require __DIR__.'/file.inc'; /* create directory */ diff --git a/ext/standard/tests/file/rename_variation1-win32.phpt b/ext/standard/tests/file/rename_variation1-win32.phpt index c07aa3f6c1..1888838635 100644 --- a/ext/standard/tests/file/rename_variation1-win32.phpt +++ b/ext/standard/tests/file/rename_variation1-win32.phpt @@ -8,10 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] ); - Description: Renames a file or directory -*/ - require __DIR__.'/file.inc'; /* creating directory */ diff --git a/ext/standard/tests/file/rename_variation11-win32.phpt b/ext/standard/tests/file/rename_variation11-win32.phpt index fbf358f79b..39d60272bd 100644 --- a/ext/standard/tests/file/rename_variation11-win32.phpt +++ b/ext/standard/tests/file/rename_variation11-win32.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype : bool rename(string old_name, string new_name[, resource context]) - * Description: Rename a file - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing rename() with absolute and relative paths ***\n"; $mainDir = "renameVar11"; $subDir = "renameVar11Sub"; diff --git a/ext/standard/tests/file/rename_variation12-win32.phpt b/ext/standard/tests/file/rename_variation12-win32.phpt index 2c5b4a0ea8..781ea7726e 100644 --- a/ext/standard/tests/file/rename_variation12-win32.phpt +++ b/ext/standard/tests/file/rename_variation12-win32.phpt @@ -8,12 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') die('skip.. for Windows'); ?> --FILE-- <?php -/* Prototype : bool rename(string old_name, string new_name[, resource context]) - * Description: Rename a file - * Source code: ext/standard/file.c - * Alias to functions: - */ - /* Creating unique files in various dirs by passing relative paths to $dir arg */ echo "*** Testing rename() with absolute and relative paths ***\n"; diff --git a/ext/standard/tests/file/rename_variation12.phpt b/ext/standard/tests/file/rename_variation12.phpt index e2193a4fb9..b38aab7ed1 100644 --- a/ext/standard/tests/file/rename_variation12.phpt +++ b/ext/standard/tests/file/rename_variation12.phpt @@ -8,12 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') die('skip.. not for Windows'); ?> --FILE-- <?php -/* Prototype : bool rename(string old_name, string new_name[, resource context]) - * Description: Rename a file - * Source code: ext/standard/file.c - * Alias to functions: - */ - /* Creating unique files in various dirs by passing relative paths to $dir arg */ echo "*** Testing rename() with absolute and relative paths ***\n"; diff --git a/ext/standard/tests/file/rename_variation13-win32.phpt b/ext/standard/tests/file/rename_variation13-win32.phpt Binary files differindex 965a0dac25..4821fa7951 100644 --- a/ext/standard/tests/file/rename_variation13-win32.phpt +++ b/ext/standard/tests/file/rename_variation13-win32.phpt diff --git a/ext/standard/tests/file/rename_variation13.phpt b/ext/standard/tests/file/rename_variation13.phpt index 70ec37c7a6..83de25cd84 100644 --- a/ext/standard/tests/file/rename_variation13.phpt +++ b/ext/standard/tests/file/rename_variation13.phpt @@ -11,12 +11,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") obscure_filename --FILE-- <?php -/* Prototype : bool rename(string old_name, string new_name[, resource context]) - * Description: Rename a file - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing rename() with obscure files ***\n"; $file_path = __DIR__."/renameVar13"; $aFile = $file_path.'/afile.tmp'; @@ -32,8 +26,6 @@ $names_arr = array( NULL, "", " ", - "\0", - array(), /* prefix with path separator of a non existing directory*/ "/no/such/file/dir", @@ -98,24 +90,6 @@ bool(true) Warning: rename( ,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d bool(false) --- testing '%s' -- - -Warning: rename() %s in %s on line %d -bool(false) - -Warning: file_exists() expects parameter 1 to be a valid path, string given in %s on line %d - -Warning: rename() expects parameter 1 to be a valid path, string given in %s on line %d -bool(false) --- testing 'Array' -- - -Warning: rename() expects parameter 2 to be a valid path, array given in %s on line %d -bool(false) - -Warning: file_exists() expects parameter 1 to be a valid path, array given in %s on line %d - -Warning: rename() expects parameter 1 to be a valid path, array given in %s on line %d -bool(false) -- testing '/no/such/file/dir' -- Warning: rename(%s/renameVar13/afile.tmp,/no/such/file/dir): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/rename_variation2-win32.phpt b/ext/standard/tests/file/rename_variation2-win32.phpt index 86b5f71837..9a5d56e48b 100644 --- a/ext/standard/tests/file/rename_variation2-win32.phpt +++ b/ext/standard/tests/file/rename_variation2-win32.phpt @@ -8,10 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] ); - Description: Renames a file or directory -*/ - require __DIR__.'/file.inc'; $file_path = __DIR__; diff --git a/ext/standard/tests/file/rename_variation3-win32.phpt b/ext/standard/tests/file/rename_variation3-win32.phpt index b14b814295..cd36b3665e 100644 --- a/ext/standard/tests/file/rename_variation3-win32.phpt +++ b/ext/standard/tests/file/rename_variation3-win32.phpt @@ -8,10 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] ); - Description: Renames a file or directory -*/ - require __DIR__.'/file.inc'; /* creating directory */ @@ -25,7 +21,7 @@ mkdir($dirname); $filename = "$file_path/rename_variation3.tmp"; $fp = fopen($filename, "w"); if (!$fp) { - die("Cannot create $filename\n"); + die("Cannot create $filename\n"); } fclose($fp); diff --git a/ext/standard/tests/file/rename_variation7-win32.phpt b/ext/standard/tests/file/rename_variation7-win32.phpt index fb7c805cbf..bf879ce7d9 100644 --- a/ext/standard/tests/file/rename_variation7-win32.phpt +++ b/ext/standard/tests/file/rename_variation7-win32.phpt @@ -12,7 +12,7 @@ $tmp_link = __FILE__.".tmp.link"; $tmp_link2 = __FILE__.".tmp.link2"; if (symlink(__DIR__."/there_is_no_such_file", $tmp_link)) { - rename($tmp_link, $tmp_link2); + rename($tmp_link, $tmp_link2); } clearstatcache(); diff --git a/ext/standard/tests/file/rename_variation8-win32.phpt b/ext/standard/tests/file/rename_variation8-win32.phpt index df0fd55bb7..5e4bd68576 100644 --- a/ext/standard/tests/file/rename_variation8-win32.phpt +++ b/ext/standard/tests/file/rename_variation8-win32.phpt @@ -6,10 +6,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') die('skip.. for Windows'); ?> --FILE-- <?php -/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] ); - Description: Renames a file or directory -*/ - echo "\n*** Testing rename() on non-existing file ***\n"; $file_path = __DIR__; diff --git a/ext/standard/tests/file/rename_variation8.phpt b/ext/standard/tests/file/rename_variation8.phpt index 660925b61f..8b958666c2 100644 --- a/ext/standard/tests/file/rename_variation8.phpt +++ b/ext/standard/tests/file/rename_variation8.phpt @@ -6,10 +6,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') die('skip.. not for Windows'); ?> --FILE-- <?php -/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] ); - Description: Renames a file or directory -*/ - echo "\n*** Testing rename() on non-existing file ***\n"; $file_path = __DIR__; diff --git a/ext/standard/tests/file/rename_variation9.phpt b/ext/standard/tests/file/rename_variation9.phpt index c90345be4e..21deef08a8 100644 --- a/ext/standard/tests/file/rename_variation9.phpt +++ b/ext/standard/tests/file/rename_variation9.phpt @@ -2,10 +2,6 @@ Test rename() function: basic functionality --FILE-- <?php -/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] ); - Description: Renames a file or directory -*/ - echo "\n*** Testing rename() by giving stream context as third argument ***\n"; $file_path = __DIR__; diff --git a/ext/standard/tests/file/rmdir_variation3-win32.phpt b/ext/standard/tests/file/rmdir_variation3-win32.phpt index ac8c9dd368..7a478b8a5c 100644 --- a/ext/standard/tests/file/rmdir_variation3-win32.phpt +++ b/ext/standard/tests/file/rmdir_variation3-win32.phpt @@ -9,12 +9,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype : bool rmdir(string dirname[, resource context]) - * Description: Remove a directory - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing rmdir() : variation ***\n"; $workDir = "rmdirVar3.tmp"; @@ -71,7 +65,6 @@ foreach($dirs as $dir) { rmdir($workDir); ?> -===DONE=== --EXPECTF-- *** Testing rmdir() : variation *** -- removing rmdirVar3.tmp\aSubDir -- @@ -105,4 +98,3 @@ Directory removed Directory removed -- removing /%s/rmdirVar3.tmp/aSubDir -- Directory removed -===DONE=== diff --git a/ext/standard/tests/file/rmdir_variation3.phpt b/ext/standard/tests/file/rmdir_variation3.phpt index 095cde0880..efd66c8bdf 100644 --- a/ext/standard/tests/file/rmdir_variation3.phpt +++ b/ext/standard/tests/file/rmdir_variation3.phpt @@ -4,12 +4,6 @@ Test rmdir() function : variation: various valid and invalid paths Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : bool rmdir(string dirname[, resource context]) - * Description: Remove a directory - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing rmdir() : variation ***\n"; $workDir = "rmdirVar3.tmp"; @@ -61,7 +55,6 @@ foreach($dirs as $dir) { rmdir($workDir); ?> -===DONE=== --EXPECTF-- *** Testing rmdir() : variation *** -- removing rmdirVar3.tmp/aSubDir -- @@ -93,4 +86,3 @@ Directory removed Directory removed -- removing %s//rmdirVar3.tmp//aSubDir -- Directory removed -===DONE=== diff --git a/ext/standard/tests/file/stat_basic-win32-mb.phpt b/ext/standard/tests/file/stat_basic-win32-mb.phpt index 504e0f45ea..4fd43bdbba 100644 --- a/ext/standard/tests/file/stat_basic-win32-mb.phpt +++ b/ext/standard/tests/file/stat_basic-win32-mb.phpt @@ -8,11 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - $file_path = __DIR__; require("$file_path/file.inc"); @@ -26,7 +21,7 @@ mkdir($dirname); // stat of the dir created $dir_stat = stat($dirname); clearstatcache(); -sleep(2); +sleep(1); // creating file $filename = "$dirname/stat_basic_ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.tmp"; @@ -34,7 +29,7 @@ $file_handle = fopen($filename, "w"); fclose($file_handle); // stat of the file created $file_stat = stat($filename); -sleep(2); +sleep(1); // now new stat of the dir after file is created $new_dir_stat = stat($dirname); diff --git a/ext/standard/tests/file/stat_basic-win32.phpt b/ext/standard/tests/file/stat_basic-win32.phpt index 348ac2d380..c5a0125fb3 100644 --- a/ext/standard/tests/file/stat_basic-win32.phpt +++ b/ext/standard/tests/file/stat_basic-win32.phpt @@ -8,11 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - $file_path = __DIR__; require("$file_path/file.inc"); @@ -34,7 +29,7 @@ $file_handle = fopen($filename, "w"); fclose($file_handle); // stat of the file created $file_stat = stat($filename); -sleep(2); +sleep(1); // now new stat of the dir after file is created $new_dir_stat = stat($dirname); diff --git a/ext/standard/tests/file/stat_error-win32.phpt b/ext/standard/tests/file/stat_error-win32.phpt index 735a17cb26..e8742fc64a 100644 --- a/ext/standard/tests/file/stat_error-win32.phpt +++ b/ext/standard/tests/file/stat_error-win32.phpt @@ -8,38 +8,20 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* - Prototype: array stat ( string $filename ); - Description: Gives information about a file -*/ - $file_path = __DIR__; $arr = array(__FILE__); echo "\n*** Testing stat() for error conditions ***\n"; -var_dump( stat() ); // args < expected -var_dump( stat(__FILE__, 2) ); // file, args > expected -var_dump( stat(__DIR__, 2) ); //dir, args > expected var_dump( stat("$file_path/temp.tmp") ); // non existing file var_dump( stat("$file_path/temp/") ); // non existing dir var_dump( stat(22) ); // scalar argument -var_dump( stat($arr) ); // array argument echo "Done\n"; ?> --EXPECTF-- *** Testing stat() for error conditions *** -Warning: stat() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: stat() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: stat() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: stat(): stat failed for %s in %s on line %d bool(false) @@ -48,7 +30,4 @@ bool(false) Warning: stat(): stat failed for 22 in %s on line %d bool(false) - -Warning: stat() expects parameter 1 to be a valid path, array given in %s on line %d -NULL Done diff --git a/ext/standard/tests/file/stat_variation1-win32-mb.phpt b/ext/standard/tests/file/stat_variation1-win32-mb.phpt index 1db467632b..616577a14f 100644 --- a/ext/standard/tests/file/stat_variation1-win32-mb.phpt +++ b/ext/standard/tests/file/stat_variation1-win32-mb.phpt @@ -9,11 +9,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { --FILE-- <?php -/* - * Prototype: array stat ( string $filename ); - * Description: Gives information about a file - */ - /* test the effects of rename() on stats of dir/file */ $file_path = __DIR__; @@ -35,7 +30,7 @@ $old_filename = "$file_path/stat_variation1_ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™ $new_filename = "$file_path/stat_variation1a_ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.tmp"; $old_stat = stat($old_filename); clearstatcache(); -sleep(2); +sleep(1); var_dump( rename($old_filename, $new_filename) ); $new_stat = stat($new_filename); diff --git a/ext/standard/tests/file/stat_variation1-win32.phpt b/ext/standard/tests/file/stat_variation1-win32.phpt index 26b1549e02..12d2b4aa95 100644 --- a/ext/standard/tests/file/stat_variation1-win32.phpt +++ b/ext/standard/tests/file/stat_variation1-win32.phpt @@ -9,11 +9,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { --FILE-- <?php -/* - * Prototype: array stat ( string $filename ); - * Description: Gives information about a file - */ - /* test the effects of rename() on stats of dir/file */ $file_path = __DIR__; @@ -35,7 +30,7 @@ $old_filename = "$file_path/stat_variation1.tmp"; $new_filename = "$file_path/stat_variation1a.tmp"; $old_stat = stat($old_filename); clearstatcache(); -sleep(2); +sleep(1); var_dump( rename($old_filename, $new_filename) ); $new_stat = stat($new_filename); diff --git a/ext/standard/tests/file/stat_variation2-win32.phpt b/ext/standard/tests/file/stat_variation2-win32.phpt index 2d4f44bf02..87830458b6 100644 --- a/ext/standard/tests/file/stat_variation2-win32.phpt +++ b/ext/standard/tests/file/stat_variation2-win32.phpt @@ -9,11 +9,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { --FILE-- <?php -/* - * Prototype: array stat ( string $filename ); - * Description: Gives information about a file - */ - /* test the effects of writing to a file on the stats of the file */ @@ -32,7 +27,7 @@ echo "*** Testing stat(): writing to a file ***\n"; echo "-- Testing stat() on file after data is written in it --\n"; $old_stat = stat($filename); clearstatcache(); -sleep(2); +sleep(1); $file_handle = fopen($filename, "w"); // temp file fwrite($file_handle, "Hello World"); fclose($file_handle); diff --git a/ext/standard/tests/file/stat_variation3-win32.phpt b/ext/standard/tests/file/stat_variation3-win32.phpt index d08612fc7f..fb1da16d5b 100644 --- a/ext/standard/tests/file/stat_variation3-win32.phpt +++ b/ext/standard/tests/file/stat_variation3-win32.phpt @@ -9,11 +9,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { --FILE-- <?php -/* - * Prototype: array stat ( string $filename ); - * Description: Gives information about a file - */ - /* test the effects of creating & deleting of subdir/file on the stats of dir/file */ $file_path = __DIR__; @@ -30,7 +25,7 @@ echo "-- Testing stat() on dir after subdir and file is created in it --\n"; $dirname = "$file_path/stat_variation3"; $old_stat = stat($dirname); clearstatcache(); -sleep(2); +sleep(1); mkdir("$dirname/stat_variation3_subdir"); $file_handle = fopen("$dirname/stat_variation3a.tmp", "w"); fclose($file_handle); diff --git a/ext/standard/tests/file/stat_variation4-win32.phpt b/ext/standard/tests/file/stat_variation4-win32.phpt index a5e25f99d0..bcf61439d8 100644 --- a/ext/standard/tests/file/stat_variation4-win32.phpt +++ b/ext/standard/tests/file/stat_variation4-win32.phpt @@ -9,11 +9,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { --FILE-- <?php -/* - * Prototype: array stat ( string $filename ); - * Description: Gives information about a file - */ - /* test the effects on the stats of dir/file for using is_dir() & is_file() on dir/file */ $file_path = __DIR__; @@ -36,7 +31,7 @@ $old_dirname = "$file_path/stat_variation4"; $old_stat = stat($old_dirname); // clear the cache clearstatcache(); -sleep(2); +sleep(1); var_dump( is_dir($old_dirname) ); $new_stat = stat($old_dirname); diff --git a/ext/standard/tests/file/stat_variation5-win32.phpt b/ext/standard/tests/file/stat_variation5-win32.phpt index d2c9fd4c84..ab65523df8 100644 --- a/ext/standard/tests/file/stat_variation5-win32.phpt +++ b/ext/standard/tests/file/stat_variation5-win32.phpt @@ -9,11 +9,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { --FILE-- <?php -/* - * Prototype: array stat ( string $filename ); - * Description: Gives information about a file - */ - /* test the stats of file opened in write mode and then same in read mode */ $file_path = __DIR__; @@ -32,7 +27,7 @@ fclose($file_handle); $old_stat = stat($filename); // clear the stat clearstatcache(); -sleep(2); +sleep(1); // opening file again in read mode $file_handle = fopen($filename, "r"); // read file fclose($file_handle); diff --git a/ext/standard/tests/file/stat_variation6-win32.phpt b/ext/standard/tests/file/stat_variation6-win32.phpt index 38c69f97f2..a4ffb55acf 100644 --- a/ext/standard/tests/file/stat_variation6-win32.phpt +++ b/ext/standard/tests/file/stat_variation6-win32.phpt @@ -9,11 +9,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { --FILE-- <?php -/* - * Prototype: array stat ( string $filename ); - * Description: Gives information about a file - */ - /* test the effects on the stats of dir/file for changing permissions of dir/file */ @@ -31,12 +26,13 @@ fclose($file_handle); // checking stat() on file -echo "\n*** Testing stat() on file with miscelleneous file permission and content ***\n"; +echo "\n*** Testing stat() on file with miscellaneous file permission and content ***\n"; +clearstatcache(); $old_stat = stat($filename); +sleep(1); var_dump( chmod($filename, 0777) ); // clear the stat clearstatcache(); -sleep(2); $new_stat = stat($filename); // compare self stats var_dump( compare_self_stat($old_stat) ); @@ -48,12 +44,12 @@ var_dump( compare_stats($old_stat, $new_stat, $affected_members, "==") ); clearstatcache(); // clear statement cache // checking stat() on directory -echo "\n*** Testing stat() on directory with miscelleneous file permission ***\n"; +echo "\n*** Testing stat() on directory with miscellaneous file permission ***\n"; $old_stat = stat($dirname); +sleep(1); var_dump( chmod($dirname, 0777) ); // clear the stat clearstatcache(); -sleep(2); $new_stat = stat($dirname); // compare self stats var_dump( compare_self_stat($old_stat) ); @@ -74,13 +70,13 @@ unlink("$file_path/stat_variation6.tmp"); rmdir("$file_path/stat_variation6"); ?> --EXPECT-- -*** Testing stat() on file with miscelleneous file permission and content *** +*** Testing stat() on file with miscellaneous file permission and content *** bool(true) bool(true) bool(true) bool(true) -*** Testing stat() on directory with miscelleneous file permission *** +*** Testing stat() on directory with miscellaneous file permission *** bool(true) bool(true) bool(true) diff --git a/ext/standard/tests/file/stat_variation7-win32.phpt b/ext/standard/tests/file/stat_variation7-win32.phpt index 320db156d4..4a54304bb4 100644 --- a/ext/standard/tests/file/stat_variation7-win32.phpt +++ b/ext/standard/tests/file/stat_variation7-win32.phpt @@ -9,11 +9,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { --FILE-- <?php -/* - * Prototype: array stat ( string $filename ); - * Description: Gives information about a file - */ - /* test the stats of dir/file when their names are stored in objects */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/stat_variation8-win32.phpt b/ext/standard/tests/file/stat_variation8-win32.phpt index 7a0cf65d41..1d3573d3d1 100644 --- a/ext/standard/tests/file/stat_variation8-win32.phpt +++ b/ext/standard/tests/file/stat_variation8-win32.phpt @@ -9,11 +9,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { --FILE-- <?php -/* - * Prototype: array stat ( string $filename ); - * Description: Gives information about a file - */ - /* test the effects of truncate() on stats of file */ @@ -37,7 +32,7 @@ fclose($file_handle); clearstatcache(true, $filename); $old_stat = stat($filename); // clear the cache -sleep(2); +sleep(1); // opening file in r/w mode $file_handle = fopen($filename, "r+"); diff --git a/ext/standard/tests/file/stream_001.phpt b/ext/standard/tests/file/stream_001.phpt index 6e692c554a..6a203c6772 100644 --- a/ext/standard/tests/file/stream_001.phpt +++ b/ext/standard/tests/file/stream_001.phpt @@ -17,7 +17,7 @@ Warning: fopen(): Unable to find the wrapper "file" - did you forget to enable i Warning: fopen(): file:// wrapper is disabled in the server configuration in %s on line %d -Warning: fopen(file://%s): failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(file://%s): Failed to open stream: no suitable wrapper could be found in %s on line %d bool(false) bool(true) resource(%d) of type (stream) diff --git a/ext/standard/tests/file/stream_002.phpt b/ext/standard/tests/file/stream_002.phpt index b18dd85b31..4aab2240ee 100644 --- a/ext/standard/tests/file/stream_002.phpt +++ b/ext/standard/tests/file/stream_002.phpt @@ -15,38 +15,31 @@ var_dump(stream_socket_client(".", $a, $b)); var_dump($a, $b); var_dump(stream_socket_client(1, $a, $b)); var_dump($a, $b); -var_dump(stream_socket_client(array(), $a, $b)); -var_dump($a, $b); echo "Done\n"; ?> --EXPECTF-- -Warning: stream_socket_client(): unable to connect to (Failed to parse address "") in %s on line %d +Warning: stream_socket_client(): Unable to connect to (Failed to parse address "") in %s on line %d bool(false) int(0) string(26) "Failed to parse address """ -Warning: stream_socket_client(): unable to connect to [ (Failed to parse address "[") in %s on line %d +Warning: stream_socket_client(): Unable to connect to [ (Failed to parse address "[") in %s on line %d bool(false) int(0) string(27) "Failed to parse address "["" -Warning: stream_socket_client(): unable to connect to [ (Failed to parse%saddress "[ ") in %s on line %d +Warning: stream_socket_client(): Unable to connect to [ (Failed to parse%saddress "[ ") in %s on line %d bool(false) int(0) string(%d) "Failed to parse%saddress "[ "" -Warning: stream_socket_client(): unable to connect to . (Failed to parse address ".") in %s on line %d +Warning: stream_socket_client(): Unable to connect to . (Failed to parse address ".") in %s on line %d bool(false) int(0) string(27) "Failed to parse address "."" -Warning: stream_socket_client(): unable to connect to 1 (Failed to parse address "1") in %s on line %d -bool(false) -int(0) -string(27) "Failed to parse address "1"" - -Warning: stream_socket_client() expects parameter 1 to be string, array given in %s on line %d +Warning: stream_socket_client(): Unable to connect to 1 (Failed to parse address "1") in %s on line %d bool(false) int(0) string(27) "Failed to parse address "1"" diff --git a/ext/standard/tests/file/stream_get_line.phpt b/ext/standard/tests/file/stream_get_line.phpt index 9421bd44c1..773efd2c88 100644 --- a/ext/standard/tests/file/stream_get_line.phpt +++ b/ext/standard/tests/file/stream_get_line.phpt @@ -7,7 +7,7 @@ $path = __DIR__ . '/test.html'; file_put_contents($path, "foo<br>bar<br>foo"); $fp = fopen($path, "r"); while ($fp && !feof($fp)) { - echo stream_get_line($fp, 0, "<br>")."\n"; + echo stream_get_line($fp, 0, "<br>")."\n"; } fclose($fp); @unlink($path); diff --git a/ext/standard/tests/file/stream_rfc2397_001.phpt b/ext/standard/tests/file/stream_rfc2397_001.phpt index d88e778623..3036620eb5 100644 --- a/ext/standard/tests/file/stream_rfc2397_001.phpt +++ b/ext/standard/tests/file/stream_rfc2397_001.phpt @@ -15,8 +15,6 @@ unset($data); var_dump(stream_get_contents($file)); ?> -===DONE=== --EXPECT-- string(11) "hello world" string(11) "hello world" -===DONE=== diff --git a/ext/standard/tests/file/stream_rfc2397_002.phpt b/ext/standard/tests/file/stream_rfc2397_002.phpt index 1dce5adf6c..d145456fdb 100644 --- a/ext/standard/tests/file/stream_rfc2397_002.phpt +++ b/ext/standard/tests/file/stream_rfc2397_002.phpt @@ -6,32 +6,32 @@ allow_url_fopen=1 <?php $streams = array( - 'data://,', - 'data://', - 'data://;base64,', - 'data://;base64', - 'data://foo,', - 'data://foo=bar,', - 'data://text/plain,', - 'data://text/plain;foo,', - 'data://text/plain;foo=bar,', - 'data://text/plain;foo=bar;bla,', - 'data://text/plain;foo=bar;base64,', - 'data://text/plain;foo=bar;bar=baz', - 'data://text/plain;foo=bar;bar=baz,', - ); + 'data://,', + 'data://', + 'data://;base64,', + 'data://;base64', + 'data://foo,', + 'data://foo=bar,', + 'data://text/plain,', + 'data://text/plain;foo,', + 'data://text/plain;foo=bar,', + 'data://text/plain;foo=bar;bla,', + 'data://text/plain;foo=bar;base64,', + 'data://text/plain;foo=bar;bar=baz', + 'data://text/plain;foo=bar;bar=baz,', + ); foreach($streams as $stream) { - $stream = fopen($stream, 'r'); - $meta = @stream_get_meta_data($stream); - var_dump($meta); - var_dump(isset($meta['foo']) ? $meta['foo'] : null); + $stream = fopen($stream, 'r'); + if ($stream) { + $meta = stream_get_meta_data($stream); + var_dump($meta); + var_dump(isset($meta['foo']) ? $meta['foo'] : null); + } } ?> -===DONE=== -<?php exit(0); ?> --EXPECTF-- array(7) { ["base64"]=> @@ -51,9 +51,7 @@ array(7) { } NULL -Warning: fopen(data://): failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d -NULL -NULL +Warning: fopen(data://): Failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d array(7) { ["base64"]=> bool(true) @@ -72,17 +70,11 @@ array(7) { } NULL -Warning: fopen(data://;base64): failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d -NULL -NULL +Warning: fopen(data://;base64): Failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d -Warning: fopen(data://foo,): failed to open stream: rfc2397: illegal media type in %sstream_rfc2397_002.php on line %d -NULL -NULL +Warning: fopen(data://foo,): Failed to open stream: rfc2397: illegal media type in %sstream_rfc2397_002.php on line %d -Warning: fopen(data://foo=bar,): failed to open stream: rfc2397: illegal media type in %sstream_rfc2397_002.php on line %d -NULL -NULL +Warning: fopen(data://foo=bar,): Failed to open stream: rfc2397: illegal media type in %sstream_rfc2397_002.php on line %d array(8) { ["mediatype"]=> string(10) "text/plain" @@ -103,9 +95,7 @@ array(8) { } NULL -Warning: fopen(data://text/plain;foo,): failed to open stream: rfc2397: illegal parameter in %sstream_rfc2397_002.php on line %d -NULL -NULL +Warning: fopen(data://text/plain;foo,): Failed to open stream: rfc2397: illegal parameter in %sstream_rfc2397_002.php on line %d array(9) { ["mediatype"]=> string(10) "text/plain" @@ -128,9 +118,7 @@ array(9) { } string(3) "bar" -Warning: fopen(data://text/plain;foo=bar;bla,): failed to open stream: rfc2397: illegal parameter in %sstream_rfc2397_002.php on line %d -NULL -NULL +Warning: fopen(data://text/plain;foo=bar;bla,): Failed to open stream: rfc2397: illegal parameter in %sstream_rfc2397_002.php on line %d array(9) { ["mediatype"]=> string(10) "text/plain" @@ -153,9 +141,7 @@ array(9) { } string(3) "bar" -Warning: fopen(data://text/plain;foo=bar;bar=baz): failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d -NULL -NULL +Warning: fopen(data://text/plain;foo=bar;bar=baz): Failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d array(10) { ["mediatype"]=> string(10) "text/plain" @@ -179,4 +165,3 @@ array(10) { string(34) "data://text/plain;foo=bar;bar=baz," } string(3) "bar" -===DONE=== diff --git a/ext/standard/tests/file/stream_rfc2397_003.phpt b/ext/standard/tests/file/stream_rfc2397_003.phpt index 291b1301c5..a1437a04bb 100644 --- a/ext/standard/tests/file/stream_rfc2397_003.phpt +++ b/ext/standard/tests/file/stream_rfc2397_003.phpt @@ -6,33 +6,30 @@ allow_url_fopen=1 <?php $streams = array( - 'data://,A%20brief%20note', - 'data://application/vnd-xxx-query,select_vcount,fcol_from_fieldtable/local', - 'data://;base64,Zm9vYmFyIGZvb2Jhcg==', - 'stream_rfc2397_003.gif' => 'data://image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw + 'data://,A%20brief%20note', + 'data://application/vnd-xxx-query,select_vcount,fcol_from_fieldtable/local', + 'data://;base64,Zm9vYmFyIGZvb2Jhcg==', + 'stream_rfc2397_003.gif' => 'data://image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw AAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFz ByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSp a/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJl ZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uis F81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PH hhx4dbgYKAAA7', - ); + ); foreach($streams as $original => $stream) { - if (is_string($original)) { - var_dump(file_get_contents(__DIR__ . '/' . $original) == file_get_contents($stream)); - } else { - var_dump(file_get_contents($stream)); - } + if (is_string($original)) { + var_dump(file_get_contents(__DIR__ . '/' . $original) == file_get_contents($stream)); + } else { + var_dump(file_get_contents($stream)); + } } ?> -===DONE=== -<?php exit(0); ?> --EXPECT-- string(12) "A brief note" string(40) "select_vcount,fcol_from_fieldtable/local" string(13) "foobar foobar" bool(true) -===DONE=== diff --git a/ext/standard/tests/file/stream_rfc2397_004.phpt b/ext/standard/tests/file/stream_rfc2397_004.phpt index 4c13a5f9cd..cb7012f650 100644 --- a/ext/standard/tests/file/stream_rfc2397_004.phpt +++ b/ext/standard/tests/file/stream_rfc2397_004.phpt @@ -6,22 +6,20 @@ allow_url_fopen=1 <?php $streams = array( - 'data://,;test', - 'data://text/plain,test', - 'data://text/plain;charset=US-ASCII,test', - 'data://;charset=UTF-8,Hello', - 'data://text/plain;charset=UTF-8,Hello', - 'data://,a,b', - ); + 'data://,;test', + 'data://text/plain,test', + 'data://text/plain;charset=US-ASCII,test', + 'data://;charset=UTF-8,Hello', + 'data://text/plain;charset=UTF-8,Hello', + 'data://,a,b', + ); foreach($streams as $stream) { - var_dump(@file_get_contents($stream)); + var_dump(@file_get_contents($stream)); } ?> -===DONE=== -<?php exit(0); ?> --EXPECT-- string(5) ";test" string(4) "test" @@ -29,4 +27,3 @@ string(4) "test" bool(false) string(5) "Hello" string(3) "a,b" -===DONE=== diff --git a/ext/standard/tests/file/stream_rfc2397_005.phpt b/ext/standard/tests/file/stream_rfc2397_005.phpt index ab03f399f3..38c0f4b77e 100644 --- a/ext/standard/tests/file/stream_rfc2397_005.phpt +++ b/ext/standard/tests/file/stream_rfc2397_005.phpt @@ -6,25 +6,23 @@ allow_url_fopen=1 <?php $streams = array( - 'data:,A%20brief%20note', - 'data:application/vnd-xxx-query,select_vcount,fcol_from_fieldtable/local', - 'data:;base64,Zm9vYmFyIGZvb2Jhcg==', - 'data:,;test', - 'data:text/plain,test', - 'data:text/plain;charset=US-ASCII,test', - 'data:;charset=UTF-8,Hello', - 'data:text/plain;charset=UTF-8,Hello', - 'data:,a,b', - ); + 'data:,A%20brief%20note', + 'data:application/vnd-xxx-query,select_vcount,fcol_from_fieldtable/local', + 'data:;base64,Zm9vYmFyIGZvb2Jhcg==', + 'data:,;test', + 'data:text/plain,test', + 'data:text/plain;charset=US-ASCII,test', + 'data:;charset=UTF-8,Hello', + 'data:text/plain;charset=UTF-8,Hello', + 'data:,a,b', + ); foreach($streams as $stream) { - var_dump(@file_get_contents($stream)); + var_dump(@file_get_contents($stream)); } ?> -===DONE=== -<?php exit(0); ?> --EXPECT-- string(12) "A brief note" string(40) "select_vcount,fcol_from_fieldtable/local" @@ -35,4 +33,3 @@ string(4) "test" bool(false) string(5) "Hello" string(3) "a,b" -===DONE=== diff --git a/ext/standard/tests/file/stream_rfc2397_006.phpt b/ext/standard/tests/file/stream_rfc2397_006.phpt index f6616a0c88..7805db41de 100644 --- a/ext/standard/tests/file/stream_rfc2397_006.phpt +++ b/ext/standard/tests/file/stream_rfc2397_006.phpt @@ -6,30 +6,28 @@ allow_url_fopen=1 <?php $streams = array( - "data:;base64,\0Zm9vYmFyIGZvb2Jhcg==", - "data:;base64,Zm9vYmFy\0IGZvb2Jhcg==", - 'data:;base64,#Zm9vYmFyIGZvb2Jhcg==', - 'data:;base64,#Zm9vYmFyIGZvb2Jhc=', - ); + "data:;base64,\0Zm9vYmFyIGZvb2Jhcg==", + "data:;base64,Zm9vYmFy\0IGZvb2Jhcg==", + 'data:;base64,#Zm9vYmFyIGZvb2Jhcg==', + 'data:;base64,#Zm9vYmFyIGZvb2Jhc=', + ); foreach($streams as $stream) { - var_dump(file_get_contents($stream)); + try { + var_dump(file_get_contents($stream)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } ?> -===DONE=== -<?php exit(0); ?> --EXPECTF-- -Warning: file_get_contents() expects parameter 1 to be a valid path, string given in %s line %d -NULL +file_get_contents(): Argument #1 ($filename) must be a valid path, string given +file_get_contents(): Argument #1 ($filename) must be a valid path, string given -Warning: file_get_contents() expects parameter 1 to be a valid path, string given in %s line %d -NULL - -Warning: file_get_contents(data:;base64,#Zm9vYmFyIGZvb2Jhcg==): failed to open stream: rfc2397: unable to decode in %sstream_rfc2397_006.php on line %d +Warning: file_get_contents(data:;base64,#Zm9vYmFyIGZvb2Jhcg==): Failed to open stream: rfc2397: unable to decode in %sstream_rfc2397_006.php on line %d bool(false) -Warning: file_get_contents(data:;base64,#Zm9vYmFyIGZvb2Jhc=): failed to open stream: rfc2397: unable to decode in %sstream_rfc2397_006.php on line %d +Warning: file_get_contents(data:;base64,#Zm9vYmFyIGZvb2Jhc=): Failed to open stream: rfc2397: unable to decode in %sstream_rfc2397_006.php on line %d bool(false) -===DONE=== diff --git a/ext/standard/tests/file/stream_rfc2397_007.phpt b/ext/standard/tests/file/stream_rfc2397_007.phpt index 447b0246ae..56d9162157 100644 --- a/ext/standard/tests/file/stream_rfc2397_007.phpt +++ b/ext/standard/tests/file/stream_rfc2397_007.phpt @@ -6,81 +6,79 @@ allow_url_fopen=1 <?php $streams = array( - "data:,012345", - ); + "data:,012345", + ); foreach($streams as $stream) { - echo "===$stream===\n"; + echo "===$stream===\n"; - $fp = fopen($stream, 'rb'); + $fp = fopen($stream, 'rb'); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:4,S===\n"; - var_dump(fseek($fp, 4)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===GETC===\n"; - var_dump(fgetc($fp)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===GETC===\n"; - var_dump(fgetc($fp)); - var_dump(fgetc($fp)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===REWIND===\n"; - var_dump(rewind($fp)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===GETC===\n"; - var_dump(fgetc($fp)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:3,S===\n"; - var_dump(fseek($fp, 3, SEEK_SET)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:1,C===\n"; - var_dump(fseek($fp, 1, SEEK_CUR)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:-2,C===\n"; - var_dump(fseek($fp, -2, SEEK_CUR)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:-10,C===\n"; - var_dump(fseek($fp, -10, SEEK_CUR)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:3,S===\n"; - var_dump(fseek($fp, 3, SEEK_SET)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:10,C===\n"; - var_dump(fseek($fp, 10, SEEK_CUR)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:-1,E===\n"; - var_dump(fseek($fp, -1, SEEK_END)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:0,E===\n"; - var_dump(fseek($fp, 0, SEEK_END)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:1,E===\n"; - var_dump(fseek($fp, 1, SEEK_END)); - var_dump(ftell($fp)); - var_dump(feof($fp)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:4,S===\n"; + var_dump(fseek($fp, 4)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===GETC===\n"; + var_dump(fgetc($fp)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===GETC===\n"; + var_dump(fgetc($fp)); + var_dump(fgetc($fp)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===REWIND===\n"; + var_dump(rewind($fp)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===GETC===\n"; + var_dump(fgetc($fp)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:3,S===\n"; + var_dump(fseek($fp, 3, SEEK_SET)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:1,C===\n"; + var_dump(fseek($fp, 1, SEEK_CUR)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:-2,C===\n"; + var_dump(fseek($fp, -2, SEEK_CUR)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:-10,C===\n"; + var_dump(fseek($fp, -10, SEEK_CUR)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:3,S===\n"; + var_dump(fseek($fp, 3, SEEK_SET)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:10,C===\n"; + var_dump(fseek($fp, 10, SEEK_CUR)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:-1,E===\n"; + var_dump(fseek($fp, -1, SEEK_END)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:0,E===\n"; + var_dump(fseek($fp, 0, SEEK_END)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:1,E===\n"; + var_dump(fseek($fp, 1, SEEK_END)); + var_dump(ftell($fp)); + var_dump(feof($fp)); - fclose($fp); + fclose($fp); } ?> -===DONE=== -<?php exit(0); ?> --EXPECT-- ===data:,012345=== int(0) @@ -142,4 +140,3 @@ bool(false) int(-1) bool(false) bool(false) -===DONE=== diff --git a/ext/standard/tests/file/stream_supports_lock.phpt b/ext/standard/tests/file/stream_supports_lock.phpt index 38a84dd7c2..0d2f04b72d 100644 --- a/ext/standard/tests/file/stream_supports_lock.phpt +++ b/ext/standard/tests/file/stream_supports_lock.phpt @@ -26,7 +26,11 @@ fclose($fp); $sock = stream_context_create(); var_dump($sock); -var_dump(stream_supports_lock($sock)); +try { + var_dump(stream_supports_lock($sock)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done\n"; ?> @@ -40,7 +44,5 @@ bool(false) resource(%d) of type (stream) bool(false) resource(%d) of type (stream-context) - -Warning: stream_supports_lock(): supplied resource is not a valid stream resource in %s on line %d -bool(false) +stream_supports_lock(): supplied resource is not a valid stream resource Done diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_basic1.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_basic1.phpt index 0c4733f7ac..d33f7d321d 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_basic1.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_basic1.phpt @@ -9,19 +9,6 @@ if (PHP_OS_FAMILY === 'Windows') { ?> --FILE-- <?php -/* Prototype: bool symlink ( string $target, string $link ); - Description: creates a symbolic link to the existing target with the specified name link - - Prototype: bool is_link ( string $filename ); - Description: Tells whether the given file is a symbolic link. - - Prototype: bool link ( string $target, string $link ); - Description: Create a hard link - - Prototype: int linkinfo ( string $path ); - Description: Gets information about a link -*/ - $file_path = __DIR__; // temp dir created in present working directory diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_basic2.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_basic2.phpt index cfc2cddd7d..c53831075d 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_basic2.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_basic2.phpt @@ -9,19 +9,6 @@ if (PHP_OS_FAMILY === 'Windows') { ?> --FILE-- <?php -/* Prototype: bool symlink ( string $target, string $link ); - Description: creates a symbolic link to the existing target with the specified name link - - Prototype: bool is_link ( string $filename ); - Description: Tells whether the given file is a symbolic link. - - Prototype: bool link ( string $target, string $link ); - Description: Create a hard link - - Prototype: int linkinfo ( string $path ); - Description: Gets information about a link -*/ - $file_path = __DIR__; echo "*** Testing symlink(), linkinfo(), link() and is_link() : basic functionality ***\n"; diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt index 917c525f08..72737d1a8e 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt @@ -8,19 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'SUN') { ?> --FILE-- <?php -/* Prototype: bool symlink ( string $target, string $link ); - Description: creates a symbolic link to the existing target with the specified name link - - Prototype: bool is_link ( string $filename ); - Description: Tells whether the given file is a symbolic link. - - Prototype: bool link ( string $target, string $link ); - Description: Create a hard link - - Prototype: int linkinfo ( string $path ); - Description: Gets information about a link -*/ - // create temp $filename and create link $linkname to it $filename = __DIR__."/symlink_link_linkinfo_is_link_error1.tmp"; $fp = fopen($filename, "w"); // create temp file @@ -30,11 +17,6 @@ fclose($fp); $linkname = __DIR__."/symlink_link_linkinfo_is_link_link_error1.tmp"; echo "*** Testing symlink() for error conditions ***\n"; -//zero arguments -var_dump( symlink() ); - -//more than expected -var_dump( symlink($filename, $linkname, true) ); //invalid arguments var_dump( symlink(NULL, $linkname) ); // NULL as filename @@ -45,11 +27,6 @@ var_dump( symlink($filename, '') ); // '' as linkname var_dump( symlink($filename, false) ); // false as linkname echo "\n*** Testing linkinfo() for error conditions ***\n"; -//zero arguments -var_dump( linkinfo() ); - -//more than expected -var_dump( linkinfo($linkname, true) ); //invalid arguments var_dump( linkinfo(NULL) ); // NULL as linkname @@ -66,12 +43,6 @@ unlink(__DIR__."/symlink_link_linkinfo_is_link_error1.tmp"); --EXPECTF-- *** Testing symlink() for error conditions *** -Warning: symlink() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: symlink() expects exactly 2 parameters, 3 given in %s on line %d -NULL - Warning: symlink(): %s in %s on line %d bool(false) @@ -92,12 +63,6 @@ bool(false) *** Testing linkinfo() for error conditions *** -Warning: linkinfo() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: linkinfo() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: linkinfo(): %s in %s on line %d int(-1) diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt index 6ace6c5ac4..c5b21c0d21 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt @@ -8,19 +8,6 @@ if (PHP_OS_FAMILY === 'Windows' && PHP_ZTS) { ?> --FILE-- <?php -/* Prototype: bool symlink ( string $target, string $link ); - Description: creates a symbolic link to the existing target with the specified name link - - Prototype: bool is_link ( string $filename ); - Description: Tells whether the given file is a symbolic link. - - Prototype: bool link ( string $target, string $link ); - Description: Create a hard link - - Prototype: int linkinfo ( string $path ); - Description: Gets information about a link -*/ - // create temp $filename and create link $linkname to it $filename = __DIR__."/symlink_link_linkinfo_is_link_error2.tmp"; $fp = fopen($filename, "w"); // create temp file @@ -30,11 +17,6 @@ fclose($fp); $linkname = __DIR__."/symlink_link_linkinfo_is_link_link_error2.tmp"; echo "*** Testing link() for error conditions ***\n"; -//zero arguments -var_dump( link() ); - -//more than expected -var_dump( link($filename, $linkname, false) ); //invalid arguments var_dump( link(NULL, $linkname) ); // NULL as filename @@ -46,11 +28,6 @@ var_dump( link($filename, '') ); // '' as linkname var_dump( link($filename, false) ); // false as linkname echo "\n*** Testing is_link() for error conditions ***\n"; -//zero arguments -var_dump( is_link() ); - -//more than expected -var_dump( is_link($linkname, "/") ); //invalid arguments var_dump( is_link(NULL) ); // NULL as linkname @@ -68,12 +45,6 @@ unlink(__DIR__."/symlink_link_linkinfo_is_link_error2.tmp"); --EXPECTF-- *** Testing link() for error conditions *** -Warning: link() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: link() expects exactly 2 parameters, 3 given in %s on line %d -NULL - Warning: link(): No such file or directory in %s on line %d bool(false) @@ -96,12 +67,6 @@ Warning: link(): No such file or directory in %s on line %d bool(false) *** Testing is_link() for error conditions *** - -Warning: is_link() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: is_link() expects exactly 1 parameter, 2 given in %s on line %d -NULL bool(false) bool(false) bool(false) diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation1.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation1.phpt index 98f4f19bbb..6cbd374113 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation1.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation1.phpt @@ -9,19 +9,6 @@ if (PHP_OS_FAMILY === 'Windows') { ?> --FILE-- <?php -/* Prototype: bool symlink ( string $target, string $link ); - Description: creates a symbolic link to the existing target with the specified name link - - Prototype: bool is_link ( string $filename ); - Description: Tells whether the given file is a symbolic link. - - Prototype: bool link ( string $target, string $link ); - Description: Create a hard link - - Prototype: int linkinfo ( string $path ); - Description: Gets information about a link -*/ - /* Variation 1 : Creating links across directories where linkname is stored as an object and array member */ // creating temp directory which will contain temp file and links created diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation2.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation2.phpt index 2c3017628c..69715be008 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation2.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation2.phpt @@ -2,19 +2,6 @@ Test symlink(), linkinfo(), link() and is_link() functions : usage variations - hardlink to non-existent file --FILE-- <?php -/* Prototype: bool symlink ( string $target, string $link ); - Description: creates a symbolic link to the existing target with the specified name link - - Prototype: bool is_link ( string $filename ); - Description: Tells whether the given file is a symbolic link. - - Prototype: bool link ( string $target, string $link ); - Description: Create a hard link - - Prototype: int linkinfo ( string $path ); - Description: Gets information about a link -*/ - /* Variation 2 : Create hard link to non-existent file */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation3.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation3.phpt index a6b2c7e60e..ccf2f53792 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation3.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation3.phpt @@ -9,19 +9,6 @@ if (PHP_OS_FAMILY === 'Windows') { ?> --FILE-- <?php -/* Prototype: bool symlink ( string $target, string $link ); - Description: creates a symbolic link to the existing target with the specified name link - - Prototype: bool is_link ( string $filename ); - Description: Tells whether the given file is a symbolic link. - - Prototype: bool link ( string $target, string $link ); - Description: Create a hard link - - Prototype: int linkinfo ( string $path ); - Description: Gets information about a link -*/ - /* Variation 3 : Create file and a soft link to the file Access data of the file through the soft link Update the file through soft link diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation4.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation4.phpt index fa39a9bf6d..ff2a3f0f4a 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation4.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation4.phpt @@ -2,19 +2,6 @@ Test symlink(), linkinfo(), link() and is_link() functions : usage variations - access/update file through hard link --FILE-- <?php -/* Prototype: bool symlink ( string $target, string $link ); - Description: creates a symbolic link to the existing target with the specified name link - - Prototype: bool is_link ( string $filename ); - Description: Tells whether the given file is a symbolic link. - - Prototype: bool link ( string $target, string $link ); - Description: Create a hard link - - Prototype: int linkinfo ( string $path ); - Description: Gets information about a link -*/ - /* Variation 4 : Create file and a hard link to the file Access data of the file through the hard link Update the file through hard link diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation5.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation5.phpt index c96471e84b..e725ea96e5 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation5.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation5.phpt @@ -9,19 +9,6 @@ if (PHP_OS_FAMILY === 'Windows') { ?> --FILE-- <?php -/* Prototype: bool symlink ( string $target, string $link ); - Description: creates a symbolic link to the existing target with the specified name link - - Prototype: bool is_link ( string $filename ); - Description: Tells whether the given file is a symbolic link. - - Prototype: bool link ( string $target, string $link ); - Description: Create a hard link - - Prototype: int linkinfo ( string $path ); - Description: Gets information about a link -*/ - /* Variation 5 : Creating link, deleting it and checking linkinfo(), is_link() on it */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation6.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation6.phpt index 6d70cbd790..50296920c5 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation6.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation6.phpt @@ -6,19 +6,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype: bool symlink ( string $target, string $link ); - Description: creates a symbolic link to the existing target with the specified name link - - Prototype: bool is_link ( string $filename ); - Description: Tells whether the given file is a symbolic link. - - Prototype: bool link ( string $target, string $link ); - Description: Create a hard link - - Prototype: int linkinfo ( string $path ); - Description: Gets information about a link -*/ - /* Variation 6 : Change permission of directory and try creating links inside that directory */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation7.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation7.phpt index a4d10769ae..d46092f074 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation7.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation7.phpt @@ -9,19 +9,6 @@ if (PHP_OS_FAMILY === 'Windows') { ?> --FILE-- <?php -/* Prototype: bool symlink ( string $target, string $link ); - Description: creates a symbolic link to the existing target with the specified name link - - Prototype: bool is_link ( string $filename ); - Description: Tells whether the given file is a symbolic link. - - Prototype: bool link ( string $target, string $link ); - Description: Create a hard link - - Prototype: int linkinfo ( string $path ); - Description: Gets information about a link -*/ - /* Variation 7 : Create soft/hard link to itself */ // temp file used diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation8.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation8.phpt index 4544c618e2..ef9352bf00 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation8.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation8.phpt @@ -9,19 +9,6 @@ if (PHP_OS_FAMILY === 'Windows') { ?> --FILE-- <?php -/* Prototype: bool symlink ( string $target, string $link ); - Description: creates a symbolic link to the existing target with the specified name link - - Prototype: bool is_link ( string $filename ); - Description: Tells whether the given file is a symbolic link. - - Prototype: bool link ( string $target, string $link ); - Description: Create a hard link - - Prototype: int linkinfo ( string $path ); - Description: Gets information about a link -*/ - /* Variation 8 : Create soft/hard link to different directory */ /* creating link to a file in different dir with the same name as the file */ diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation9.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation9.phpt index c5e1c4805f..baf8a402cd 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation9.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation9.phpt @@ -9,19 +9,6 @@ if (PHP_OS_FAMILY === 'Windows') { ?> --FILE-- <?php -/* Prototype: bool symlink ( string $target, string $link ); - Description: creates a symbolic link to the existing target with the specified name link - - Prototype: bool is_link ( string $filename ); - Description: Tells whether the given file is a symbolic link. - - Prototype: bool link ( string $target, string $link ); - Description: Create a hard link - - Prototype: int linkinfo ( string $path ); - Description: Gets information about a link -*/ - /* Variation 9 : Check lstat of soft/hard link created Check linkinfo() value with lstat['dev'] */ @@ -51,7 +38,7 @@ var_dump(is_int($linkinfo) && $linkinfo !== -1); if( $s1[0] == $linkinfo ) echo "\nlinkinfo() value matches lstat['dev']\n"; else - echo "\nWarning: linkinfo() value doesnt match lstat['dev']\n"; + echo "\nWarning: linkinfo() value doesn't match lstat['dev']\n"; // delete link unlink($soft_link); @@ -66,7 +53,7 @@ var_dump(is_int($linkinfo) && $linkinfo !== -1); if( $s1[0] == $linkinfo ) echo "\nlinkinfo() value matches lstat['dev']\n"; else - echo "\nWarning: linkinfo() value doesnt match lstat['dev']\n"; + echo "\nWarning: linkinfo() value doesn't match lstat['dev']\n"; // delete link unlink($hard_link); @@ -83,7 +70,7 @@ var_dump(is_int($linkinfo) && $linkinfo !== -1); if( $s1[0] == $linkinfo ) echo "\nlinkinfo() value matches lstat['dev']\n"; else - echo "\nWarning: linkinfo() value doesnt match lstat['dev']\n"; + echo "\nWarning: linkinfo() value doesn't match lstat['dev']\n"; // delete link if (PHP_OS_FAMILY === 'Windows') { diff --git a/ext/standard/tests/file/tempnam_variation1-win32-mb.phpt b/ext/standard/tests/file/tempnam_variation1-win32-mb.phpt index 99450dce02..4442798f48 100644 --- a/ext/standard/tests/file/tempnam_variation1-win32-mb.phpt +++ b/ext/standard/tests/file/tempnam_variation1-win32-mb.phpt @@ -7,10 +7,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype: string tempnam ( string $dir, string $prefix ); - Description: Create file with unique file name. -*/ - /* Creating number of unique files by passing a file name as prefix */ $file_path = __DIR__."/tempnamVar1_ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™"; diff --git a/ext/standard/tests/file/tempnam_variation1-win32.phpt b/ext/standard/tests/file/tempnam_variation1-win32.phpt index 5094fa4e88..e33c1ed5ea 100644 --- a/ext/standard/tests/file/tempnam_variation1-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation1-win32.phpt @@ -7,10 +7,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype: string tempnam ( string $dir, string $prefix ); - Description: Create file with unique file name. -*/ - /* Creating number of unique files by passing a file name as prefix */ $file_path = __DIR__."/tempnamVar1"; diff --git a/ext/standard/tests/file/tempnam_variation1.phpt b/ext/standard/tests/file/tempnam_variation1.phpt index ecfae4a167..012031b343 100644 --- a/ext/standard/tests/file/tempnam_variation1.phpt +++ b/ext/standard/tests/file/tempnam_variation1.phpt @@ -7,10 +7,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype: string tempnam ( string $dir, string $prefix ); - Description: Create file with unique file name. -*/ - /* Creating number of unique files by passing a file name as prefix */ $file_path = __DIR__."/tempnamVar1"; diff --git a/ext/standard/tests/file/tempnam_variation2-win32.phpt b/ext/standard/tests/file/tempnam_variation2-win32.phpt index a3a4d2dba9..dd9ee3ea7a 100644 --- a/ext/standard/tests/file/tempnam_variation2-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation2-win32.phpt @@ -7,10 +7,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype: string tempnam ( string $dir, string $prefix ); - Description: Create file with unique file name. -*/ - /* Creating unique files in various dirs by passing relative paths to $dir arg */ echo "*** Testing tempnam() with absolute and relative paths ***\n"; diff --git a/ext/standard/tests/file/tempnam_variation2.phpt b/ext/standard/tests/file/tempnam_variation2.phpt index 17a1e6d645..9d9a307d7c 100644 --- a/ext/standard/tests/file/tempnam_variation2.phpt +++ b/ext/standard/tests/file/tempnam_variation2.phpt @@ -7,10 +7,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype: string tempnam ( string $dir, string $prefix ); - Description: Create file with unique file name. -*/ - /* Creating unique files in various dirs by passing relative paths to $dir arg */ echo "*** Testing tempnam() with absolute and relative paths ***\n"; diff --git a/ext/standard/tests/file/tempnam_variation3-win32.phpt b/ext/standard/tests/file/tempnam_variation3-win32.phpt index bade05ac87..e5bf76484b 100644 --- a/ext/standard/tests/file/tempnam_variation3-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation3-win32.phpt @@ -9,80 +9,81 @@ if(substr(PHP_OS, 0, 3) != "WIN") obscure_filename --FILE-- <?php -/* Prototype: string tempnam ( string $dir, string $prefix ); - Description: Create file with unique file name. -*/ - /* Passing invalid/non-existing args for $prefix */ echo "*** Testing tempnam() with obscure prefixes ***\n"; $file_path = __DIR__."/tempnamVar3"; if (!mkdir($file_path)) { - echo "Failed, cannot create temp dir $filepath\n"; - exit(1); + echo "Failed, cannot create temp dir $filepath\n"; + exit(1); } $file_path = realpath($file_path); /* An array of prefixes */ $names_arr = array( - /* Valid args (casting)*/ - -1, - TRUE, - FALSE, - NULL, - "", - " ", - "\0", - /* Invalid args */ - array(), + /* Valid args (casting)*/ + -1, + TRUE, + FALSE, + NULL, + "", + " ", + "\0", + /* Invalid args */ + array(), - /* Valid args*/ - /* prefix with path separator of a non existing directory*/ - "/no/such/file/dir", - "php/php" + /* Valid args*/ + /* prefix with path separator of a non existing directory*/ + "/no/such/file/dir", + "php/php" ); $res_arr = array( - /* Invalid args */ - true, - true, - true, - true, - true, - true, - true, - false, + /* Invalid args */ + true, + true, + true, + true, + true, + true, + true, + false, - /* prefix with path separator of a non existing directory*/ - true, - true + /* prefix with path separator of a non existing directory*/ + true, + true ); for( $i=0; $i<count($names_arr); $i++ ) { - echo "-- Iteration $i --\n"; - $file_name = tempnam($file_path, $names_arr[$i]); + echo "-- Iteration $i --\n"; + try { + $file_name = tempnam($file_path, $names_arr[$i]); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + continue; + } - /* creating the files in existing dir */ - if (file_exists($file_name) && !$res_arr[$i]) { - echo "Failed\n"; - } - if ($res_arr[$i]) { - $file_dir = dirname($file_name); - if (realpath($file_dir) == $file_path || realpath($file_dir . "\\") == $file_path) { - echo "OK\n"; - } else { - echo "Failed, not created in the correct directory " . realpath($file_dir) . ' vs ' . $file_path ."\n"; - } + /* creating the files in existing dir */ + if (file_exists($file_name) && !$res_arr[$i]) { + echo "Failed\n"; + } + if ($res_arr[$i]) { + $file_dir = dirname($file_name); + if (realpath($file_dir) == $file_path || realpath($file_dir . "\\") == $file_path) { + echo "OK\n"; + } else { + echo "Failed, not created in the correct directory " . realpath($file_dir) . ' vs ' . $file_path ."\n"; + } - if (!is_writable($file_name)) { - printf("%o\n", fileperms($file_name) ); + if (!is_writable($file_name)) { + printf("%o\n", fileperms($file_name) ); - } - } else { - echo "OK\n"; - } - @unlink($file_name); + } + } else { + echo "OK\n"; + } + @unlink($file_name); } rmdir($file_path); @@ -105,14 +106,9 @@ Notice: tempnam(): file created in the system's temporary directory in %stempnam Failed, not created in the correct directory %s vs %s 0 -- Iteration 6 -- - -Warning: tempnam() expects parameter 2 to be a valid path, string given in %stempnam_variation3-win32.php on line 54 -Failed, not created in the correct directory %s vs %sext\standard\tests\file\tempnamVar3 -0 +tempnam(): Argument #2 ($prefix) must be a valid path, string given -- Iteration 7 -- - -Warning: tempnam() expects parameter 2 to be a valid path, array given in %s\ext\standard\tests\file\tempnam_variation3-win32.php on line %d -OK +tempnam(): Argument #2 ($prefix) must be a valid path, array given -- Iteration 8 -- OK -- Iteration 9 -- diff --git a/ext/standard/tests/file/tempnam_variation3.phpt b/ext/standard/tests/file/tempnam_variation3.phpt index 55db89cc72..b3e237afec 100644 --- a/ext/standard/tests/file/tempnam_variation3.phpt +++ b/ext/standard/tests/file/tempnam_variation3.phpt @@ -9,10 +9,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") obscure_filename --FILE-- <?php -/* Prototype: string tempnam ( string $dir, string $prefix ); - Description: Create file with unique file name. -*/ - /* Passing invalid/non-existing args for $prefix */ echo "*** Testing tempnam() with obscure prefixes ***\n"; @@ -39,7 +35,12 @@ $names_arr = array( for( $i=0; $i<count($names_arr); $i++ ) { echo "-- Iteration $i --\n"; - $file_name = tempnam("$file_path", $names_arr[$i]); + try { + $file_name = tempnam("$file_path", $names_arr[$i]); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + continue; + } /* creating the files in existing dir */ if( file_exists($file_name) ) { @@ -101,17 +102,9 @@ File name is => %s/%s File permissions are => 100600 File created in => directory specified -- Iteration 6 -- - -Warning: tempnam() expects parameter 2 to be a valid path, string given in %s on line %d --- File is not created -- - -Warning: unlink(): %s in %s on line %d +tempnam(): Argument #2 ($prefix) must be a valid path, string given -- Iteration 7 -- - -Warning: tempnam() expects parameter 2 to be a valid path, array given in %s on line %d --- File is not created -- - -Warning: unlink(): %s in %s on line %d +tempnam(): Argument #2 ($prefix) must be a valid path, array given -- Iteration 8 -- File name is => %s/dir%s File permissions are => 100600 diff --git a/ext/standard/tests/file/tempnam_variation4-0.phpt b/ext/standard/tests/file/tempnam_variation4-0.phpt index cbd09a5025..6679e37535 100644 --- a/ext/standard/tests/file/tempnam_variation4-0.phpt +++ b/ext/standard/tests/file/tempnam_variation4-0.phpt @@ -9,10 +9,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype: string tempnam ( string $dir, string $prefix ); - Description: Create file with unique file name. -*/ - /* Trying to create the file in a dir with permissions from 0000 to 0350, Allowable permissions: files are expected to be created in the input dir Non-allowable permissions: files are expected to be created in '/tmp' dir @@ -52,579 +48,579 @@ echo "*** Done ***\n"; --EXPECTF-- *** Testing tempnam() with dir of permissions from 0000 to 0350 *** -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 0 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 1 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 2 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 3 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 4 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 5 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 6 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 7 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 10 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 11 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 12 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 13 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 14 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 15 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 16 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 17 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 20 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 21 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 22 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 23 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 24 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 25 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 26 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 27 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 30 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 31 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 32 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 33 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 34 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 35 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 36 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 37 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 40 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 41 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 42 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 43 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 44 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 45 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 46 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 47 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 50 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 51 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 52 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 53 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 54 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 55 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 56 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 57 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 60 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 61 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 62 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 63 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 64 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 65 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 66 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 67 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 70 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 71 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 72 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 73 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 74 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 75 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 76 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 77 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 100 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 101 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 102 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 103 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 104 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 105 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 106 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 107 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 110 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 111 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 112 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 113 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 114 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 115 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 116 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 117 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 120 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 121 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 122 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 123 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 124 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 125 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 126 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 127 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 130 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 131 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 132 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 133 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 134 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 135 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 136 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 137 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 140 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 141 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 142 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 143 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 144 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 145 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 146 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 147 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 150 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 151 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 152 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 153 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 154 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 155 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 156 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 157 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 160 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 161 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 162 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 163 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 164 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 165 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 166 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 167 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 170 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 171 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 172 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 173 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 174 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 175 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 176 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 177 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 200 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 201 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 202 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 203 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 204 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 205 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 206 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 207 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 210 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 211 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 212 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 213 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 214 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 215 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 216 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 217 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 220 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 221 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 222 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 223 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 224 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 225 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 226 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 227 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 230 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 231 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 232 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 233 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 234 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 235 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 236 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 237 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 240 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 241 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 242 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 243 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 244 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 245 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 246 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 247 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 250 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 251 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 252 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 253 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 254 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 255 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 256 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 257 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 260 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 261 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 262 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 263 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 264 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 265 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 266 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 267 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 270 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 271 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 272 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 273 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 274 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 275 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 276 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 277 *** Done *** diff --git a/ext/standard/tests/file/tempnam_variation4-1.phpt b/ext/standard/tests/file/tempnam_variation4-1.phpt index 46807125c6..3a2eb2bb75 100644 --- a/ext/standard/tests/file/tempnam_variation4-1.phpt +++ b/ext/standard/tests/file/tempnam_variation4-1.phpt @@ -9,10 +9,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype: string tempnam ( string $dir, string $prefix ); - Description: Create file with unique file name. -*/ - /* Trying to create the file in a dir with permissions from 0351 to 0777, Allowable permissions: files are expected to be created in the input dir Non-allowable permissions: files are expected to be created in '/tmp' dir @@ -52,579 +48,579 @@ echo "*** Done ***\n"; --EXPECTF-- *** Testing tempnam() with dir of permissions from 0351 to 0777 *** -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 400 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 401 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 402 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 403 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 404 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 405 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 406 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 407 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 410 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 411 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 412 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 413 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 414 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 415 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 416 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 417 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 420 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 421 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 422 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 423 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 424 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 425 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 426 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 427 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 430 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 431 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 432 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 433 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 434 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 435 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 436 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 437 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 440 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 441 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 442 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 443 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 444 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 445 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 446 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 447 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 450 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 451 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 452 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 453 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 454 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 455 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 456 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 457 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 460 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 461 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 462 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 463 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 464 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 465 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 466 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 467 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 470 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 471 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 472 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 473 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 474 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 475 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 476 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 477 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 500 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 501 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 502 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 503 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 504 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 505 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 506 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 507 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 510 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 511 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 512 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 513 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 514 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 515 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 516 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 517 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 520 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 521 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 522 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 523 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 524 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 525 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 526 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 527 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 530 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 531 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 532 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 533 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 534 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 535 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 536 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 537 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 540 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 541 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 542 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 543 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 544 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 545 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 546 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 547 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 550 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 551 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 552 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 553 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 554 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 555 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 556 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 557 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 560 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 561 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 562 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 563 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 564 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 565 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 566 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 567 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 570 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 571 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 572 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 573 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 574 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 575 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 576 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 577 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 600 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 601 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 602 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 603 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 604 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 605 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 606 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 607 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 610 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 611 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 612 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 613 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 614 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 615 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 616 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 617 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 620 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 621 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 622 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 623 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 624 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 625 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 626 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 627 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 630 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 631 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 632 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 633 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 634 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 635 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 636 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 637 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 640 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 641 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 642 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 643 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 644 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 645 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 646 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 647 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 650 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 651 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 652 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 653 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 654 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 655 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 656 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 657 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 660 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 661 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 662 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 663 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 664 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 665 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 666 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 667 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 670 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 671 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 672 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 673 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 674 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 675 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 676 -Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20 +Notice: tempnam(): file created in the system's temporary directory in %s on line %d 677 *** Done *** diff --git a/ext/standard/tests/file/tempnam_variation5-win32.phpt b/ext/standard/tests/file/tempnam_variation5-win32.phpt index 71bfd06619..fb2d20a827 100644 --- a/ext/standard/tests/file/tempnam_variation5-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation5-win32.phpt @@ -9,10 +9,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype: string tempnam ( string $dir, string $prefix ); - Description: Create file with unique file name. -*/ - /* Passing an existing file as $prefix for tempnam() fn */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/tempnam_variation5.phpt b/ext/standard/tests/file/tempnam_variation5.phpt index 62a186c37c..b4c908f124 100644 --- a/ext/standard/tests/file/tempnam_variation5.phpt +++ b/ext/standard/tests/file/tempnam_variation5.phpt @@ -7,10 +7,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype: string tempnam ( string $dir, string $prefix ); - Description: Create file with unique file name. -*/ - /* Passing an existing file as $prefix for tempnam() fn */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/tempnam_variation6-win32.phpt b/ext/standard/tests/file/tempnam_variation6-win32.phpt index c7a449c590..dad09890d0 100644 --- a/ext/standard/tests/file/tempnam_variation6-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation6-win32.phpt @@ -9,10 +9,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype: string tempnam ( string $dir, string $prefix ); - Description: Create file with unique file name. -*/ - /* Trying to create unique files by passing previously created unique file name as prefix */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/tempnam_variation6.phpt b/ext/standard/tests/file/tempnam_variation6.phpt index db40292e25..d71501eaf9 100644 --- a/ext/standard/tests/file/tempnam_variation6.phpt +++ b/ext/standard/tests/file/tempnam_variation6.phpt @@ -7,10 +7,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php -/* Prototype: string tempnam ( string $dir, string $prefix ); - Description: Create file with unique file name. -*/ - /* Trying to create unique files by passing previously created unique file name as prefix */ $file_path = __DIR__; diff --git a/ext/standard/tests/file/tempnam_variation7-win32.phpt b/ext/standard/tests/file/tempnam_variation7-win32.phpt index 9ad75f8ed5..5beaa6d095 100644 --- a/ext/standard/tests/file/tempnam_variation7-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation7-win32.phpt @@ -9,57 +9,58 @@ if(substr(PHP_OS, 0, 3) != "WIN") obscure_filename --FILE-- <?php -/* Prototype: string tempnam ( string $dir, string $prefix ); - Description: Create file with unique file name. -*/ - /* Passing invalid/non-existing args for $dir, hence the unique files will be created in temporary dir */ echo "*** Testing tempnam() with invalid/non-existing directory names ***\n"; /* An array of names, which will be passed as a dir name */ $names_arr = array( - /* Invalid args */ - -1, - TRUE, - FALSE, - NULL, - "", - " ", - "\0", - array(), - - /* Non-existing dirs */ - "/no/such/file/dir", - "php" + /* Invalid args */ + -1, + TRUE, + FALSE, + NULL, + "", + " ", + "\0", + array(), + + /* Non-existing dirs */ + "/no/such/file/dir", + "php" ); for( $i=0; $i<count($names_arr); $i++ ) { - echo "-- Iteration $i --\n"; - $file_name = tempnam($names_arr[$i], "tempnam_variation3.tmp"); - - if( file_exists($file_name) ){ - - echo "File name is => "; - print($file_name); - echo "\n"; - - echo "File permissions are => "; - printf("%o", fileperms($file_name) ); - echo "\n"; - - echo "File created in => "; - $file_dir = dirname($file_name); - if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { - echo "temp dir\n"; - } else { - echo "unknown location\n"; - } - } else { - echo "-- File is not created --\n"; - } - - unlink($file_name); + echo "-- Iteration $i --\n"; + try { + $file_name = tempnam($names_arr[$i], "tempnam_variation3.tmp"); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + continue; + } + + if( file_exists($file_name) ){ + + echo "File name is => "; + print($file_name); + echo "\n"; + + echo "File permissions are => "; + printf("%o", fileperms($file_name) ); + echo "\n"; + + echo "File created in => "; + $file_dir = dirname($file_name); + if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { + echo "temp dir\n"; + } else { + echo "unknown location\n"; + } + } else { + echo "-- File is not created --\n"; + } + + unlink($file_name); } ?> --EXPECTF-- @@ -95,17 +96,9 @@ File name is => %s%et%s File permissions are => 100666 File created in => temp dir -- Iteration 6 -- - -Warning: tempnam() expects parameter 1 to be a valid path, string given in %stempnam_variation7-win32.php on line %d --- File is not created -- - -Warning: unlink(): %r(Invalid argument|No such file or directory)%r in %s on line %d +tempnam(): Argument #1 ($dir) must be a valid path, string given -- Iteration 7 -- - -Warning: tempnam() expects parameter 1 to be a valid path, array given in %s on line %d --- File is not created -- - -Warning: unlink(): %r(Invalid argument|No such file or directory)%r in %s on line %d +tempnam(): Argument #1 ($dir) must be a valid path, array given -- Iteration 8 -- Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation7-win32.php on line %d diff --git a/ext/standard/tests/file/tempnam_variation7.phpt b/ext/standard/tests/file/tempnam_variation7.phpt index 289fe82375..e8d2811e0a 100644 --- a/ext/standard/tests/file/tempnam_variation7.phpt +++ b/ext/standard/tests/file/tempnam_variation7.phpt @@ -9,10 +9,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") obscure_filename --FILE-- <?php -/* Prototype: string tempnam ( string $dir, string $prefix ); - Description: Create file with unique file name. -*/ - /* Passing invalid/non-existing args for $dir, hence the unique files will be created in temporary dir */ @@ -37,7 +33,12 @@ $names_arr = array( for( $i=0; $i<count($names_arr); $i++ ) { echo "-- Iteration $i --\n"; - $file_name = tempnam($names_arr[$i], "tempnam_variation3.tmp"); + try { + $file_name = tempnam($names_arr[$i], "tempnam_variation3.tmp"); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + continue; + } if( file_exists($file_name) ){ @@ -100,17 +101,9 @@ File name is => %s%etempnam_variation3.tmp%s File permissions are => 100600 File created in => temp dir -- Iteration 6 -- - -Warning: tempnam() expects parameter 1 to be a valid path, string given in %s on line %d --- File is not created -- - -Warning: unlink(): %s in %s on line %d +tempnam(): Argument #1 ($dir) must be a valid path, string given -- Iteration 7 -- - -Warning: tempnam() expects parameter 1 to be a valid path, array given in %s on line %d --- File is not created -- - -Warning: unlink(): %s in %s on line %d +tempnam(): Argument #1 ($dir) must be a valid path, array given -- Iteration 8 -- Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation7.php on line %d diff --git a/ext/standard/tests/file/tempnam_variation8-win32.phpt b/ext/standard/tests/file/tempnam_variation8-win32.phpt index 5751368f7c..f329b1a97f 100644 --- a/ext/standard/tests/file/tempnam_variation8-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation8-win32.phpt @@ -9,10 +9,6 @@ if(substr(PHP_OS, 0, 3) != "WIN") ?> --FILE-- <?php -/* Prototype: string tempnam ( string $dir, string $prefix ); - Description: Create file with unique file name. -*/ - /* Creating unique files in various dirs by passing relative paths to $dir arg */ echo "*** Testing tempnam() with absolute and relative paths ***\n"; diff --git a/ext/standard/tests/file/touch.phpt b/ext/standard/tests/file/touch.phpt index e0b06d3960..0474b34af2 100644 --- a/ext/standard/tests/file/touch.phpt +++ b/ext/standard/tests/file/touch.phpt @@ -13,7 +13,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { // output to linux. This could be a php.net bug on windows or a windows querk. $filename = __DIR__."/touch.dat"; -var_dump(touch()); var_dump(touch($filename)); var_dump(filemtime($filename)); @unlink($filename); @@ -39,8 +38,6 @@ var_dump(touch("/no/such/file/or/directory")); echo "Done\n"; ?> --EXPECTF-- -Warning: touch() expects at least 1 parameter, 0 given in %s on line %d -NULL bool(true) int(%d) bool(true) diff --git a/ext/standard/tests/file/touch_basic-win32-mb.phpt b/ext/standard/tests/file/touch_basic-win32-mb.phpt index e10e1219d8..ad830e26f4 100644 --- a/ext/standard/tests/file/touch_basic-win32-mb.phpt +++ b/ext/standard/tests/file/touch_basic-win32-mb.phpt @@ -10,12 +10,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype : proto bool touch(string filename [, int time [, int atime]]) - * Description: Set modification time of file - * Source code: ext/standard/filestat.c - * Alias to functions: - */ - echo "*** Testing touch() : basic functionality ***\n"; $filename = __DIR__."/touch_ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.dat"; diff --git a/ext/standard/tests/file/touch_basic-win32.phpt b/ext/standard/tests/file/touch_basic-win32.phpt index 08248ac760..7a51ad2ee0 100644 --- a/ext/standard/tests/file/touch_basic-win32.phpt +++ b/ext/standard/tests/file/touch_basic-win32.phpt @@ -10,12 +10,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype : proto bool touch(string filename [, int time [, int atime]]) - * Description: Set modification time of file - * Source code: ext/standard/filestat.c - * Alias to functions: - */ - echo "*** Testing touch() : basic functionality ***\n"; $filename = __DIR__."/touch.dat"; diff --git a/ext/standard/tests/file/touch_basic.phpt b/ext/standard/tests/file/touch_basic.phpt index ffce02e574..ffe4b3e8c0 100644 --- a/ext/standard/tests/file/touch_basic.phpt +++ b/ext/standard/tests/file/touch_basic.phpt @@ -11,12 +11,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype : proto bool touch(string filename [, int time [, int atime]]) - * Description: Set modification time of file - * Source code: ext/standard/filestat.c - * Alias to functions: - */ - echo "*** Testing touch() : basic functionality ***\n"; $filename = __DIR__."/touch_basic.dat"; diff --git a/ext/standard/tests/file/touch_error.phpt b/ext/standard/tests/file/touch_error.phpt index 0520055a90..9a4bd01e13 100644 --- a/ext/standard/tests/file/touch_error.phpt +++ b/ext/standard/tests/file/touch_error.phpt @@ -5,17 +5,9 @@ Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -var_dump(touch()); -var_dump(touch(1, 2, 3, 4)); var_dump(touch("/no/such/file/or/directory")); ?> --EXPECTF-- -Warning: touch() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: touch() expects at most 3 parameters, 4 given in %s on line %d -NULL - Warning: touch(): Unable to create file /no/such/file/or/directory because No such file or directory in %s on line %d bool(false) diff --git a/ext/standard/tests/file/touch_variation5-win32.phpt b/ext/standard/tests/file/touch_variation5-win32.phpt index 5761824ef3..e3bcbee140 100644 --- a/ext/standard/tests/file/touch_variation5-win32.phpt +++ b/ext/standard/tests/file/touch_variation5-win32.phpt @@ -9,12 +9,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { } --FILE-- <?php -/* Prototype : bool touch(string filename [, int time [, int atime]]) - * Description: Set modification time of file - * Source code: ext/standard/filestat.c - * Alias to functions: - */ - $workDir = "touchVar5.tmp"; $subDirOrFile = "aSubDirOrFile"; $cwd = __DIR__; @@ -22,7 +16,7 @@ chdir($cwd); if (!mkdir($cwd . '/' . $workDir)) die("cannot create directory $workDir"); $paths = array( - // relative + // relative $workDir.'/'.$subDirOrFile, './'.$workDir.'/'.$subDirOrFile, $workDir.'/../'.$workDir.'/'.$subDirOrFile, @@ -66,66 +60,66 @@ rmdir($workDir); function test_nonexisting($paths) { - foreach($paths as $path) { - echo "--- testing $path ---\n"; - - if (is_dir($path) || is_file($path)) { - echo "FAILED: $path - exists\n"; - } - else { - $res = touch($path); - if ($res === true) { - // something was created - if (file_exists($path)) { - // something found - if (is_dir($path)) { - echo "FAILED: $path - unexpected directory\n"; - } - else { - echo "PASSED: $path - created\n"; - unlink($path); - } - } - else { - // nothing found - echo "FAILED: $path - touch returned true, nothing there\n"; - } - } - else { - // nothing created - if (file_exists($path)) { - //something found - echo "FAILED: $path - touch returned false, something there\n"; - if (is_dir($path)) { - rmdir($path); - } - else { - unlink($path); - } - } - } - } - } + foreach($paths as $path) { + echo "--- testing $path ---\n"; + + if (is_dir($path) || is_file($path)) { + echo "FAILED: $path - exists\n"; + } + else { + $res = touch($path); + if ($res === true) { + // something was created + if (file_exists($path)) { + // something found + if (is_dir($path)) { + echo "FAILED: $path - unexpected directory\n"; + } + else { + echo "PASSED: $path - created\n"; + unlink($path); + } + } + else { + // nothing found + echo "FAILED: $path - touch returned true, nothing there\n"; + } + } + else { + // nothing created + if (file_exists($path)) { + //something found + echo "FAILED: $path - touch returned false, something there\n"; + if (is_dir($path)) { + rmdir($path); + } + else { + unlink($path); + } + } + } + } + } } function test_existing($paths, $are_dirs) { - foreach($paths as $path) { - if ($are_dirs) { - $res = @mkdir($path); - if ($res == true) { + foreach($paths as $path) { + if ($are_dirs) { + $res = @mkdir($path); + if ($res == true) { test_path($path); rmdir($path); } - } - else { - $h = @fopen($path,"w"); - if ($h !== false) { - fclose($h); + } + else { + $h = @fopen($path,"w"); + if ($h !== false) { + fclose($h); test_path($path); unlink($path); } - } - } + } + } } @@ -150,7 +144,6 @@ function get_atime($path) { ?> -===DONE=== --EXPECTF-- *** Testing touch() : variation *** @@ -226,4 +219,3 @@ PASSED: %s/touchVar5.tmp/aSubDirOrFile/ - touched PASSED: touchVar5.tmp//aSubDirOrFile - touched --- testing %s//touchVar5.tmp//aSubDirOrFile --- PASSED: %s//touchVar5.tmp//aSubDirOrFile - touched -===DONE=== diff --git a/ext/standard/tests/file/touch_variation5.phpt b/ext/standard/tests/file/touch_variation5.phpt index 7eb4aaa7e0..a4a9cf6928 100644 --- a/ext/standard/tests/file/touch_variation5.phpt +++ b/ext/standard/tests/file/touch_variation5.phpt @@ -10,19 +10,13 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype : bool touch(string filename [, int time [, int atime]]) - * Description: Set modification time of file - * Source code: ext/standard/filestat.c - * Alias to functions: - */ - $workDir = "touchVar5.tmp"; $subDirOrFile = "aSubDirOrFile"; mkdir($workDir); $cwd = getcwd(); $paths = array( - // relative + // relative $workDir.'/'.$subDirOrFile, './'.$workDir.'/'.$subDirOrFile, $workDir.'/../'.$workDir.'/'.$subDirOrFile, @@ -66,66 +60,66 @@ rmdir($workDir); function test_nonexisting($paths) { - foreach($paths as $path) { - echo "--- testing $path ---\n"; - - if (is_dir($path) || is_file($path)) { - echo "FAILED: $path - exists\n"; - } - else { - $res = touch($path); - if ($res === true) { - // something was created - if (file_exists($path)) { - // something found - if (is_dir($path)) { - echo "FAILED: $path - unexpected directory\n"; - } - else { - echo "PASSED: $path - created\n"; - unlink($path); - } - } - else { - // nothing found - echo "FAILED: $path - touch returned true, nothing there\n"; - } - } - else { - // nothing created - if (file_exists($path)) { - //something found - echo "FAILED: $path - touch returned false, something there\n"; - if (is_dir($path)) { - rmdir($path); - } - else { - unlink($path); - } - } - } - } - } + foreach($paths as $path) { + echo "--- testing $path ---\n"; + + if (is_dir($path) || is_file($path)) { + echo "FAILED: $path - exists\n"; + } + else { + $res = touch($path); + if ($res === true) { + // something was created + if (file_exists($path)) { + // something found + if (is_dir($path)) { + echo "FAILED: $path - unexpected directory\n"; + } + else { + echo "PASSED: $path - created\n"; + unlink($path); + } + } + else { + // nothing found + echo "FAILED: $path - touch returned true, nothing there\n"; + } + } + else { + // nothing created + if (file_exists($path)) { + //something found + echo "FAILED: $path - touch returned false, something there\n"; + if (is_dir($path)) { + rmdir($path); + } + else { + unlink($path); + } + } + } + } + } } function test_existing($paths, $are_dirs) { - foreach($paths as $path) { - if ($are_dirs) { - $res = @mkdir($path); - if ($res == true) { + foreach($paths as $path) { + if ($are_dirs) { + $res = @mkdir($path); + if ($res == true) { test_path($path); rmdir($path); } - } - else { - $h = @fopen($path,"w"); - if ($h !== false) { - fclose($h); + } + else { + $h = @fopen($path,"w"); + if ($h !== false) { + fclose($h); test_path($path); unlink($path); } - } - } + } + } } @@ -150,7 +144,6 @@ function get_atime($path) { ?> -===DONE=== --EXPECTF-- *** Testing touch() : variation *** @@ -226,4 +219,3 @@ PASSED: /%s/touchVar5.tmp/aSubDirOrFile/ - touched PASSED: touchVar5.tmp//aSubDirOrFile - touched --- testing /%s//touchVar5.tmp//aSubDirOrFile --- PASSED: /%s//touchVar5.tmp//aSubDirOrFile - touched -===DONE=== diff --git a/ext/standard/tests/file/touch_variation6-win32.phpt b/ext/standard/tests/file/touch_variation6-win32.phpt index 197078db3b..d1a697c4ab 100644 --- a/ext/standard/tests/file/touch_variation6-win32.phpt +++ b/ext/standard/tests/file/touch_variation6-win32.phpt @@ -10,12 +10,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype : bool touch(string filename [, int time [, int atime]]) - * Description: Set modification time of file - * Source code: ext/standard/filestat.c - * Alias to functions: - */ - $workDir = "touchVar5.tmp"; $subDirOrFile = "aSubDirOrFile"; chdir(__DIR__); @@ -25,7 +19,7 @@ $cwd = getcwd(); $unixifiedDirOrFile = '/'.substr(str_replace('\\','/',$cwd).'/'.$workDir.'/'.$subDirOrFile, 3); $paths = array( - // relative + // relative $workDir.'\\'.$subDirOrFile, '.\\'.$workDir.'\\'.$subDirOrFile, $workDir.'\\..\\'.$workDir.'\\'.$subDirOrFile, @@ -72,66 +66,66 @@ rmdir($workDir); function test_nonexisting($paths) { - foreach($paths as $path) { - echo "--- testing $path ---\n"; - - if (is_dir($path) || is_file($path)) { - echo "FAILED: $path - exists\n"; - } - else { - $res = touch($path); - if ($res === true) { - // something was created - if (file_exists($path)) { - // something found - if (is_dir($path)) { - echo "FAILED: $path - unexpected directory\n"; - } - else { - echo "PASSED: $path - created\n"; - unlink($path); - } - } - else { - // nothing found - echo "FAILED: $path - touch returned true, nothing there\n"; - } - } - else { - // nothing created - if (file_exists($path)) { - //something found - echo "FAILED: $path - touch returned false, something there\n"; - if (is_dir($path)) { - rmdir($path); - } - else { - unlink($path); - } - } - } - } - } + foreach($paths as $path) { + echo "--- testing $path ---\n"; + + if (is_dir($path) || is_file($path)) { + echo "FAILED: $path - exists\n"; + } + else { + $res = touch($path); + if ($res === true) { + // something was created + if (file_exists($path)) { + // something found + if (is_dir($path)) { + echo "FAILED: $path - unexpected directory\n"; + } + else { + echo "PASSED: $path - created\n"; + unlink($path); + } + } + else { + // nothing found + echo "FAILED: $path - touch returned true, nothing there\n"; + } + } + else { + // nothing created + if (file_exists($path)) { + //something found + echo "FAILED: $path - touch returned false, something there\n"; + if (is_dir($path)) { + rmdir($path); + } + else { + unlink($path); + } + } + } + } + } } function test_existing($paths, $are_dirs) { - foreach($paths as $path) { - if ($are_dirs) { - $res = @mkdir($path); - if ($res == true) { + foreach($paths as $path) { + if ($are_dirs) { + $res = @mkdir($path); + if ($res == true) { test_path($path); rmdir($path); } - } - else { - $h = @fopen($path,"w"); - if ($h !== false) { - fclose($h); + } + else { + $h = @fopen($path,"w"); + if ($h !== false) { + fclose($h); test_path($path); unlink($path); } - } - } + } + } } @@ -156,7 +150,6 @@ function get_atime($path) { ?> -===DONE=== --EXPECTF-- *** Testing touch() : variation *** @@ -238,4 +231,3 @@ PASSED: touchVar5.tmp\\aSubDirOrFile - touched PASSED: %s\\touchVar5.tmp\\aSubDirOrFile - touched --- testing /%s/touchVar5.tmp/aSubDirOrFile --- PASSED: /%s/touchVar5.tmp/aSubDirOrFile - touched -===DONE=== diff --git a/ext/standard/tests/file/umask_basic.phpt b/ext/standard/tests/file/umask_basic.phpt index 761df97253..7463a8bb62 100644 --- a/ext/standard/tests/file/umask_basic.phpt +++ b/ext/standard/tests/file/umask_basic.phpt @@ -8,10 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype: int umask ( [int $mask] ); - Description: Changes the current umask -*/ - echo "*** Testing umask() : basic functionality ***\n"; // checking umask() on all the modes for($mask = 0000; $mask <= 0777; $mask++) { diff --git a/ext/standard/tests/file/umask_variation1.phpt b/ext/standard/tests/file/umask_variation1.phpt index 77eada18e5..f5a5a26e55 100644 --- a/ext/standard/tests/file/umask_variation1.phpt +++ b/ext/standard/tests/file/umask_variation1.phpt @@ -8,10 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype: int umask ( [int $mask] ); - Description: Changes the current umask -*/ - $file_path = __DIR__; /* Check umask() on file/dir */ diff --git a/ext/standard/tests/file/umask_variation2.phpt b/ext/standard/tests/file/umask_variation2.phpt index 6eac520f1c..21e3e35af7 100644 --- a/ext/standard/tests/file/umask_variation2.phpt +++ b/ext/standard/tests/file/umask_variation2.phpt @@ -8,10 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype: int umask ( [int $mask] ); - Description: Changes the current umask -*/ - $file_path = __DIR__; /* Check umask() on file/dir */ diff --git a/ext/standard/tests/file/unlink_basic.phpt b/ext/standard/tests/file/unlink_basic.phpt index 872326bad8..7459154d85 100644 --- a/ext/standard/tests/file/unlink_basic.phpt +++ b/ext/standard/tests/file/unlink_basic.phpt @@ -2,9 +2,6 @@ Testing unlink() function : basic functionality --FILE-- <?php -/* Prototype : bool unlink ( string $filename [, resource $context] ); - Description : Deletes filename -*/ $file_path = __DIR__; @@ -16,7 +13,7 @@ fclose($fp); // delete file var_dump( unlink($filename) ); -var_dump( file_exists($filename) ); // confirm file doesnt exist +var_dump( file_exists($filename) ); // confirm file doesn't exist echo "\n*** Testing unlink() : checking second argument ***\n"; // creating a context @@ -28,7 +25,7 @@ fclose($fp); // delete file var_dump( unlink($filename, $context) ); // using $context in second argument -var_dump( file_exists($filename) ); // confirm file doesnt exist +var_dump( file_exists($filename) ); // confirm file doesn't exist echo "Done\n"; ?> diff --git a/ext/standard/tests/file/unlink_error-win32-mb.phpt b/ext/standard/tests/file/unlink_error-win32-mb.phpt index 54a433b861..e85db00600 100644 --- a/ext/standard/tests/file/unlink_error-win32-mb.phpt +++ b/ext/standard/tests/file/unlink_error-win32-mb.phpt @@ -8,9 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype : bool unlink ( string $filename [, resource $context] ); - Description : Deletes filename -*/ $file_path = __DIR__.DIRECTORY_SEPARATOR."unlinkErrç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™"; @@ -25,26 +22,16 @@ $context = stream_context_create(); echo "*** Testing unlink() : error conditions ***\n"; -echo "-- Testing unlink() on unexpected no. of arguments --\n"; -// arg < expected -var_dump( unlink() ); -// args > expected -var_dump( unlink($filename, $context, true) ); -var_dump( file_exists($filename) ); // expected: true - echo "\n-- Testing unlink() on invalid arguments --\n"; // invalid arguments var_dump( unlink('') ); // $filename as empty string -var_dump( file_exists('') ); // confirm file doesnt exist +var_dump( file_exists('') ); // confirm file doesn't exist var_dump( unlink(NULL) ); // $filename as NULL -var_dump( file_exists(NULL) ); // confirm file doesnt exist +var_dump( file_exists(NULL) ); // confirm file doesn't exist var_dump( unlink(false) ); // $filename as boolean false -var_dump( file_exists(false) ); // confirm file doesnt exist - -var_dump( unlink($filename, '') ); // $context as empty string -var_dump( unlink($filename, false) ); // $context as boolean false +var_dump( file_exists(false) ); // confirm file doesn't exist echo "\n-- Testing unlink() on non-existent file --\n"; @@ -68,14 +55,6 @@ rmdir(__DIR__."/unlinkErrç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™"); ?> --EXPECTF-- *** Testing unlink() : error conditions *** --- Testing unlink() on unexpected no. of arguments -- - -Warning: unlink() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: unlink() expects at most 2 parameters, 3 given in %s on line %d -bool(false) -bool(true) -- Testing unlink() on invalid arguments -- @@ -91,12 +70,6 @@ Warning: unlink(): %s in %s on line %d bool(false) bool(false) -Warning: unlink() expects parameter 2 to be resource, string given in %s on line %d -bool(false) - -Warning: unlink() expects parameter 2 to be resource, bool given in %s on line %d -bool(false) - -- Testing unlink() on non-existent file -- Warning: unlink(%s/non_existent_file.tmp): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/unlink_error-win32.phpt b/ext/standard/tests/file/unlink_error-win32.phpt index d62c715a94..af579be58d 100644 --- a/ext/standard/tests/file/unlink_error-win32.phpt +++ b/ext/standard/tests/file/unlink_error-win32.phpt @@ -8,9 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype : bool unlink ( string $filename [, resource $context] ); - Description : Deletes filename -*/ $file_path = __DIR__; @@ -23,26 +20,16 @@ $context = stream_context_create(); echo "*** Testing unlink() : error conditions ***\n"; -echo "-- Testing unlink() on unexpected no. of arguments --\n"; -// arg < expected -var_dump( unlink() ); -// args > expected -var_dump( unlink($filename, $context, true) ); -var_dump( file_exists($filename) ); // expected: true - echo "\n-- Testing unlink() on invalid arguments --\n"; // invalid arguments var_dump( unlink('') ); // $filename as empty string -var_dump( file_exists('') ); // confirm file doesnt exist +var_dump( file_exists('') ); // confirm file doesn't exist var_dump( unlink(NULL) ); // $filename as NULL -var_dump( file_exists(NULL) ); // confirm file doesnt exist +var_dump( file_exists(NULL) ); // confirm file doesn't exist var_dump( unlink(false) ); // $filename as boolean false -var_dump( file_exists(false) ); // confirm file doesnt exist - -var_dump( unlink($filename, '') ); // $context as empty string -var_dump( unlink($filename, false) ); // $context as boolean false +var_dump( file_exists(false) ); // confirm file doesn't exist echo "\n-- Testing unlink() on non-existent file --\n"; @@ -65,14 +52,6 @@ rmdir(__DIR__."/unlink_error"); ?> --EXPECTF-- *** Testing unlink() : error conditions *** --- Testing unlink() on unexpected no. of arguments -- - -Warning: unlink() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: unlink() expects at most 2 parameters, 3 given in %s on line %d -bool(false) -bool(true) -- Testing unlink() on invalid arguments -- @@ -88,12 +67,6 @@ Warning: unlink(): %s in %s on line %d bool(false) bool(false) -Warning: unlink() expects parameter 2 to be resource, string given in %s on line %d -bool(false) - -Warning: unlink() expects parameter 2 to be resource, bool given in %s on line %d -bool(false) - -- Testing unlink() on non-existent file -- Warning: unlink(%s/non_existent_file.tmp): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/unlink_error.phpt b/ext/standard/tests/file/unlink_error.phpt index 61aac03dd3..e5f809df05 100644 --- a/ext/standard/tests/file/unlink_error.phpt +++ b/ext/standard/tests/file/unlink_error.phpt @@ -8,9 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype : bool unlink ( string $filename [, resource $context] ); - Description : Deletes filename -*/ $file_path = __DIR__; @@ -23,27 +20,16 @@ $context = stream_context_create(); echo "*** Testing unlink() : error conditions ***\n"; -echo "-- Testing unlink() on unexpected no. of arguments --\n"; -// arg < expected -var_dump( unlink() ); -// args > expected -var_dump( unlink($filename, $context, true) ); -var_dump( file_exists($filename) ); // expected true - echo "\n-- Testing unlink() on invalid arguments --\n"; // invalid arguments var_dump( unlink('') ); // $filename as empty string -var_dump( file_exists('') ); // confirm file doesnt exist +var_dump( file_exists('') ); // confirm file doesn't exist var_dump( unlink(NULL) ); // $filename as NULL -var_dump( file_exists(NULL) ); // confirm file doesnt exist +var_dump( file_exists(NULL) ); // confirm file doesn't exist var_dump( unlink(false) ); // $filename as boolean false -var_dump( file_exists(false) ); // confirm file doesnt exist - -var_dump( unlink($filename, '') ); // $context as empty string -var_dump( unlink($filename, false) ); // $context as boolean false - +var_dump( file_exists(false) ); // confirm file doesn't exist echo "\n-- Testing unlink() on non-existent file --\n"; var_dump( unlink(__DIR__."/non_existent_file.tmp") ); @@ -65,14 +51,6 @@ rmdir(__DIR__."/unlink_error"); ?> --EXPECTF-- *** Testing unlink() : error conditions *** --- Testing unlink() on unexpected no. of arguments -- - -Warning: unlink() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: unlink() expects at most 2 parameters, 3 given in %s on line %d -bool(false) -bool(true) -- Testing unlink() on invalid arguments -- @@ -88,12 +66,6 @@ Warning: unlink(): %s in %s on line %d bool(false) bool(false) -Warning: unlink() expects parameter 2 to be resource, string given in %s on line %d -bool(false) - -Warning: unlink() expects parameter 2 to be resource, bool given in %s on line %d -bool(false) - -- Testing unlink() on non-existent file -- Warning: unlink(%s/non_existent_file.tmp): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/unlink_variation1-win32-mb.phpt b/ext/standard/tests/file/unlink_variation1-win32-mb.phpt index 65d70bd67d..8d2a80726a 100644 --- a/ext/standard/tests/file/unlink_variation1-win32-mb.phpt +++ b/ext/standard/tests/file/unlink_variation1-win32-mb.phpt @@ -8,9 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype : bool unlink ( string $filename [, resource $context] ); - Description : Deletes filename -*/ /* Delete file having default permission but its dir having readonly permission Delete file having readonly permission but dir having default permission diff --git a/ext/standard/tests/file/unlink_variation1-win32.phpt b/ext/standard/tests/file/unlink_variation1-win32.phpt index 7be1421f77..813e4a2e77 100644 --- a/ext/standard/tests/file/unlink_variation1-win32.phpt +++ b/ext/standard/tests/file/unlink_variation1-win32.phpt @@ -8,9 +8,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype : bool unlink ( string $filename [, resource $context] ); - Description : Deletes filename -*/ /* Delete file having default permission but its dir having readonly permission Delete file having readonly permission but dir having default permission diff --git a/ext/standard/tests/file/unlink_variation1.phpt b/ext/standard/tests/file/unlink_variation1.phpt index 1c4569a5fd..eafdf92f1f 100644 --- a/ext/standard/tests/file/unlink_variation1.phpt +++ b/ext/standard/tests/file/unlink_variation1.phpt @@ -9,9 +9,6 @@ require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php -/* Prototype : bool unlink ( string $filename [, resource $context] ); - Description : Deletes filename -*/ /* Delete file having default permission but its dir having readonly permission Delete file having readonly permission but dir having default permission diff --git a/ext/standard/tests/file/unlink_variation10.phpt b/ext/standard/tests/file/unlink_variation10.phpt index 585b8f87fb..127b070d23 100644 --- a/ext/standard/tests/file/unlink_variation10.phpt +++ b/ext/standard/tests/file/unlink_variation10.phpt @@ -10,12 +10,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype : bool unlink(string filename[, context context]) - * Description: Delete a file - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing unlink() : variation ***\n"; $workDir = "unlinkVar10.tmp"; @@ -56,18 +50,18 @@ rmdir($workDir); function test_link($linkedDir, $toLinkTo, $tounlink, $softlink) { if ($softlink == true) { - symlink($toLinkTo, $linkedDir); - $msg = "soft link"; + symlink($toLinkTo, $linkedDir); + $msg = "soft link"; } else { - link($toLinkTo, $linkedDir); - $msg = "hard link"; + link($toLinkTo, $linkedDir); + $msg = "hard link"; } echo "-- unlinking $msg $tounlink --\n"; $res = unlink($tounlink); if ($res === true) { if (is_link($tounlink) === false) { - echo "directory unlinked\n"; + echo "directory unlinked\n"; } else { echo "FAILED: directory not unlinked\n"; @@ -80,7 +74,6 @@ function test_link($linkedDir, $toLinkTo, $tounlink, $softlink) { ?> -===DONE=== --EXPECTF-- *** Testing unlink() : variation *** -- unlinking soft link unlinkVar10.tmp/subDir.tmp -- @@ -103,4 +96,3 @@ directory unlinked --- try to unlink a directory --- Warning: unlink(unlinkVar10.tmp/linkme.tmp): %s in %s on line %d -===DONE=== diff --git a/ext/standard/tests/file/unlink_variation2.phpt b/ext/standard/tests/file/unlink_variation2.phpt index 09fa7dac74..b45395b684 100644 --- a/ext/standard/tests/file/unlink_variation2.phpt +++ b/ext/standard/tests/file/unlink_variation2.phpt @@ -2,9 +2,6 @@ Test unlink() function : usage variations - unlink file in use --FILE-- <?php -/* Prototype : bool unlink ( string $filename [, resource $context] ); - Description : Deletes filename -*/ /* Try to unlink file when file handle is still in use */ diff --git a/ext/standard/tests/file/unlink_variation3.phpt b/ext/standard/tests/file/unlink_variation3.phpt index 1cab0630a6..558d47708e 100644 --- a/ext/standard/tests/file/unlink_variation3.phpt +++ b/ext/standard/tests/file/unlink_variation3.phpt @@ -8,9 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype : bool unlink ( string $filename [, resource $context] ); - Description : Deletes filename -*/ /* Delete link files - soft and hard links */ diff --git a/ext/standard/tests/file/unlink_variation4.phpt b/ext/standard/tests/file/unlink_variation4.phpt index bc88b48adf..99dd0c632d 100644 --- a/ext/standard/tests/file/unlink_variation4.phpt +++ b/ext/standard/tests/file/unlink_variation4.phpt @@ -2,9 +2,6 @@ Test unlink() function : usage variations - unlink deleted file --FILE-- <?php -/* Prototype : bool unlink ( string $filename [, resource $context] ); - Description : Deletes filename -*/ /* Try deleting a file which is already deleted */ diff --git a/ext/standard/tests/file/unlink_variation5.phpt b/ext/standard/tests/file/unlink_variation5.phpt index bb6fd4b884..877a8704d8 100644 --- a/ext/standard/tests/file/unlink_variation5.phpt +++ b/ext/standard/tests/file/unlink_variation5.phpt @@ -8,9 +8,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype : bool unlink ( string $filename [, resource $context] ); - Description : Deletes filename -*/ /* delete files with different file permission(0000 to 0777) */ diff --git a/ext/standard/tests/file/unlink_variation6.phpt b/ext/standard/tests/file/unlink_variation6.phpt index 64c009bf91..0a2743337c 100644 --- a/ext/standard/tests/file/unlink_variation6.phpt +++ b/ext/standard/tests/file/unlink_variation6.phpt @@ -4,12 +4,6 @@ Test unlink() function : variation Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Prototype : bool unlink(string filename[, context context]) - * Description: Delete a file - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing unlink() : variation: contexts and relative files ***\n"; // test relative directories and stream contexts. @@ -32,10 +26,8 @@ function f_exists($file) { } } ?> -===DONE=== --EXPECT-- *** Testing unlink() : variation: contexts and relative files *** subdir/testfile.txt exists bool(true) subdir/testfile.txt doesn't exist -===DONE=== diff --git a/ext/standard/tests/file/unlink_variation8-win32.phpt b/ext/standard/tests/file/unlink_variation8-win32.phpt index 9ee6b49d2a..12ace11fc1 100644 --- a/ext/standard/tests/file/unlink_variation8-win32.phpt +++ b/ext/standard/tests/file/unlink_variation8-win32.phpt @@ -10,12 +10,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype : bool unlink(string filename[, context context]) - * Description: Delete a file - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing unlink() : variation ***\n"; $workDir = "unlinkVar8.tmp"; @@ -65,7 +59,7 @@ function test_realfile($file, $tounlink) { $res = unlink($tounlink); if ($res === true) { if (file_exists($tounlink) === false) { - echo "file removed\n"; + echo "file removed\n"; } else { echo "FAILED: file not removed\n"; @@ -76,7 +70,6 @@ function test_realfile($file, $tounlink) { } } ?> -===DONE=== --EXPECTF-- *** Testing unlink() : variation *** -- removing unlinkVar8.tmp/file.tmp -- @@ -110,4 +103,3 @@ Warning: unlink(%s/unlinkVar8.tmp/file.tmp/): No such file or directory in %s on file removed -- removing %s//unlinkVar8.tmp//file.tmp -- file removed -===DONE=== diff --git a/ext/standard/tests/file/unlink_variation8.phpt b/ext/standard/tests/file/unlink_variation8.phpt index ab074c7849..71eca9199a 100644 --- a/ext/standard/tests/file/unlink_variation8.phpt +++ b/ext/standard/tests/file/unlink_variation8.phpt @@ -10,12 +10,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* Prototype : bool unlink(string filename[, context context]) - * Description: Delete a file - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing unlink() : variation ***\n"; $workDir = "unlinkVar8.tmp"; @@ -70,7 +64,7 @@ function test_realfile($file, $tounlink) { $res = unlink($tounlink); if ($res === true) { if (file_exists($tounlink) === false) { - echo "file removed\n"; + echo "file removed\n"; } else { echo "FAILED: file not removed\n"; @@ -83,18 +77,18 @@ function test_realfile($file, $tounlink) { function test_link($linkedfile, $toLinkTo, $tounlink, $softlink) { if ($softlink == true) { - symlink($toLinkTo, $linkedfile); - $msg = "soft link"; + symlink($toLinkTo, $linkedfile); + $msg = "soft link"; } else { - link($toLinkTo, $linkedfile); - $msg = "hard link"; + link($toLinkTo, $linkedfile); + $msg = "hard link"; } echo "-- unlinking $msg $tounlink --\n"; $res = unlink($tounlink); if ($res === true) { if (file_exists($tounlink) === false) { - echo "file unlinked\n"; + echo "file unlinked\n"; } else { echo "FAILED: file not unlinked\n"; @@ -107,7 +101,6 @@ function test_link($linkedfile, $toLinkTo, $tounlink, $softlink) { ?> -===DONE=== --EXPECTF-- *** Testing unlink() : variation *** -- removing unlinkVar8.tmp/file.tmp -- @@ -203,4 +196,3 @@ file removed file unlinked -- unlinking hard link /%s//unlinkVar8.tmp//file.tmp -- file unlinked -===DONE=== diff --git a/ext/standard/tests/file/unlink_variation9-win32.phpt b/ext/standard/tests/file/unlink_variation9-win32.phpt index 2331c9edc8..a69c27088e 100644 --- a/ext/standard/tests/file/unlink_variation9-win32.phpt +++ b/ext/standard/tests/file/unlink_variation9-win32.phpt @@ -10,12 +10,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php -/* Prototype : bool unlink(string filename[, context context]) - * Description: Delete a file - * Source code: ext/standard/file.c - * Alias to functions: - */ - echo "*** Testing unlink() : variation ***\n"; $workDir = "unlinkVar9.tmp"; @@ -58,14 +52,14 @@ $files = array( foreach($files as $fileToUnlink) { - $file = $workDir.'/'.$tmpFile; - $tounlink = $fileToUnlink; + $file = $workDir.'/'.$tmpFile; + $tounlink = $fileToUnlink; touch($file); echo "-- removing $tounlink --\n"; $res = unlink($tounlink); if ($res === true) { if (file_exists($tounlink) === false) { - echo "file removed\n"; + echo "file removed\n"; } else { echo "FAILED: file not removed\n"; @@ -78,7 +72,6 @@ foreach($files as $fileToUnlink) { rmdir($workDir); ?> -===DONE=== --EXPECTF-- *** Testing unlink() : variation *** -- removing unlinkVar9.tmp\file.tmp -- @@ -114,4 +107,3 @@ file removed file removed -- removing /%s/unlinkVar9.tmp/file.tmp -- file removed -===DONE=== diff --git a/ext/standard/tests/file/userdirstream.phpt b/ext/standard/tests/file/userdirstream.phpt index a83e899b83..e2f03dabb7 100644 --- a/ext/standard/tests/file/userdirstream.phpt +++ b/ext/standard/tests/file/userdirstream.phpt @@ -3,33 +3,33 @@ Directory Streams --FILE-- <?php class test { - public $idx = 0; + public $idx = 0; - function dir_opendir($path, $options) { - print "Opening\n"; - $this->idx = 0; + function dir_opendir($path, $options) { + print "Opening\n"; + $this->idx = 0; - return true; - } + return true; + } - function dir_readdir() { - $sample = array('first','second','third','fourth'); + function dir_readdir() { + $sample = array('first','second','third','fourth'); - if ($this->idx >= count($sample)) return false; - else return $sample[$this->idx++]; - } + if ($this->idx >= count($sample)) return false; + else return $sample[$this->idx++]; + } - function dir_rewinddir() { - $this->idx = 0; + function dir_rewinddir() { + $this->idx = 0; - return true; - } + return true; + } - function dir_closedir() { - print "Closing up!\n"; + function dir_closedir() { + print "Closing up!\n"; - return true; - } + return true; + } } stream_wrapper_register('test', 'test'); diff --git a/ext/standard/tests/file/userstreams.phpt b/ext/standard/tests/file/userstreams.phpt index 790b74a0c3..5b753e02e4 100644 --- a/ext/standard/tests/file/userstreams.phpt +++ b/ext/standard/tests/file/userstreams.phpt @@ -22,7 +22,7 @@ call me what you will Free to speak my mind anywhere and Ill redefine anywhere Anywhere I roam - Where I lay my head is home + Where I lay my head is home ...and the earth becomes my throne I adapt to the unknown under wandering stars Ive grown @@ -38,12 +38,12 @@ call me what you will Free to speak my mind anywhere and Ill never mind anywhere Anywhere I roam - Where I lay my head is home + Where I lay my head is home But Ill take my time anywhere Free to speak my mind anywhere and Ill take my find anywhere Anywhere I roam - Where I lay my head is home + Where I lay my head is home carved upon my stone my body lie but still I roam Wherever I may roam. @@ -57,10 +57,10 @@ EOD; * to seek around... */ $DATA = ""; for ($i = 0; $i < 30; $i++) { - if ($i % 2 == 0) - $DATA .= str_rot13($lyrics); - else - $DATA .= $lyrics; + if ($i % 2 == 0) + $DATA .= str_rot13($lyrics); + else + $DATA .= $lyrics; } /* store the data in a regular file so that we can compare @@ -70,10 +70,10 @@ fwrite($tf, $DATA); $n = ftell($tf); rewind($tf) or die("failed to rewind tmp file!"); if (ftell($tf) != 0) - die("tmpfile is not at start!"); + die("tmpfile is not at start!"); $DATALEN = strlen($DATA); if ($n != $DATALEN) - die("tmpfile stored $n bytes; should be $DATALEN!"); + die("tmpfile stored $n bytes; should be $DATALEN!"); class uselessstream { @@ -81,150 +81,150 @@ class uselessstream class mystream { - public $path; - public $mode; - public $options; - - public $position; - public $varname; - - function stream_open($path, $mode, $options, &$opened_path) - { - $this->path = $path; - $this->mode = $mode; - $this->options = $options; - - $split = parse_url($path); - $this->varname = $split["host"]; - - if (strchr($mode, 'a')) - $this->position = strlen($GLOBALS[$this->varname]); - else - $this->position = 0; - - return true; - } - - function stream_read($count) - { - $ret = substr($GLOBALS[$this->varname], $this->position, $count); - $this->position += strlen($ret); - return $ret; - } - - function stream_tell() - { - return $this->position; - } - - function stream_eof() - { - return $this->position >= strlen($GLOBALS[$this->varname]); - } - - function stream_seek($offset, $whence) - { - switch($whence) { - case SEEK_SET: - if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { - $this->position = $offset; - return true; - } else { - return false; - } - break; - case SEEK_CUR: - if ($offset >= 0) { - $this->position += $offset; - return true; - } else { - return false; - } - break; - case SEEK_END: - if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { - $this->position = strlen($GLOBALS[$this->varname]) + $offset; - return true; - } else { - return false; - } - break; - default: - return false; - } - } + public $path; + public $mode; + public $options; + + public $position; + public $varname; + + function stream_open($path, $mode, $options, &$opened_path) + { + $this->path = $path; + $this->mode = $mode; + $this->options = $options; + + $split = parse_url($path); + $this->varname = $split["host"]; + + if (strchr($mode, 'a')) + $this->position = strlen($GLOBALS[$this->varname]); + else + $this->position = 0; + + return true; + } + + function stream_read($count) + { + $ret = substr($GLOBALS[$this->varname], $this->position, $count); + $this->position += strlen($ret); + return $ret; + } + + function stream_tell() + { + return $this->position; + } + + function stream_eof() + { + return $this->position >= strlen($GLOBALS[$this->varname]); + } + + function stream_seek($offset, $whence) + { + switch($whence) { + case SEEK_SET: + if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { + $this->position = $offset; + return true; + } else { + return false; + } + break; + case SEEK_CUR: + if ($offset >= 0) { + $this->position += $offset; + return true; + } else { + return false; + } + break; + case SEEK_END: + if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { + $this->position = strlen($GLOBALS[$this->varname]) + $offset; + return true; + } else { + return false; + } + break; + default: + return false; + } + } } if (@stream_wrapper_register("bogus", "class_not_exist")) { - die("Registered a non-existent class!!!???"); + die("Registered a non-existent class!!!???"); } echo "Not Registered\n"; if (!stream_wrapper_register("test", "mystream")) { - die("test wrapper registration failed"); + die("test wrapper registration failed"); } echo "Registered\n"; if (!stream_wrapper_register("bogon", "uselessstream")) { - die("bogon wrapper registration failed"); + die("bogon wrapper registration failed"); } echo "Registered\n"; $b = @fopen("bogon://url", "rb"); if (is_resource($b)) { - die("Opened a bogon??"); + die("Opened a bogon??"); } $fp = fopen("test://DATA", "rb"); if (!$fp || !is_resource($fp)) { - die("Failed to open resource"); + die("Failed to open resource"); } /* some default seeks that will cause buffer/cache misses */ $seeks = array( - array(SEEK_SET, 0, 0), - array(SEEK_CUR, 8450, 8450), - array(SEEK_CUR, -7904, 546), - array(SEEK_CUR, 12456, 13002), - - /* end up at BOF so that randomly generated seek offsets - * below will know where they are supposed to be */ - array(SEEK_SET, 0, 0) + array(SEEK_SET, 0, 0), + array(SEEK_CUR, 8450, 8450), + array(SEEK_CUR, -7904, 546), + array(SEEK_CUR, 12456, 13002), + + /* end up at BOF so that randomly generated seek offsets + * below will know where they are supposed to be */ + array(SEEK_SET, 0, 0) ); $whence_map = array( - SEEK_CUR, - SEEK_SET, - SEEK_END + SEEK_CUR, + SEEK_SET, + SEEK_END ); $whence_names = array( - SEEK_CUR => "SEEK_CUR", - SEEK_SET => "SEEK_SET", - SEEK_END => "SEEK_END" - ); + SEEK_CUR => "SEEK_CUR", + SEEK_SET => "SEEK_SET", + SEEK_END => "SEEK_END" + ); /* generate some random seek offsets */ $position = 0; for ($i = 0; $i < 256; $i++) { - $whence = $whence_map[array_rand($whence_map, 1)]; - switch($whence) { - case SEEK_SET: - $offset = rand(0, $DATALEN - 1); - $position = $offset; - break; - case SEEK_END: - $offset = -rand(0, $DATALEN - 1); - $position = $DATALEN + $offset; - break; - case SEEK_CUR: - $offset = rand(0, $DATALEN - 1); - $offset -= $position; - $position += $offset; - break; - } - - $seeks[] = array($whence, $offset, $position); + $whence = $whence_map[array_rand($whence_map, 1)]; + switch($whence) { + case SEEK_SET: + $offset = rand(0, $DATALEN - 1); + $position = $offset; + break; + case SEEK_END: + $offset = -rand(0, $DATALEN - 1); + $position = $DATALEN + $offset; + break; + case SEEK_CUR: + $offset = rand(0, $DATALEN - 1); + $offset -= $position; + $position += $offset; + break; + } + + $seeks[] = array($whence, $offset, $position); } /* we compare the results of fgets using differing line lengths to @@ -234,50 +234,50 @@ $fail_count = 0; ob_start(); foreach($line_lengths as $line_length) { - /* now compare the real stream with the user stream */ - $j = 0; - rewind($tf); - rewind($fp); - foreach($seeks as $seekdata) { - list($whence, $offset, $position) = $seekdata; - - $rpb = ftell($tf); - $rr = (int)fseek($tf, $offset, $whence); - $rpa = ftell($tf); - $rline = fgets($tf, $line_length); - (int)fseek($tf, - strlen($rline), SEEK_CUR); - - $upb = ftell($fp); - $ur = (int)fseek($fp, $offset, $whence); - $upa = ftell($fp); - $uline = fgets($fp, $line_length); - (int)fseek($fp, - strlen($uline), SEEK_CUR); - - printf("\n--[%d] whence=%s offset=%d line_length=%d position_should_be=%d --\n", - $j, $whence_names[$whence], $offset, $line_length, $position); - printf("REAL: pos=(%d,%d,%d) ret=%d line[%d]=`%s'\n", $rpb, $rpa, ftell($tf), $rr, strlen($rline), $rline); - printf("USER: pos=(%d,%d,%d) ret=%d line[%d]=`%s'\n", $upb, $upa, ftell($fp), $ur, strlen($uline), $uline); - - if ($rr != $ur || $rline != $uline || $rpa != $position || $upa != $position) { - $fail_count++; - echo "###################################### FAIL!\n"; - $dat = stream_get_meta_data($fp); - var_dump($dat); - break; - } - - $j++; - } - if ($fail_count) - break; + /* now compare the real stream with the user stream */ + $j = 0; + rewind($tf); + rewind($fp); + foreach($seeks as $seekdata) { + list($whence, $offset, $position) = $seekdata; + + $rpb = ftell($tf); + $rr = (int)fseek($tf, $offset, $whence); + $rpa = ftell($tf); + $rline = fgets($tf, $line_length); + (int)fseek($tf, - strlen($rline), SEEK_CUR); + + $upb = ftell($fp); + $ur = (int)fseek($fp, $offset, $whence); + $upa = ftell($fp); + $uline = fgets($fp, $line_length); + (int)fseek($fp, - strlen($uline), SEEK_CUR); + + printf("\n--[%d] whence=%s offset=%d line_length=%d position_should_be=%d --\n", + $j, $whence_names[$whence], $offset, $line_length, $position); + printf("REAL: pos=(%d,%d,%d) ret=%d line[%d]=`%s'\n", $rpb, $rpa, ftell($tf), $rr, strlen($rline), $rline); + printf("USER: pos=(%d,%d,%d) ret=%d line[%d]=`%s'\n", $upb, $upa, ftell($fp), $ur, strlen($uline), $uline); + + if ($rr != $ur || $rline != $uline || $rpa != $position || $upa != $position) { + $fail_count++; + echo "###################################### FAIL!\n"; + $dat = stream_get_meta_data($fp); + var_dump($dat); + break; + } + + $j++; + } + if ($fail_count) + break; } if ($fail_count == 0) { - ob_end_clean(); - echo "SEEK: OK\n"; + ob_end_clean(); + echo "SEEK: OK\n"; } else { - echo "SEEK: FAIL\n"; - ob_end_flush(); + echo "SEEK: FAIL\n"; + ob_end_flush(); } $fail_count = 0; @@ -286,23 +286,23 @@ fseek($fp, $DATALEN / 2, SEEK_SET); fseek($tf, $DATALEN / 2, SEEK_SET); if (ftell($fp) != ftell($tf)) { - echo "SEEK: positions do not match!\n"; + echo "SEEK: positions do not match!\n"; } $n = 0; while(!feof($fp)) { - $uline = fgets($fp, 1024); - $rline = fgets($tf, 1024); - - if ($uline != $rline) { - echo "FGETS: FAIL\niter=$n user=$uline [pos=" . ftell($fp) . "]\nreal=$rline [pos=" . ftell($tf) . "]\n"; - $fail_count++; - break; - } + $uline = fgets($fp, 1024); + $rline = fgets($tf, 1024); + + if ($uline != $rline) { + echo "FGETS: FAIL\niter=$n user=$uline [pos=" . ftell($fp) . "]\nreal=$rline [pos=" . ftell($tf) . "]\n"; + $fail_count++; + break; + } } if ($fail_count == 0) { - echo "FGETS: OK\n"; + echo "FGETS: OK\n"; } /* One final test to see if the position is respected when opened for append */ diff --git a/ext/standard/tests/file/userstreams_002.phpt b/ext/standard/tests/file/userstreams_002.phpt index 81f463ddd2..95e085947f 100644 --- a/ext/standard/tests/file/userstreams_002.phpt +++ b/ext/standard/tests/file/userstreams_002.phpt @@ -3,26 +3,30 @@ User-space streams: stream_cast() --FILE-- <?php class test_wrapper_base { - public $return_value; - function stream_open($path, $mode, $openedpath) { - return true; - } - function stream_eof() { - return false; - } + public $return_value; + function stream_open($path, $mode, $openedpath) { + return true; + } + function stream_eof() { + return false; + } } class test_wrapper extends test_wrapper_base { - function stream_cast($castas) { - return $this->return_value; - } + function stream_cast($castas) { + return $this->return_value; + } } function test($name, $fd, $return_value) { - echo "\n------ $name: -------\n"; - $data = stream_get_meta_data($fd); - $data['wrapper_data']->return_value = $return_value; - $r = array($fd); - $w = $e = null; - var_dump(stream_select($r, $w, $e, 0) !== false); + echo "\n------ $name: -------\n"; + $data = stream_get_meta_data($fd); + $data['wrapper_data']->return_value = $return_value; + $r = array($fd); + $w = $e = null; + try { + var_dump(stream_select($r, $w, $e, 0) !== false); + } catch (TypeError|ValueError $e) { + echo $e->getMessage(), "\n"; + } } var_dump(stream_wrapper_register('test', 'test_wrapper')); @@ -50,45 +54,33 @@ bool(true) Warning: stream_select(): test_wrapper_base::stream_cast is not implemented! in %s -Warning: stream_select(): cannot represent a stream of type user-space as a select()able descriptor in %s - -Warning: stream_select(): No stream arrays were passed in %s -bool(false) +Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s +No stream arrays were passed ------ return value is false: ------- -Warning: stream_select(): cannot represent a stream of type user-space as a select()able descriptor in %s - -Warning: stream_select(): No stream arrays were passed in %s -bool(false) +Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s +No stream arrays were passed ------ return value not a stream resource: ------- -Warning: stream_select(): supplied argument is not a valid stream resource in %s - Warning: stream_select(): test_wrapper::stream_cast must return a stream resource in %s -Warning: stream_select(): cannot represent a stream of type user-space as a select()able descriptor in %s - -Warning: stream_select(): No stream arrays were passed in %s -bool(false) +Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s +No stream arrays were passed ------ return value is stream itself: ------- Warning: stream_select(): test_wrapper::stream_cast must not return itself in %s -Warning: stream_select(): cannot represent a stream of type user-space as a select()able descriptor in %s - -Warning: stream_select(): No stream arrays were passed in %s -bool(false) +Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s +No stream arrays were passed ------ return value cannot be casted: ------- Warning: stream_select(): test_wrapper_base::stream_cast is not implemented! in %s -Warning: stream_select(): cannot represent a stream of type user-space as a select()able descriptor in %s - -Warning: stream_select(): cannot represent a stream of type user-space as a select()able descriptor in %s +Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s -Warning: stream_select(): No stream arrays were passed in %s -bool(false) +Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s +No stream arrays were passed diff --git a/ext/standard/tests/file/userstreams_003.phpt b/ext/standard/tests/file/userstreams_003.phpt index 9ee71f2666..686963adf7 100644 --- a/ext/standard/tests/file/userstreams_003.phpt +++ b/ext/standard/tests/file/userstreams_003.phpt @@ -3,37 +3,37 @@ User-space streams: stream_set_option() --FILE-- <?php class test_wrapper_base { - public $return_value; - public $expected_option; - public $expected_value; - function stream_open($path, $mode, $openedpath) { - return true; - } - function stream_eof() { - return false; - } + public $return_value; + public $expected_option; + public $expected_value; + function stream_open($path, $mode, $openedpath) { + return true; + } + function stream_eof() { + return false; + } } class test_wrapper extends test_wrapper_base { - function stream_set_option($option, $value, $ptrparam) { - echo "value:\n"; - var_dump($value); - echo "ptrparam:\n"; - var_dump($ptrparam); - echo "\$option === $option === " . $this->expected_option . ":\n"; - var_dump($option === $this->expected_option); - echo "\$value === $value === " . $this->expected_value. ":\n"; - var_dump($value === $this->expected_value); - return $this->return_value; - } + function stream_set_option($option, $value, $ptrparam) { + echo "value:\n"; + var_dump($value); + echo "ptrparam:\n"; + var_dump($ptrparam); + echo "\$option === $option === " . $this->expected_option . ":\n"; + var_dump($option === $this->expected_option); + echo "\$value === $value === " . $this->expected_value. ":\n"; + var_dump($value === $this->expected_value); + return $this->return_value; + } } function test($name, $fd, $return_value, $func, $args, $expected_option, $expected_value) { - echo "\n------ $name: -------\n"; - $data = stream_get_meta_data($fd); - $data['wrapper_data']->return_value = $return_value; - $data['wrapper_data']->expected_option = $expected_option; - $data['wrapper_data']->expected_value = $expected_value; - var_dump(call_user_func_array($func, $args)); + echo "\n------ $name: -------\n"; + $data = stream_get_meta_data($fd); + $data['wrapper_data']->return_value = $return_value; + $data['wrapper_data']->expected_option = $expected_option; + $data['wrapper_data']->expected_value = $expected_value; + var_dump(call_user_func_array($func, $args)); } var_dump(stream_wrapper_register('test', 'test_wrapper')); diff --git a/ext/standard/tests/file/userstreams_004.phpt b/ext/standard/tests/file/userstreams_004.phpt index da9f148b5d..df1a9f3604 100644 --- a/ext/standard/tests/file/userstreams_004.phpt +++ b/ext/standard/tests/file/userstreams_004.phpt @@ -3,24 +3,24 @@ User-space streams: stream_lock() --FILE-- <?php class test_wrapper_base { - public $mode; - function stream_open($path, $mode, $openedpath) { - return true; - } - function stream_eof() { - return false; - } + public $mode; + function stream_open($path, $mode, $openedpath) { + return true; + } + function stream_eof() { + return false; + } } class test_wrapper extends test_wrapper_base { - function stream_lock($mode) { - $this->mode = $mode; - } + function stream_lock($mode) { + $this->mode = $mode; + } } function test($name, $fd, $mode) { - echo "------ $name: -------\n"; - flock($fd, $mode); - $data = stream_get_meta_data($fd); - var_dump($data['wrapper_data']->mode === $mode); + echo "------ $name: -------\n"; + flock($fd, $mode); + $data = stream_get_meta_data($fd); + var_dump($data['wrapper_data']->mode === $mode); } var_dump(stream_wrapper_register('test', 'test_wrapper')); @@ -32,8 +32,8 @@ $fd2 = fopen("test2://foo","r"); test("stream_lock not implemented", $fd2, LOCK_EX); foreach(array("LOCK_SH","LOCK_EX","LOCK_UN") as $mode) { - test("fclock($mode)", $fd, constant($mode)); - test("fclock($mode|LOCK_NB)", $fd, constant($mode)|LOCK_NB); + test("fclock($mode)", $fd, constant($mode)); + test("fclock($mode|LOCK_NB)", $fd, constant($mode)|LOCK_NB); } ?> diff --git a/ext/standard/tests/file/userstreams_005.phpt b/ext/standard/tests/file/userstreams_005.phpt index a2af1b4086..e553e1c8ee 100644 --- a/ext/standard/tests/file/userstreams_005.phpt +++ b/ext/standard/tests/file/userstreams_005.phpt @@ -3,29 +3,29 @@ User-space streams: stream_truncate() --FILE-- <?php class test_wrapper_base { - public $mode; - function stream_open($path, $mode, $openedpath) { - return true; - } - function stream_eof() { - return false; - } + public $mode; + function stream_open($path, $mode, $openedpath) { + return true; + } + function stream_eof() { + return false; + } } class test_wrapper extends test_wrapper_base { - function stream_truncate($new_size) { - echo "truncation with new_size=$new_size\n"; - return true; - } + function stream_truncate($new_size) { + echo "truncation with new_size=$new_size\n"; + return true; + } } class test_wrapper_bad extends test_wrapper_base { - function stream_truncate($new_size) { - echo "truncation with new_size=$new_size\n"; - return "kkk"; - } + function stream_truncate($new_size) { + echo "truncation with new_size=$new_size\n"; + return "kkk"; + } } function test($name, $fd, $dest_size) { - echo "------ $name: -------\n"; - var_dump(ftruncate($fd, $dest_size)); + echo "------ $name: -------\n"; + var_dump(ftruncate($fd, $dest_size)); } var_dump(stream_wrapper_register('test', 'test_wrapper')); var_dump(stream_wrapper_register('test2', 'test_wrapper_base')); @@ -38,7 +38,11 @@ $fd3 = fopen("test3://foo","r"); test("stream_truncate not implemented", $fd2, 0); test("stream_truncate size 0", $fd, 0); test("stream_truncate size 10", $fd, 10); -test("stream_truncate negative size", $fd, -1); +try { + test("stream_truncate negative size", $fd, -1); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} test("stream_truncate bad return", $fd3, 0); --EXPECTF-- bool(true) @@ -55,9 +59,7 @@ bool(true) truncation with new_size=10 bool(true) ------ stream_truncate negative size: ------- - -Warning: ftruncate(): Negative size is not supported in %s on line %d -bool(false) +ftruncate(): Argument #2 ($size) must be greater than or equal to 0 ------ stream_truncate bad return: ------- truncation with new_size=0 diff --git a/ext/standard/tests/file/userstreams_006.phpt b/ext/standard/tests/file/userstreams_006.phpt index c434f4cc62..561bea4fb5 100644 --- a/ext/standard/tests/file/userstreams_006.phpt +++ b/ext/standard/tests/file/userstreams_006.phpt @@ -3,20 +3,20 @@ User-space streams: set_options returns "not implemented" for unhandled option t --FILE-- <?php class test_wrapper { - function stream_open($path, $mode, $openedpath) { - return true; - } - function stream_eof() { - return false; - } - function stream_write($data) { - echo "size: ", strlen($data), "\n"; - return strlen($data); - } - function stream_set_option($option, $arg1, $arg2) { - echo "option: ", $option, ", ", $arg1, ", ", $arg2, "\n"; - return false; - } + function stream_open($path, $mode, $openedpath) { + return true; + } + function stream_eof() { + return false; + } + function stream_write($data) { + echo "size: ", strlen($data), "\n"; + return strlen($data); + } + function stream_set_option($option, $arg1, $arg2) { + echo "option: ", $option, ", ", $arg1, ", ", $arg2, "\n"; + return false; + } } var_dump(stream_wrapper_register('test', 'test_wrapper')); @@ -32,6 +32,5 @@ bool(true) option: 3, 2, 50 int(-1) int(8192) -size: 42 -size: 28 +size: 70 int(70) diff --git a/ext/standard/tests/file/userstreams_007.phpt b/ext/standard/tests/file/userstreams_007.phpt index b3e52bb098..31a7e4f872 100644 --- a/ext/standard/tests/file/userstreams_007.phpt +++ b/ext/standard/tests/file/userstreams_007.phpt @@ -3,19 +3,19 @@ User-space streams: test metadata option --FILE-- <?php class test_wrapper { - function stream_open($path, $mode, $openedpath) { - return true; - } + function stream_open($path, $mode, $openedpath) { + return true; + } public function stream_metadata($path, $option, $var) { - echo "metadata: $path, $option\n"; - if(is_array($var)) { - echo join(",", $var); - } else { - echo $var; - } - echo "\n"; - return false; - } + echo "metadata: $path, $option\n"; + if(is_array($var)) { + echo join(",", $var); + } else { + echo $var; + } + echo "\n"; + return false; + } } var_dump(stream_wrapper_register('test', 'test_wrapper')); diff --git a/ext/standard/tests/file/userwrapper.phpt b/ext/standard/tests/file/userwrapper.phpt index dd4f0d3dd1..6e516d68db 100644 --- a/ext/standard/tests/file/userwrapper.phpt +++ b/ext/standard/tests/file/userwrapper.phpt @@ -20,9 +20,9 @@ class test { } function url_stat($path, $options) { - /* By printing out a notice that we are actively stating the file - then subsequently performing multiple stat operations on it - we effectively test the stat cache mechanism */ + /* By printing out a notice that we are actively stating the file + then subsequently performing multiple stat operations on it + we effectively test the stat cache mechanism */ print "Stating file: $path\n"; return array('dev'=>1, 'ino'=>2, 'mode'=>0644, 'nlink'=>3, 'uid'=>100, 'gid'=>1000, 'rdev'=>-1, 'size'=>31337, diff --git a/ext/standard/tests/file/windows_acls/bug44859.phpt b/ext/standard/tests/file/windows_acls/bug44859.phpt index 679734b379..513c3a6af8 100644 --- a/ext/standard/tests/file/windows_acls/bug44859.phpt +++ b/ext/standard/tests/file/windows_acls/bug44859.phpt @@ -12,42 +12,42 @@ include_once __DIR__ . '/common.inc'; fix_acls(); $iteration = array( - PHPT_ACL_READ => false, - PHPT_ACL_NONE => false, - PHPT_ACL_WRITE => true, - PHPT_ACL_WRITE|PHPT_ACL_READ => true, + PHPT_ACL_READ => false, + PHPT_ACL_NONE => false, + PHPT_ACL_WRITE => true, + PHPT_ACL_WRITE|PHPT_ACL_READ => true, ); echo "Testing file:\n"; $i = 1; $path = $uniqueBasePath . '_file.txt'; foreach ($iteration as $perms => $exp) { - create_file($path, $perms); - clearstatcache(true, $path); - echo 'Iteration #' . $i++ . ': '; - if (is_writable($path) == $exp) { - echo "passed.\n"; - } else { - var_dump(is_writable($path), $exp); - echo "failed.\n"; - } - delete_file($path); + create_file($path, $perms); + clearstatcache(true, $path); + echo 'Iteration #' . $i++ . ': '; + if (is_writable($path) == $exp) { + echo "passed.\n"; + } else { + var_dump(is_writable($path), $exp); + echo "failed.\n"; + } + delete_file($path); } echo "Testing directory:\n"; $path = $uniqueBasePath . '_dir'; $i = 1; foreach ($iteration as $perms => $exp) { - create_dir($path, $perms); - clearstatcache(true, $path); - echo 'Iteration #' . $i++ . ': '; - if (is_writable($path) == $exp) { - echo "passed.\n"; - } else { - var_dump(is_writable($path), $exp); - echo "failed.\n"; - } - delete_dir($path); + create_dir($path, $perms); + clearstatcache(true, $path); + echo 'Iteration #' . $i++ . ': '; + if (is_writable($path) == $exp) { + echo "passed.\n"; + } else { + var_dump(is_writable($path), $exp); + echo "failed.\n"; + } + delete_dir($path); } ?> diff --git a/ext/standard/tests/file/windows_acls/bug44859_2.phpt b/ext/standard/tests/file/windows_acls/bug44859_2.phpt index b88d07f820..4b5fd9e139 100644 --- a/ext/standard/tests/file/windows_acls/bug44859_2.phpt +++ b/ext/standard/tests/file/windows_acls/bug44859_2.phpt @@ -12,42 +12,42 @@ include_once __DIR__ . '/common.inc'; fix_acls(); $iteration = array( - PHPT_ACL_READ => true, - PHPT_ACL_NONE => false, - PHPT_ACL_WRITE => false, - PHPT_ACL_WRITE|PHPT_ACL_READ => true, + PHPT_ACL_READ => true, + PHPT_ACL_NONE => false, + PHPT_ACL_WRITE => false, + PHPT_ACL_WRITE|PHPT_ACL_READ => true, ); echo "Testing file:\n"; $i = 1; $path = $uniqueBasePath . '_file.txt'; foreach ($iteration as $perms => $exp) { - create_file($path, $perms); - clearstatcache(true, $path); - echo 'Iteration #' . $i++ . ': '; - if (is_readable($path) == $exp) { - echo "passed.\n"; - } else { - var_dump(is_readable($path), $exp); - echo "failed.\n"; - } - delete_file($path); + create_file($path, $perms); + clearstatcache(true, $path); + echo 'Iteration #' . $i++ . ': '; + if (is_readable($path) == $exp) { + echo "passed.\n"; + } else { + var_dump(is_readable($path), $exp); + echo "failed.\n"; + } + delete_file($path); } echo "Testing directory:\n"; $path = $uniqueBasePath . '_dir'; $i = 1; foreach ($iteration as $perms => $exp) { - create_dir($path, $perms); - clearstatcache(true, $path); - echo 'Iteration #' . $i++ . ': '; - if (is_readable($path) == $exp) { - echo "passed.\n"; - } else { - var_dump(is_readable($path), $exp); - echo "failed.\n"; - } - delete_dir($path); + create_dir($path, $perms); + clearstatcache(true, $path); + echo 'Iteration #' . $i++ . ': '; + if (is_readable($path) == $exp) { + echo "passed.\n"; + } else { + var_dump(is_readable($path), $exp); + echo "failed.\n"; + } + delete_dir($path); } ?> diff --git a/ext/standard/tests/file/windows_acls/bug44859_3.phpt b/ext/standard/tests/file/windows_acls/bug44859_3.phpt index 35db1f29be..465c7557ac 100644 --- a/ext/standard/tests/file/windows_acls/bug44859_3.phpt +++ b/ext/standard/tests/file/windows_acls/bug44859_3.phpt @@ -11,23 +11,23 @@ include_once __DIR__ . '/common.inc'; fix_acls(); $iteration = array( - 'tiny.exe' => true, - //'tiny.bat' => true, To be fixed in _access - __FILE__ => false + 'tiny.exe' => true, + //'tiny.bat' => true, To be fixed in _access + __FILE__ => false ); $i = 1; $path = __DIR__; foreach ($iteration as $file => $exp) { - $path = __DIR__ . '/' . $file; - echo 'Iteration #' . $i++ . ': '; - if (is_executable($path) == $exp) { - echo "passed.\n"; - } else { - var_dump(is_executable($path), $exp); - echo "failed.\n"; - } + $path = __DIR__ . '/' . $file; + echo 'Iteration #' . $i++ . ': '; + if (is_executable($path) == $exp) { + echo "passed.\n"; + } else { + var_dump(is_executable($path), $exp); + echo "failed.\n"; + } } diff --git a/ext/standard/tests/file/windows_acls/bug44859_4.phpt b/ext/standard/tests/file/windows_acls/bug44859_4.phpt index e0fbe11f4b..483438bcf6 100644 --- a/ext/standard/tests/file/windows_acls/bug44859_4.phpt +++ b/ext/standard/tests/file/windows_acls/bug44859_4.phpt @@ -14,42 +14,42 @@ include_once __DIR__ . '/common.inc'; fix_acls(); $iteration = array( - PHPT_ACL_READ => true, - PHPT_ACL_NONE => false, - PHPT_ACL_WRITE => false, - PHPT_ACL_WRITE|PHPT_ACL_READ => true, + PHPT_ACL_READ => true, + PHPT_ACL_NONE => false, + PHPT_ACL_WRITE => false, + PHPT_ACL_WRITE|PHPT_ACL_READ => true, ); echo "Testing file with relative path:\n"; $i = 1; $path = './' . $uniqueBaseName . '_file.txt'; foreach ($iteration as $perms => $exp) { - create_file($path, $perms); - clearstatcache(true, $path); - echo 'Iteration #' . $i++ . ': '; - if (is_readable($path) == $exp) { - echo "passed.\n"; - } else { - var_dump(is_readable($path), $exp); - echo "failed.\n"; - } - delete_file($path); + create_file($path, $perms); + clearstatcache(true, $path); + echo 'Iteration #' . $i++ . ': '; + if (is_readable($path) == $exp) { + echo "passed.\n"; + } else { + var_dump(is_readable($path), $exp); + echo "failed.\n"; + } + delete_file($path); } echo "Testing directory with relative path:\n"; $path = $uniqueBaseName . '_dir'; $i = 1; foreach ($iteration as $perms => $exp) { - create_dir($path, $perms); - clearstatcache(true, $path); - echo 'Iteration #' . $i++ . ': '; - if (is_readable($path) == $exp) { - echo "passed.\n"; - } else { - var_dump(is_readable($path), $exp); - echo "failed.\n"; - } - delete_dir($path); + create_dir($path, $perms); + clearstatcache(true, $path); + echo 'Iteration #' . $i++ . ': '; + if (is_readable($path) == $exp) { + echo "passed.\n"; + } else { + var_dump(is_readable($path), $exp); + echo "failed.\n"; + } + delete_dir($path); } ?> diff --git a/ext/standard/tests/file/windows_acls/common.inc b/ext/standard/tests/file/windows_acls/common.inc index 5d4b402840..b3490ebb43 100644 --- a/ext/standard/tests/file/windows_acls/common.inc +++ b/ext/standard/tests/file/windows_acls/common.inc @@ -10,161 +10,161 @@ define('PHPT_ACL_GRANT', 1); define('PHPT_ACL_DENY', 2); function skipif() { - if(substr(PHP_OS, 0, 3) != 'WIN' ) { - die('skip windows only test'); - } - if(stripos(php_uname(), 'XP') !== FALSE) { - die('skip windows 2003 or newer only test'); - } + if(substr(PHP_OS, 0, 3) != 'WIN' ) { + die('skip windows only test'); + } + if(stripos(php_uname(), 'XP') !== FALSE) { + die('skip windows 2003 or newer only test'); + } } function get_username(){ - $user = getenv('USERNAME'); + $user = getenv('USERNAME'); - if (!$user) { - $user = get_current_user(); - } + if (!$user) { + $user = get_current_user(); + } - if (!$user) { - $user = exec('echo %USERNAME%'); - } + if (!$user) { + $user = exec('echo %USERNAME%'); + } - return $user; + return $user; } function get_domainname() { - $domain = getenv('USERDOMAIN'); + $domain = getenv('USERDOMAIN'); - return $domain; + return $domain; } function get_icacls() { - $sysroot = exec('echo %SYSTEMROOT%'); + $sysroot = exec('echo %SYSTEMROOT%'); - return "$sysroot\\System32\\icacls.exe"; + return "$sysroot\\System32\\icacls.exe"; } function fix_acls() { - $user = get_username(); - /* Current user needs to be owner of the test files. As well - all the other users having acls on the files must loose them. - The following fixes this just partially, as dynamically reading - all the users having acls on a file could be sophisticated. */ - exec(get_icacls() . ' ' . __DIR__ . ' /setowner ' . escapeshellarg($user) . ' /T /L /Q /C > nul 2>&1'); - exec(get_icacls() . ' ' . __DIR__ . ' /remove:g Administrators /T /L /Q /C > nul 2>&1'); + $user = get_username(); + /* Current user needs to be owner of the test files. As well + all the other users having acls on the files must loose them. + The following fixes this just partially, as dynamically reading + all the users having acls on a file could be sophisticated. */ + exec(get_icacls() . ' ' . __DIR__ . ' /setowner ' . escapeshellarg($user) . ' /T /L /Q /C > nul 2>&1'); + exec(get_icacls() . ' ' . __DIR__ . ' /remove:g Administrators /T /L /Q /C > nul 2>&1'); } function icacls_set($path, $mode, $perm) { - $icacls = get_icacls(); - $user = get_username(); - $path_escaped = '"' . $path . '"'; - $perm_entry = array(); - - if ($perm & PHPT_ACL_READ) $perm_entry[] = 'R'; - if ($perm & PHPT_ACL_WRITE) $perm_entry[] = 'W'; - if ($perm & PHPT_ACL_EXEC) $perm_entry[] = 'RX'; - if ($perm & PHPT_ACL_FULL) $perm_entry[] = 'F'; - - // Deny all - $cmd = $icacls . ' ' . $path_escaped . ' /inheritance:r /deny ' . $user . ':(F,M,R,RX,W)'; - exec($cmd); - - if ($perm & PHPT_ACL_NONE) { - /* - This is required to remove all the previously denied - permission for the USER. Just granting permission doesn't - remove the previously denied permission. - */ - $cmd = $icacls . ' ' . $path_escaped . ' /remove:d ' . $user; - exec($cmd); - $cmd = $icacls . ' ' . $path_escaped . ' /remove:g ' . $user; - exec($cmd); - return; - } - - if ($mode == PHPT_ACL_GRANT) { - $mode = 'grant'; - } else { - $mode = 'deny'; - } - - - // Deny all - $cmd = $icacls . ' ' . $path_escaped . ' /deny ' . $user . ':(F,M,R,RX,W)'; - exec($cmd); - - /* - This is required to remove all the previously denied - permission for the USER. Just granting permission doesn't - remove the previously denied permission. - */ - $cmd = $icacls . ' ' . $path_escaped . ' /remove:d ' . $user; - exec($cmd); - $cmd = $icacls . ' ' . $path_escaped . ' /remove:g ' . $user; - exec($cmd); - - - /* - Required to set no permission and check that is_readable() - returns false. If the $perm_entry contains 'N' skip this step. - This will make the file/dir with NO aceess. - */ - if (!in_array('N', $perm_entry)) { - /* - This is required to remove all the previously denied - permission for the USER. Just granting permission doesn't - remove the previously denied permission. - */ - $cmd = $icacls . ' ' . $path_escaped . ' /remove:d ' . $user; - exec($cmd); - $cmd = $icacls . ' ' . $path_escaped . ' /remove:g ' . $user; - exec($cmd); - - $cmd = $icacls . ' ' . $path_escaped . ' /' . $mode . ' ' . $user; - $cmd .= ':' . '(' . implode(',', $perm_entry) . ')'; - exec($cmd); - } + $icacls = get_icacls(); + $user = get_username(); + $path_escaped = '"' . $path . '"'; + $perm_entry = array(); + + if ($perm & PHPT_ACL_READ) $perm_entry[] = 'R'; + if ($perm & PHPT_ACL_WRITE) $perm_entry[] = 'W'; + if ($perm & PHPT_ACL_EXEC) $perm_entry[] = 'RX'; + if ($perm & PHPT_ACL_FULL) $perm_entry[] = 'F'; + + // Deny all + $cmd = $icacls . ' ' . $path_escaped . ' /inheritance:r /deny ' . $user . ':(F,M,R,RX,W)'; + exec($cmd); + + if ($perm & PHPT_ACL_NONE) { + /* + This is required to remove all the previously denied + permission for the USER. Just granting permission doesn't + remove the previously denied permission. + */ + $cmd = $icacls . ' ' . $path_escaped . ' /remove:d ' . $user; + exec($cmd); + $cmd = $icacls . ' ' . $path_escaped . ' /remove:g ' . $user; + exec($cmd); + return; + } + + if ($mode == PHPT_ACL_GRANT) { + $mode = 'grant'; + } else { + $mode = 'deny'; + } + + + // Deny all + $cmd = $icacls . ' ' . $path_escaped . ' /deny ' . $user . ':(F,M,R,RX,W)'; + exec($cmd); + + /* + This is required to remove all the previously denied + permission for the USER. Just granting permission doesn't + remove the previously denied permission. + */ + $cmd = $icacls . ' ' . $path_escaped . ' /remove:d ' . $user; + exec($cmd); + $cmd = $icacls . ' ' . $path_escaped . ' /remove:g ' . $user; + exec($cmd); + + + /* + Required to set no permission and check that is_readable() + returns false. If the $perm_entry contains 'N' skip this step. + This will make the file/dir with NO aceess. + */ + if (!in_array('N', $perm_entry)) { + /* + This is required to remove all the previously denied + permission for the USER. Just granting permission doesn't + remove the previously denied permission. + */ + $cmd = $icacls . ' ' . $path_escaped . ' /remove:d ' . $user; + exec($cmd); + $cmd = $icacls . ' ' . $path_escaped . ' /remove:g ' . $user; + exec($cmd); + + $cmd = $icacls . ' ' . $path_escaped . ' /' . $mode . ' ' . $user; + $cmd .= ':' . '(' . implode(',', $perm_entry) . ')'; + exec($cmd); + } } function create_dir($name, $perms) { - if (empty($name)) { - echo "create_dir: Empty name is not allowed\n"; - return; - } - - mkdir($name); - $dst = realpath($name); - icacls_set($name, PHPT_ACL_GRANT, $perms); + if (empty($name)) { + echo "create_dir: Empty name is not allowed\n"; + return; + } + + mkdir($name); + $dst = realpath($name); + icacls_set($name, PHPT_ACL_GRANT, $perms); } function create_file($name, $perms) { - if (empty($name)) { - echo "create_file: Empty name is not allowed\n"; - return; - } + if (empty($name)) { + echo "create_file: Empty name is not allowed\n"; + return; + } - touch($name); - icacls_set($name, PHPT_ACL_GRANT, $perms); + touch($name); + icacls_set($name, PHPT_ACL_GRANT, $perms); } function delete_file($path) { - icacls_set($path, PHPT_ACL_GRANT, PHPT_ACL_FULL); - if (is_file($path)) { - unlink($path); - } else { - echo "delete_file: '$path' is not a file\n"; - return; - } + icacls_set($path, PHPT_ACL_GRANT, PHPT_ACL_FULL); + if (is_file($path)) { + unlink($path); + } else { + echo "delete_file: '$path' is not a file\n"; + return; + } } function delete_dir($path) { - if (is_dir($path)) { - icacls_set($path, PHPT_ACL_GRANT, PHPT_ACL_FULL); - rmdir($path); - } else { - echo "delete_dir: '$path' is not a directory\n"; - return; - } + if (is_dir($path)) { + icacls_set($path, PHPT_ACL_GRANT, PHPT_ACL_FULL); + rmdir($path); + } else { + echo "delete_dir: '$path' is not a directory\n"; + return; + } } diff --git a/ext/standard/tests/file/windows_links/bug78862.phpt b/ext/standard/tests/file/windows_links/bug78862.phpt index 33b4b49293..ce4da1fc8c 100644 --- a/ext/standard/tests/file/windows_links/bug78862.phpt +++ b/ext/standard/tests/file/windows_links/bug78862.phpt @@ -7,9 +7,11 @@ var_dump(link(__DIR__ . "/bug78862.target\0more", __DIR__ . "/bug78862.link\0mor var_dump(file_exists(__DIR__ . '/bug78862.link')); ?> --EXPECTF-- -Warning: link() expects parameter 1 to be a valid path, string given in %s on line %d -NULL -bool(false) +Fatal error: Uncaught TypeError: link(): Argument #1 ($target) must be a valid path, string given in %s:%d +Stack trace: +#0 %s(%d): link('%s', '%s') +#1 {main} + thrown in %s on line %d --CLEAN-- <?php unlink(__DIR__ . '/bug78862.target'); diff --git a/ext/standard/tests/file/windows_links/common.inc b/ext/standard/tests/file/windows_links/common.inc index caa3758d44..b4a09e00c2 100644 --- a/ext/standard/tests/file/windows_links/common.inc +++ b/ext/standard/tests/file/windows_links/common.inc @@ -1,23 +1,23 @@ <?php function get_sysroot() { - // usually c:\\windows, but not always - return exec('echo %SYSTEMROOT%'); + // usually c:\\windows, but not always + return exec('echo %SYSTEMROOT%'); } function get_junction(){ - // junction.exe isn't included with Windows - // its a sysinternals tool for working with filesystem links - // see: http://technet.microsoft.com/en-us/sysinternals/bb896768 + // junction.exe isn't included with Windows + // its a sysinternals tool for working with filesystem links + // see: http://technet.microsoft.com/en-us/sysinternals/bb896768 - // install somewhere that is on %path% or added to %path% - return "junction.exe"; + // install somewhere that is on %path% or added to %path% + return "junction.exe"; } function get_mountvol() { - $sysroot = get_sysroot(); + $sysroot = get_sysroot(); - return "$sysroot\\System32\\mountvol.exe"; + return "$sysroot\\System32\\mountvol.exe"; } function skipIfSeCreateSymbolicLinkPrivilegeIsDisabled(string $filename) { diff --git a/ext/standard/tests/file/windows_links/readlink_compat.phpt b/ext/standard/tests/file/windows_links/readlink_compat.phpt index e119473895..b4ac07682e 100644 --- a/ext/standard/tests/file/windows_links/readlink_compat.phpt +++ b/ext/standard/tests/file/windows_links/readlink_compat.phpt @@ -20,7 +20,7 @@ mkdir($tmpDir); // mounted volume $volume = trim(exec('mountvol C: /L')); exec(sprintf('mountvol "%s" %s', $tmpDir, $volume)); -var_dump(readlink($tmpDir)); +var_dump(readlink($tmpDir)); exec(sprintf('mountvol "%s" /D', $tmpDir)); mkdir($tmpDir . '\\test\\directory', 0777, true); @@ -35,7 +35,7 @@ rmdir($link); // junction to a directory $link = $tmpDir . '\\test\\directory_junction'; $target = $tmpDir . '\\test\\directory'; -exec(sprintf('mklink /J "%s" "%s"', $link, $target)); +exec(sprintf('mklink /J "%s" "%s"', $link, $target)); var_dump(readlink($link)); rmdir($link); @@ -56,7 +56,7 @@ fclose($fh); // symlink to a file (absolute and relative) $link = $tmpDir . '\\test\\file_symlink'; -exec(sprintf('mklink "%s" "%s"', $link, $filename)); +exec(sprintf('mklink "%s" "%s"', $link, $filename)); var_dump(readlink($link)); unlink($link); exec(sprintf('mklink "%s" directory\\a.php', $link)); @@ -64,7 +64,7 @@ var_dump(readlink($link)); unlink($link); // unexpected behaviour -echo "\n*** Unexpected behaviour when not a reparse point\n"; +echo "\n*** Unexpected behaviour when not a reparse point\n"; var_dump(readlink($tmpDir . '\\test\\directory')); var_dump(readlink($filename)); diff --git a/ext/standard/tests/file/windows_mb_path/bug54028.phpt b/ext/standard/tests/file/windows_mb_path/bug54028.phpt index 7b304c70f4..6f3e6dab51 100644 --- a/ext/standard/tests/file/windows_mb_path/bug54028.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug54028.phpt @@ -22,28 +22,27 @@ $dirs = array("a", "ソ", "ゾ", "şŞıİğĞ", "多国語", "王", "汚れã¦æ mkdir($prefix); foreach ($dirs as $d) { - mkdir($prefix . $d); + mkdir($prefix . $d); } $directory = dir($prefix); while (false !== ($content = $directory->read())) { - if ("." == $content || ".." == $content) continue; + if ("." == $content || ".." == $content) continue; printf("Returned (%s)\n", $content); printf("Encoding: %s\n", mb_detect_encoding($content)); if ($content != get_basename_with_cp($prefix . $content, 65001, false)) { - echo "Verification failed!\n"; - } - echo "\n"; + echo "Verification failed!\n"; + } + echo "\n"; } foreach ($dirs as $d) { - rmdir($prefix . $d); + rmdir($prefix . $d); } rmdir($prefix); ?> -===DONE=== --EXPECT-- Returned (a) Encoding: ASCII @@ -66,4 +65,3 @@ Encoding: UTF-8 Returned (王) Encoding: UTF-8 -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/bug54028_2.phpt b/ext/standard/tests/file/windows_mb_path/bug54028_2.phpt index be93db1a83..af27036701 100644 --- a/ext/standard/tests/file/windows_mb_path/bug54028_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug54028_2.phpt @@ -22,25 +22,24 @@ $dirs = array("a", "ソ", "ゾ", "şŞıİğĞ", "多国語", "王", "汚れã¦æ mkdir($prefix); foreach ($dirs as $d) { - mkdir($prefix . $d); + mkdir($prefix . $d); } $old_cwd = getcwd(); foreach ($dirs as $d) { - $now = $prefix . $d; - var_dump(chdir($now)); - var_dump($dn = realpath(".")); - var_dump($d == get_basename_with_cp($dn, 65001, false)); + $now = $prefix . $d; + var_dump(chdir($now)); + var_dump($dn = realpath(".")); + var_dump($d == get_basename_with_cp($dn, 65001, false)); } chdir($old_cwd); foreach ($dirs as $d) { - rmdir($prefix . $d); + rmdir($prefix . $d); } rmdir($prefix); ?> -===DONE=== --EXPECTF-- bool(true) string(%d) "%sa" @@ -63,4 +62,3 @@ bool(true) bool(true) string(%d) "%s汚れã¦æŽ˜ã‚‹" bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/bug54977.phpt b/ext/standard/tests/file/windows_mb_path/bug54977.phpt index 173aed480f..5edead63ed 100644 --- a/ext/standard/tests/file/windows_mb_path/bug54977.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug54977.phpt @@ -22,24 +22,23 @@ $paths = array("多国語", "王", "汚れã¦æŽ˜ã‚‹"); mkdir($prefix); foreach ($paths as $d) { - mkdir($prefix . $d); - file_put_contents($prefix . $d . ".test", $d); + mkdir($prefix . $d); + file_put_contents($prefix . $d . ".test", $d); } $myDirectory = opendir($prefix); while($entryName = readdir($myDirectory)) { - echo get_basename_with_cp($prefix . $entryName, 65001, false) . "\n"; + echo get_basename_with_cp($prefix . $entryName, 65001, false) . "\n"; } closedir($myDirectory); foreach ($paths as $d) { - rmdir($prefix . $d); - unlink($prefix . $d . ".test"); + rmdir($prefix . $d); + unlink($prefix . $d . ".test"); } rmdir($prefix); ?> -===DONE=== --EXPECT-- testBug54977 windows_mb_path @@ -49,4 +48,3 @@ windows_mb_path 汚れã¦æŽ˜ã‚‹.test 王 王.test -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/bug61315.phpt b/ext/standard/tests/file/windows_mb_path/bug61315.phpt index 1e97636175..8729aafe09 100644 --- a/ext/standard/tests/file/windows_mb_path/bug61315.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug61315.phpt @@ -44,7 +44,6 @@ rmdir($d1); rmdir($prefix); ?> -===DONE=== --EXPECTF-- Active code page: 65001 getting basename of %s\ソフト @@ -60,4 +59,3 @@ string(%d) "%s\フォルダ" Active code page: %d bool(true) bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/bug64506.phpt b/ext/standard/tests/file/windows_mb_path/bug64506.phpt index 44d5c6f5f7..0bcf0d778c 100644 --- a/ext/standard/tests/file/windows_mb_path/bug64506.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug64506.phpt @@ -22,9 +22,9 @@ $fnw = __DIR__ . DIRECTORY_SEPARATOR . "Å¡.txt"; // UTF-8 $f = fopen($fnw, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump($f, fwrite($f, "writing to an mb filename")); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(fclose($f)); @@ -35,7 +35,6 @@ get_basename_with_cp($fnw, 65001); var_dump(unlink($fnw)); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -48,4 +47,3 @@ bool(true) string(%d) "%s\Å¡.txt" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/bug64699.phpt b/ext/standard/tests/file/windows_mb_path/bug64699.phpt index db488c15ed..20d4182b71 100644 --- a/ext/standard/tests/file/windows_mb_path/bug64699.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug64699.phpt @@ -25,7 +25,7 @@ $dirs = array("a", "ソ", "ゾ", "şŞıİğĞ", "多国語", "表"); mkdir($prefix); foreach ($dirs as $d) { - mkdir($prefix . $d); + mkdir($prefix . $d); } $dir = $prefix; @@ -41,14 +41,13 @@ if ($dh = opendir($dir)) { } foreach ($dirs as $d) { - rmdir($prefix . $d); + rmdir($prefix . $d); } rmdir($prefix); set_active_cp($old_cp); ?> -===DONE=== --EXPECTF-- Active code page: 65001 filetype()[dir ] == is_dir()[dir ] -> OK: . @@ -60,4 +59,3 @@ filetype()[dir ] == is_dir()[dir ] -> OK: ゾ filetype()[dir ] == is_dir()[dir ] -> OK: 多国語 filetype()[dir ] == is_dir()[dir ] -> OK: 表 Active code page: %d -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/bug70903.phpt b/ext/standard/tests/file/windows_mb_path/bug70903.phpt index 8d529484be..48cbf524c9 100644 --- a/ext/standard/tests/file/windows_mb_path/bug70903.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug70903.phpt @@ -37,7 +37,6 @@ rmdir($d0); rmdir($prefix); ?> -===DONE=== --EXPECTF-- Active code page: 65001 getting basename of %s\ı @@ -46,4 +45,3 @@ bool(true) string(%d) "%s\ı" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/bug71509.phpt b/ext/standard/tests/file/windows_mb_path/bug71509.phpt index 4193aeded3..8238072d14 100644 --- a/ext/standard/tests/file/windows_mb_path/bug71509.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug71509.phpt @@ -39,8 +39,6 @@ var_dump(file_exists($outputfile_zip)); remove_data("bug71509"); ?> -===DONE=== --EXPECT-- bool(true) bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/bug74923.phpt b/ext/standard/tests/file/windows_mb_path/bug74923.phpt index 210a49732f..9cffd5860f 100644 --- a/ext/standard/tests/file/windows_mb_path/bug74923.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug74923.phpt @@ -12,15 +12,13 @@ if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); <?php /* No way to affect timeout here. On different systems this might take some - dozens of seconds to complete. */ + dozens of seconds to complete. */ $s = '\\\\hello.com' . str_repeat('\\', 260); var_dump($s, @stat($s)); ?> -===DONE=== --EXPECTF-- string(271) "%s" bool(false) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/bug75063_cp1251.phpt b/ext/standard/tests/file/windows_mb_path/bug75063_cp1251.phpt index a56fecbbe3..32cb2adead 100644 --- a/ext/standard/tests/file/windows_mb_path/bug75063_cp1251.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug75063_cp1251.phpt @@ -34,16 +34,16 @@ $code = <<<CODE <?php foreach(["test", "òàñò"] as \$fn) { - file_put_contents("\$fn.txt", ""); + file_put_contents("\$fn.txt", ""); } var_dump(getcwd()); if (\$dh = opendir(getcwd())) { - while ((\$file = readdir(\$dh)) !== false) { - if ("." == \$file || ".." == \$file) continue; - var_dump(\$file); - } - closedir(\$dh); + while ((\$file = readdir(\$dh)) !== false) { + if ("." == \$file || ".." == \$file) continue; + var_dump(\$file); + } + closedir(\$dh); } CODE; $code_fn = "code.php"; @@ -53,7 +53,7 @@ print(shell_exec(getenv('TEST_PHP_EXECUTABLE') . " -n -d default_charset=cp1251 chdir($old_cwd); -/* --CLEAN-- section were the right place, but it won't accept default_charset ATM, it seems. */ +/*--CLEAN-- section were the right place, but it won't accept default_charset ATM, it seems. */ $dir_basename = "òåñò"; $prefix = __DIR__ . DIRECTORY_SEPARATOR . "bug75063-cp1251"; $d0 = $prefix . DIRECTORY_SEPARATOR . $dir_basename; @@ -67,7 +67,6 @@ foreach ($obj as $file) { rmdir($d0); rmdir($prefix); ?> -===DONE=== --EXPECTF-- string(4) "òåñò" bool(true) @@ -75,4 +74,3 @@ string(%d) "%sbug75063-cp1251%eòåñò" string(8) "code.php" string(8) "test.txt" string(8) "òàñò.txt" -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/bug75063_utf8.phpt b/ext/standard/tests/file/windows_mb_path/bug75063_utf8.phpt index beaf690dea..b8235c8842 100644 --- a/ext/standard/tests/file/windows_mb_path/bug75063_utf8.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug75063_utf8.phpt @@ -32,16 +32,16 @@ $code = <<<CODE <?php foreach(["test", "таÑÑ‚"] as \$fn) { - file_put_contents("\$fn.txt", ""); + file_put_contents("\$fn.txt", ""); } var_dump(getcwd()); if (\$dh = opendir(getcwd())) { - while ((\$file = readdir(\$dh)) !== false) { - if ("." == \$file || ".." == \$file) continue; - var_dump(\$file); - } - closedir(\$dh); + while ((\$file = readdir(\$dh)) !== false) { + if ("." == \$file || ".." == \$file) continue; + var_dump(\$file); + } + closedir(\$dh); } CODE; $code_fn = "code.php"; @@ -52,7 +52,6 @@ print(shell_exec(getenv('TEST_PHP_EXECUTABLE') . " -nf code.php")); chdir($old_cwd); ?> -===DONE=== --CLEAN-- <?php $dir_basename = "теÑÑ‚"; @@ -76,4 +75,3 @@ string(%d) "%sbug75063-utf8%eтеÑÑ‚" string(8) "code.php" string(8) "test.txt" string(12) "таÑÑ‚.txt" -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/recursive_it.phpt b/ext/standard/tests/file/windows_mb_path/recursive_it.phpt index b42f796ee3..fb97086b2b 100644 --- a/ext/standard/tests/file/windows_mb_path/recursive_it.phpt +++ b/ext/standard/tests/file/windows_mb_path/recursive_it.phpt @@ -15,7 +15,7 @@ $need_len = 1024; //$need_len = 259; $dir = __DIR__; while ($need_len - strlen($dir) > 32) { - $dir .= DIRECTORY_SEPARATOR . str_repeat("a", 32); + $dir .= DIRECTORY_SEPARATOR . str_repeat("a", 32); } $dir .= DIRECTORY_SEPARATOR . str_repeat("a", $need_len - strlen($dir)); mkdir($dir, 0700, true); @@ -26,39 +26,37 @@ file_put_contents($fl, ""); $start = substr($dir, 0, strpos($dir, DIRECTORY_SEPARATOR, strlen(__DIR__)+1)); $iter = new RecursiveIteratorIterator( - new RecursiveDirectoryIterator( - $start, - FilesystemIterator::SKIP_DOTS - ), - RecursiveIteratorIterator::CHILD_FIRST + new RecursiveDirectoryIterator( + $start, + FilesystemIterator::SKIP_DOTS + ), + RecursiveIteratorIterator::CHILD_FIRST ); foreach ($iter as $item) { - if (!$item->isDir()) { - var_dump($item->getPathname()); - } + if (!$item->isDir()) { + var_dump($item->getPathname()); + } } $iter->rewind(); foreach ($iter as $item) { - if ($item->isDir()) { - rmdir($item->getPathname()); - } else { - unlink($item->getPathname()); - } + if ($item->isDir()) { + rmdir($item->getPathname()); + } else { + unlink($item->getPathname()); + } } rmdir($start); var_dump(file_exists($start)); /*unlink($fl); do { - rmdir($dir); - $dir = dirname($dir); + rmdir($dir); + $dir = dirname($dir); } while (__DIR__ != $dir);*/ ?> -==DONE== --EXPECTF-- string(%d) "%shello.txt" bool(false) -==DONE== diff --git a/ext/standard/tests/file/windows_mb_path/test_big5_0.phpt b/ext/standard/tests/file/windows_mb_path/test_big5_0.phpt index 9935c646be..794c1a2f7b 100644 --- a/ext/standard/tests/file/windows_mb_path/test_big5_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_big5_0.phpt @@ -29,19 +29,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "$item"; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_big5"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(%d) "reading file wihh multibyte filename " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_big5_1.phpt b/ext/standard/tests/file/windows_mb_path/test_big5_1.phpt index bfebe42578..461ed5d002 100644 --- a/ext/standard/tests/file/windows_mb_path/test_big5_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_big5_1.phpt @@ -41,7 +41,6 @@ var_dump(rmdir($subpath)); remove_data("dir_big5"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -53,4 +52,3 @@ bool(true) string(%d) "%s´ú¸Õ¦h¦r¸`¸ô®|5\´ú¸Õ¦h¦r¸`¸ô®|4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_big5_2.phpt b/ext/standard/tests/file/windows_mb_path/test_big5_2.phpt index a308e7b9d1..d7652615de 100644 --- a/ext/standard/tests/file/windows_mb_path/test_big5_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_big5_2.phpt @@ -29,10 +29,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "{$item}25"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -44,7 +44,6 @@ var_dump(unlink($fn)); remove_data("file_big5"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -57,4 +56,3 @@ bool(true) string(%d) "%s測試多å—節路徑25" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_0.phpt index 1d3e506135..b355267f85 100644 --- a/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_0.phpt @@ -26,19 +26,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "$item"; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_big5"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(%d) "reading file wihh multibyte filename " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_1.phpt b/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_1.phpt index dac275e824..0195221778 100644 --- a/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_1.phpt @@ -38,7 +38,6 @@ var_dump(rmdir($subpath)); remove_data("dir_big5"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -50,4 +49,3 @@ bool(true) string(%d) "%s\測試多å—節路徑5\測試多å—節路徑4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_2.phpt index f85d55293d..4f94f89879 100644 --- a/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_2.phpt @@ -26,10 +26,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "{$item}25"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -41,7 +41,6 @@ var_dump(unlink($fn)); remove_data("file_big5"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -54,4 +53,3 @@ bool(true) string(%d) "%s\測試多å—節路徑25" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_0.phpt index af023f4b77..98c716678a 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_0.phpt @@ -26,19 +26,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1250"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(37) "reading file wihh multibyte filename " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_1.phpt index 58808e9644..c792988ba5 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_1.phpt @@ -38,7 +38,6 @@ var_dump(rmdir($subpath)); remove_data("dir_cp1250"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -50,4 +49,3 @@ bool(true) string(%d) "%s\Å¡Ä‘Äćž_Å ÄČĆŽ42\Å¡Ä‘Äćž_Å ÄČĆŽ4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_2.phpt index 12165e44a4..9e1279a5cd 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_2.phpt @@ -26,10 +26,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -39,7 +39,6 @@ get_basename_with_cp($fn, 65001); remove_data("dir_cp1250"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -51,4 +50,3 @@ string(23) "Å¡Ä‘Äćž_Å ÄČĆŽ33" bool(true) string(%d) "%s\Å¡Ä‘Äćž_Å ÄČĆŽ33" Active code page: %d -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_3.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_3.phpt index 5a48457e8f..2f3ae9afd6 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_3.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_3.phpt @@ -26,19 +26,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1250"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(37) "reading file wihh multibyte filename " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_4.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_4.phpt index 198121f9b1..0eb0f9b097 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_4.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_4.phpt @@ -38,7 +38,6 @@ var_dump(rmdir($subpath)); remove_data("dir_cp1250"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -50,4 +49,3 @@ bool(true) string(%d) "%s\ÃrvÃztűrÅ‘ tükörfúrógép42\ÃrvÃztűrÅ‘ tükörfúrógép4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_5.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_5.phpt index 2fb18ee51c..0c56ea4b48 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_5.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_5.phpt @@ -26,10 +26,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -39,7 +39,6 @@ get_basename_with_cp($fn, 65001); remove_data("dir_cp1250"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -51,4 +50,3 @@ string(33) "ÃrvÃztűrÅ‘ tükörfúrógép33" bool(true) string(%d) "%s\ÃrvÃztűrÅ‘ tükörfúrógép33" Active code page: %d -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1251_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1251_0.phpt index 98c2581fff..bf30b4baeb 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1251_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1251_0.phpt @@ -29,18 +29,16 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1251"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(35) "opened an utf8 filename for reading" bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1251_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1251_1.phpt index 6bda2bc356..a1f05c80f6 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1251_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1251_1.phpt @@ -41,7 +41,6 @@ var_dump(rmdir($subpath)); remove_data("dir_cp1251"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -53,4 +52,3 @@ bool(true) string(%d) "%s\ïðèâåò3\ïðèâåò4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1251_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1251_2.phpt index 28a8c4af21..742af59480 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1251_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1251_2.phpt @@ -29,10 +29,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}7"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -43,7 +43,6 @@ var_dump(unlink($fn)); remove_data("file_cp1251"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -56,4 +55,3 @@ bool(true) string(%d) "%s\ïðèâåò7" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_0.phpt index c27d087bf4..0cd657e94c 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_0.phpt @@ -26,18 +26,16 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1251"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(35) "opened an utf8 filename for reading" bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_1.phpt index 7c681e2960..e7e274c4e6 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_1.phpt @@ -38,7 +38,6 @@ var_dump(rmdir($subpath)); remove_data("dir_cp1251"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -50,4 +49,3 @@ bool(true) string(%d) "%s\привет3\привет4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_2.phpt index baa449439c..31e611303e 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_2.phpt @@ -26,10 +26,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}7"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -40,7 +40,6 @@ var_dump(unlink($fn)); remove_data("file_cp1251"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -53,4 +52,3 @@ bool(true) string(%d) "%s\привет7" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_0.phpt index 2375fb475f..51d2b6d8c1 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_0.phpt @@ -29,18 +29,16 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open failed\n"; + echo "open failed\n"; } remove_data("file_cp1251"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(35) "opened an utf8 filename for reading" bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_1.phpt index 7cd13ee394..ca11bfff56 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_1.phpt @@ -41,7 +41,6 @@ var_dump(rmdir($subpath)); remove_data("dir_cp1251"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -53,4 +52,3 @@ bool(true) string(%d) "%s\привет3\привет4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_2.phpt index 6d1fe44358..eb52b78835 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_2.phpt @@ -29,10 +29,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open failed\n"; + echo "open failed\n"; } var_dump(file_get_contents($fn)); @@ -43,7 +43,6 @@ var_dump(unlink($fn)); remove_data("file_cp1251"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -56,4 +55,3 @@ bool(true) string(%d) "%s\привет7" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1252_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1252_0.phpt index cee6bd0ef9..f2671aa605 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1252_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1252_0.phpt @@ -35,10 +35,8 @@ system("dir /b " . $fn); remove_data("file"); ?> -===DONE=== --EXPECTF-- string(%d) "%s\gefäß" bool(true) bool(true) gefäß -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_0.phpt index ec0692a05a..45234243ce 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_0.phpt @@ -26,19 +26,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1252"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(%d) "hallo " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_1.phpt index 707128828d..2465145758 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_1.phpt @@ -38,7 +38,6 @@ var_dump(rmdir($subpath)); remove_data("dir_cp1252"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -50,4 +49,3 @@ bool(true) string(%d) "%s\tschüß3\tschüß4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_2.phpt index db01185360..9185503abe 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_2.phpt @@ -26,10 +26,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}7"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -40,7 +40,6 @@ var_dump(unlink($fn)); remove_data("dir_cp1252"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -53,4 +52,3 @@ bool(true) string(%d) "%s\tschüß7" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_3.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_3.phpt index 6e77bc8c9a..f6559253d2 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_3.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_3.phpt @@ -26,18 +26,16 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file2_cp1252"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(4) "hola" bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_4.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_4.phpt index fe41cad89b..98a419efc5 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_4.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_4.phpt @@ -38,7 +38,6 @@ var_dump(rmdir($subpath)); remove_data("dir2_cp1252"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -50,4 +49,3 @@ bool(true) string(%d) "%s\Voláçao3\Voláçao4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_5.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_5.phpt index 67eb08b609..fb98361c17 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_5.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_5.phpt @@ -26,10 +26,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}7"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -40,7 +40,6 @@ var_dump(unlink($fn)); remove_data("dir2_cp1252"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -53,4 +52,3 @@ bool(true) string(%d) "%s\Voláçao7" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1253_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1253_0.phpt index 97956fe872..93b63a536e 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1253_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1253_0.phpt @@ -29,19 +29,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1253"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(37) "reading file wihh multibyte filename " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1253_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1253_1.phpt index aa83356c64..aa08aa24ea 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1253_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1253_1.phpt @@ -41,7 +41,6 @@ var_dump(rmdir($subpath)); remove_data("dir_cp1253"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -53,4 +52,3 @@ bool(true) string(%d) "%s\äéáäñïìÞ äïêéìÞò42\äéáäñïìÞ äïêéìÞò4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1253_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1253_2.phpt index d104e34ceb..46ce9b5fef 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1253_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1253_2.phpt @@ -29,10 +29,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -42,7 +42,6 @@ get_basename_with_cp($fn, 1253); remove_data("dir_cp1253"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -54,4 +53,3 @@ string(%d) "äéáäñïìÞ äïêéìÞò33" bool(true) string(%d) "%s\äéáäñïìÞ äïêéìÞò33" Active code page: %d -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_0.phpt index bf7bc84d74..d12a174a7f 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_0.phpt @@ -26,19 +26,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1253"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(37) "reading file wihh multibyte filename " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_1.phpt index 2bdfbc60c8..70a548f668 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_1.phpt @@ -38,7 +38,6 @@ var_dump(rmdir($subpath)); remove_data("dir_cp1253"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -50,4 +49,3 @@ bool(true) string(%d) "%s\διαδÏομή δοκιμής42\διαδÏομή δοκιμής4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_2.phpt index fd69312c24..ef15325fea 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_2.phpt @@ -26,10 +26,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -39,7 +39,6 @@ get_basename_with_cp($fn, 65001); remove_data("dir_cp1253"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -51,4 +50,3 @@ string(33) "διαδÏομή δοκιμής33" bool(true) string(%d) "%s\διαδÏομή δοκιμής33" Active code page: %d -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1254_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1254_0.phpt index 18a63a32c0..77b52e0f1a 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1254_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1254_0.phpt @@ -29,19 +29,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1254"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(37) "reading file wihh multibyte filename " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1254_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1254_1.phpt index 9cda42f686..54108d0e79 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1254_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1254_1.phpt @@ -41,7 +41,6 @@ var_dump(rmdir($subpath)); remove_data("dir_cp1254"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -53,4 +52,3 @@ bool(true) string(%d) "%s\çokbaytlý iþleri42\çokbaytlý iþleri4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1254_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1254_2.phpt index 22030a24f3..b2ba41900d 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1254_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1254_2.phpt @@ -29,10 +29,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -42,7 +42,6 @@ get_basename_with_cp($fn, 1254); remove_data("dir_cp1254"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -54,4 +53,3 @@ string(%d) "çokbaytlý iþleri33" bool(true) string(%d) "%s\çokbaytlý iþleri33" Active code page: %d -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1254_3.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1254_3.phpt index 3711bd74f9..0e0e83d285 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1254_3.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1254_3.phpt @@ -36,10 +36,8 @@ system("dir /b \"" . $fn . "\""); remove_data("file_cp1254"); ?> -===DONE=== --EXPECTF-- string(%d) "%s\çokbaytlý iþleri" bool(true) bool(true) çokbaytlý iþleri -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_0.phpt index c3ad1eccc6..211233de1c 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_0.phpt @@ -26,19 +26,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1254"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(37) "reading file wihh multibyte filename " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_1.phpt index fa8a149f90..23fd79d44e 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_1.phpt @@ -38,7 +38,6 @@ var_dump(rmdir($subpath)); remove_data("dir_cp1254"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -50,4 +49,3 @@ bool(true) string(%d) "%s\çokbaytlı iÅŸleri42\çokbaytlı iÅŸleri4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_2.phpt index 90d21c5a15..4bff1e9baa 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_2.phpt @@ -26,10 +26,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -39,7 +39,6 @@ get_basename_with_cp($fn, 65001); remove_data("dir_cp1254"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -51,4 +50,3 @@ string(%d) "çokbaytlı iÅŸleri33" bool(true) string(%d) "%s\çokbaytlı iÅŸleri33" Active code page: %d -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_3.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_3.phpt index 60dde8cb7d..67549daf60 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_3.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_3.phpt @@ -33,10 +33,8 @@ system("dir /b \"" . $fn . "\""); remove_data("file_cp1254"); ?> -===DONE=== --EXPECTF-- string(%d) "%s\çokbaytlı iÅŸleri" bool(true) bool(true) çokbaytlı iÅŸleri -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1255_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1255_0.phpt index 3c92ff979d..e9adaf843f 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1255_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1255_0.phpt @@ -29,19 +29,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1255"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(37) "reading file wihh multibyte filename " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1255_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1255_1.phpt index 18ac39a05d..0c78b91ab0 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1255_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1255_1.phpt @@ -41,7 +41,6 @@ var_dump(rmdir($subpath)); remove_data("dir_cp1255"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -53,4 +52,3 @@ bool(true) string(%d) "%s\ëììéí îøåáéí42\ëììéí îøåáéí4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1255_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1255_2.phpt index 781d845896..1af549f0a7 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1255_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1255_2.phpt @@ -29,10 +29,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -42,7 +42,6 @@ get_basename_with_cp($fn, 1255); remove_data("dir_cp1255"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -54,4 +53,3 @@ string(%d) "ëììéí îøåáéí33" bool(true) string(%d) "%s\ëììéí îøåáéí33" Active code page: %d -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_0.phpt index 5ea5915c32..1b65143553 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_0.phpt @@ -26,19 +26,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1255"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(37) "reading file wihh multibyte filename " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_1.phpt index ecdfdde3d7..e53936090a 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_1.phpt @@ -38,7 +38,6 @@ var_dump(rmdir($subpath)); remove_data("dir_cp1255"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -50,4 +49,3 @@ bool(true) string(%s) "%s\×›×œ×œ×™× ×ž×¨×•×‘×™×42\×›×œ×œ×™× ×ž×¨×•×‘×™×4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_2.phpt index 6983e732d2..1c9396348e 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_2.phpt @@ -26,10 +26,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -39,7 +39,6 @@ get_basename_with_cp($fn, 65001); remove_data("dir_cp1255"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -51,4 +50,3 @@ string(%s) "×›×œ×œ×™× ×ž×¨×•×‘×™×33" bool(true) string(%d) "%s\×›×œ×œ×™× ×ž×¨×•×‘×™×33" Active code page: %d -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1256_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1256_0.phpt index 48bbe7fbfb..40910894b8 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1256_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1256_0.phpt @@ -29,19 +29,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1256"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(37) "reading file wihh multibyte filename " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1256_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1256_1.phpt index afda00330d..08e8067163 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1256_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1256_1.phpt @@ -41,7 +41,6 @@ var_dump(rmdir($subpath)); remove_data("dir_cp1256"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -53,4 +52,3 @@ bool(true) string(%d) "%s\ãÓÇÑ ãÊÚÏÏ ÇáÈÇíÊ ÇÎÊÈÇÑ42\ãÓÇÑ ãÊÚÏÏ ÇáÈÇíÊ ÇÎÊÈÇÑ4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1256_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1256_2.phpt index 95fe6c56c7..d68cd3113a 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1256_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1256_2.phpt @@ -29,10 +29,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -42,7 +42,6 @@ get_basename_with_cp($fn, 1256); remove_data("dir_cp1256"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -54,4 +53,3 @@ string(%d) "ãÓÇÑ ãÊÚÏÏ ÇáÈÇíÊ ÇÎÊÈÇÑ33" bool(true) string(%d) "%s\ãÓÇÑ ãÊÚÏÏ ÇáÈÇíÊ ÇÎÊÈÇÑ33" Active code page: %s -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_0.phpt index b13c54278f..901026f389 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_0.phpt @@ -26,19 +26,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1256"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(37) "reading file wihh multibyte filename " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_1.phpt index 2200e7d7e8..04f5854e5b 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_1.phpt @@ -38,7 +38,6 @@ var_dump(rmdir($subpath)); remove_data("dir_cp1256"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -50,4 +49,3 @@ bool(true) string(%d) "%s\مسار متعدد البايت اختبار42\مسار متعدد البايت اختبار4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_2.phpt index 3042cfc02d..7b01bc56e0 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_2.phpt @@ -26,10 +26,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -39,7 +39,6 @@ get_basename_with_cp($fn, 65001); remove_data("dir_cp1256"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -51,4 +50,3 @@ string(47) "مسار متعدد البايت اختبار33" bool(true) string(%d) "%s\مسار متعدد البايت اختبار33" Active code page: %s -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp874_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp874_0.phpt index 8a52ab0a1f..e8bc394a5d 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp874_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp874_0.phpt @@ -22,31 +22,30 @@ default_charset=cp874 include __DIR__ . DIRECTORY_SEPARATOR . "util.inc"; $names = array( /* cp874 */ - "à»ç¹á¿éÁ·Õè·´Êͺ1", - "à»ç¹á¿éÁ·Õè·´Êͺ2", - "à»ç¹á¿éÁ·Õè·´Êͺ3", - "à»ç¹á¿éÁ·Õè·´Êͺ4", - "à»ç¹á¿éÁ·Õè·´Êͺ5", - "à»ç¹á¿éÁ·Õè·´Êͺ6", - "à»ç¹á¿éÁ·Õè·´Êͺ7", - "à»ç¹á¿éÁ·Õè·´Êͺ8", - "à»ç¹á¿éÁ·Õè·´Êͺ8 10", + "à»ç¹á¿éÁ·Õè·´Êͺ1", + "à»ç¹á¿éÁ·Õè·´Êͺ2", + "à»ç¹á¿éÁ·Õè·´Êͺ3", + "à»ç¹á¿éÁ·Õè·´Êͺ4", + "à»ç¹á¿éÁ·Õè·´Êͺ5", + "à»ç¹á¿éÁ·Õè·´Êͺ6", + "à»ç¹á¿éÁ·Õè·´Êͺ7", + "à»ç¹á¿éÁ·Õè·´Êͺ8", + "à»ç¹á¿éÁ·Õè·´Êͺ8 10", ); $i = 0; foreach ($names as $name) { - $path = __DIR__ . DIRECTORY_SEPARATOR . $name . ".txt"; + $path = __DIR__ . DIRECTORY_SEPARATOR . $name . ".txt"; - file_put_contents($path, "hello" . $i++); + file_put_contents($path, "hello" . $i++); - get_basename_with_cp($path, 874); - var_dump(file_get_contents($path)); + get_basename_with_cp($path, 874); + var_dump(file_get_contents($path)); - unlink($path); + unlink($path); } ?> -===DONE=== --EXPECTF-- Active code page: %d getting basename of %sà»ç¹á¿éÁ·Õè·´Êͺ1.txt @@ -111,4 +110,3 @@ bool(true) string(%d) "%sà»ç¹á¿éÁ·Õè·´Êͺ8 10.txt" Active code page: %d string(6) "hello8" -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp874_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp874_1.phpt index f8c32b58f5..9d948d4023 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp874_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp874_1.phpt @@ -36,10 +36,8 @@ system("dir /b " . $fn); remove_data("file_cp874"); ?> -===DONE=== --EXPECTF-- string(%d) "%s\à»ç¹á¿éÁ·Õè·´Êͺ11" bool(true) bool(true) à»ç¹á¿éÁ·Õè·´Êͺ11 -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp874_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp874_to_utf8_0.phpt index 3ac3035b4c..c21f124b6e 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp874_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp874_to_utf8_0.phpt @@ -19,31 +19,30 @@ skip_if_no_required_exts(); include __DIR__ . DIRECTORY_SEPARATOR . "util.inc"; $names = array( /* cp874 */ - "à»ç¹á¿éÁ·Õè·´Êͺ1", - "à»ç¹á¿éÁ·Õè·´Êͺ2", - "à»ç¹á¿éÁ·Õè·´Êͺ3", - "à»ç¹á¿éÁ·Õè·´Êͺ4", - "à»ç¹á¿éÁ·Õè·´Êͺ5", - "à»ç¹á¿éÁ·Õè·´Êͺ6", - "à»ç¹á¿éÁ·Õè·´Êͺ7", - "à»ç¹á¿éÁ·Õè·´Êͺ8", - "à»ç¹á¿éÁ·Õè·´Êͺ8 10", + "à»ç¹á¿éÁ·Õè·´Êͺ1", + "à»ç¹á¿éÁ·Õè·´Êͺ2", + "à»ç¹á¿éÁ·Õè·´Êͺ3", + "à»ç¹á¿éÁ·Õè·´Êͺ4", + "à»ç¹á¿éÁ·Õè·´Êͺ5", + "à»ç¹á¿éÁ·Õè·´Êͺ6", + "à»ç¹á¿éÁ·Õè·´Êͺ7", + "à»ç¹á¿éÁ·Õè·´Êͺ8", + "à»ç¹á¿éÁ·Õè·´Êͺ8 10", ); $i = 0; foreach ($names as $name) { - $pathw = __DIR__ . DIRECTORY_SEPARATOR . iconv('cp874', 'utf-8', $name) . ".txt"; + $pathw = __DIR__ . DIRECTORY_SEPARATOR . iconv('cp874', 'utf-8', $name) . ".txt"; - file_put_contents($pathw, "hello" . $i++); + file_put_contents($pathw, "hello" . $i++); - get_basename_with_cp($pathw, 65001); - var_dump(file_get_contents($pathw)); + get_basename_with_cp($pathw, 65001); + var_dump(file_get_contents($pathw)); - unlink($pathw); + unlink($pathw); } ?> -===DONE=== --EXPECTF-- Active code page: %d getting basename of %sเป็นà¹à¸Ÿà¹‰à¸¡à¸—ี่ทดสà¸à¸š1.txt @@ -108,4 +107,3 @@ bool(true) string(%d) "%sเป็นà¹à¸Ÿà¹‰à¸¡à¸—ี่ทดสà¸à¸š8 10.txt" Active code page: %d string(6) "hello8" -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp874_to_utf8_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp874_to_utf8_1.phpt index 951f9c0650..2019b12451 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp874_to_utf8_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp874_to_utf8_1.phpt @@ -33,10 +33,8 @@ system("dir /b " . $fn); remove_data("file_cp874"); ?> -===DONE=== --EXPECTF-- string(%d) "%s\เป็นà¹à¸Ÿà¹‰à¸¡à¸—ี่ทดสà¸à¸š11" bool(true) bool(true) เป็นà¹à¸Ÿà¹‰à¸¡à¸—ี่ทดสà¸à¸š11 -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp932_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp932_0.phpt index 2c3e74f7aa..ccb273a94c 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp932_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp932_0.phpt @@ -29,19 +29,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp932"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(37) "reading file wihh multibyte filename " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp932_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp932_1.phpt index 0cd6474276..4bc6028ce2 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp932_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp932_1.phpt @@ -41,7 +41,6 @@ var_dump(rmdir($subpath)); remove_data("dir_cp932"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -53,4 +52,3 @@ bool(true) string(%d) "%s\ƒeƒXƒgƒ}ƒ‹ƒ`ƒoƒCƒgEƒpƒX42\ƒeƒXƒgƒ}ƒ‹ƒ`ƒoƒCƒgEƒpƒX4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp932_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp932_2.phpt index 0da56cefcc..2860eb9fb3 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp932_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp932_2.phpt @@ -29,10 +29,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -42,7 +42,6 @@ get_basename_with_cp($fn, 932); remove_data("dir_cp932"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -54,4 +53,3 @@ string(%d) "ƒeƒXƒgƒ}ƒ‹ƒ`ƒoƒCƒgEƒpƒX33" bool(true) string(%d) "%s\ƒeƒXƒgƒ}ƒ‹ƒ`ƒoƒCƒgEƒpƒX33" Active code page: %d -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp932_3.phpt b/ext/standard/tests/file/windows_mb_path/test_cp932_3.phpt index 0c9ad8ee71..4fdfb925a8 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp932_3.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp932_3.phpt @@ -36,10 +36,8 @@ system("dir /b " . $fn); remove_data("file_cp932"); ?> -===DONE=== --EXPECTF-- string(%d) "%s\ƒeƒXƒgƒ}ƒ‹ƒ`ƒoƒCƒgEƒpƒX77" bool(true) bool(true) ƒeƒXƒgƒ}ƒ‹ƒ`ƒoƒCƒgEƒpƒX77 -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_0.phpt index 1a7e98cbea..df855aaca4 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_0.phpt @@ -26,19 +26,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp932"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(37) "reading file wihh multibyte filename " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_1.phpt index a9c22f4db8..0c487a33d3 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_1.phpt @@ -38,7 +38,6 @@ var_dump(rmdir($subpath)); remove_data("dir_cp932"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -50,4 +49,3 @@ bool(true) string(%d) "%s\テストマルãƒãƒã‚¤ãƒˆãƒ»ãƒ‘ス42\テストマルãƒãƒã‚¤ãƒˆãƒ»ãƒ‘ス4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_2.phpt index d42f0095dd..064625d1c8 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_2.phpt @@ -26,10 +26,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -39,7 +39,6 @@ get_basename_with_cp($fn, 65001); remove_data("dir_cp932"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -51,4 +50,3 @@ string(38) "テストマルãƒãƒã‚¤ãƒˆãƒ»ãƒ‘ス33" bool(true) string(%d) "%s\テストマルãƒãƒã‚¤ãƒˆãƒ»ãƒ‘ス33" Active code page: %d -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp936_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp936_0.phpt index 1c1de16168..b1a4f8744f 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp936_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp936_0.phpt @@ -29,19 +29,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "$item"; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp936"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(%d) "reading file wihh multibyte filename " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp936_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp936_1.phpt index 67d45b9c62..b965a68552 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp936_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp936_1.phpt @@ -41,7 +41,6 @@ var_dump(rmdir($subpath)); remove_data("dir_cp936"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -53,4 +52,3 @@ bool(true) string(%d) "%s\œyÔ‡¶à×ֹ·½5\œyÔ‡¶à×ֹ·½4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp936_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp936_2.phpt index bba68d6871..e872c05942 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp936_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp936_2.phpt @@ -29,10 +29,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "{$item}25"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -44,7 +44,6 @@ var_dump(unlink($fn)); remove_data("file_cp936"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -57,4 +56,3 @@ bool(true) string(%d) "%s\œyÔ‡¶à×ֹ·½25" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_0.phpt index 2d6aa24f33..2797d25904 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_0.phpt @@ -26,19 +26,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "$item"; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp936"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(%d) "reading file wihh multibyte filename " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_1.phpt b/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_1.phpt index ca731062aa..c00e5f6b1f 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_1.phpt @@ -38,7 +38,6 @@ var_dump(rmdir($subpath)); remove_data("dir_cp936"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -50,4 +49,3 @@ bool(true) string(%d) "%s\測試多å—節路徑5\測試多å—節路徑4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_2.phpt index 07ed5e3fb8..31ff1db318 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_2.phpt @@ -26,10 +26,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "{$item}25"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -41,7 +41,6 @@ var_dump(unlink($fn)); remove_data("file_cp936"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -54,4 +53,3 @@ bool(true) string(%d) "%s\測試多å—節路徑25" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_cwd_mb_names.phpt b/ext/standard/tests/file/windows_mb_path/test_cwd_mb_names.phpt index dc61ff2642..3cb09f777d 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cwd_mb_names.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cwd_mb_names.phpt @@ -39,11 +39,9 @@ chdir($oldcwd); remove_data("dir_mb"); ?> -===DONE=== --EXPECTF-- Active code page: 65001 bool(true) string(%d) "%s\テストマルãƒãƒã‚¤ãƒˆãƒ»ãƒ‘ス42" bool(true) Active code page: %d -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_0.phpt index f83bd96a95..7a06f53b7d 100644 --- a/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_0.phpt @@ -26,19 +26,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_eucjp"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(37) "reading file wihh multibyte filename " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_1.phpt b/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_1.phpt index 80b5ebbd07..313d0db9b7 100644 --- a/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_1.phpt @@ -38,7 +38,6 @@ var_dump(rmdir($subpath)); remove_data("dir_eucjp"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -50,4 +49,3 @@ bool(true) string(%d) "%s\テストマルãƒãƒã‚¤ãƒˆãƒ»ãƒ‘ス42\テストマルãƒãƒã‚¤ãƒˆãƒ»ãƒ‘ス4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_2.phpt index a6edffe2f6..6707146c67 100644 --- a/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_2.phpt @@ -26,10 +26,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -39,7 +39,6 @@ get_basename_with_cp($fn, 65001); remove_data("dir_eucjp"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -51,4 +50,3 @@ string(38) "テストマルãƒãƒã‚¤ãƒˆãƒ»ãƒ‘ス33" bool(true) string(%d) "%s\テストマルãƒãƒã‚¤ãƒˆãƒ»ãƒ‘ス33" Active code page: %d -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_0.phpt index 883d1f9eff..0840610c20 100644 --- a/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_0.phpt @@ -26,19 +26,17 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_kartuli"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) string(37) "reading file wihh multibyte filename " bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_1.phpt b/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_1.phpt index 5e2bde5cec..baa6e96606 100644 --- a/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_1.phpt @@ -38,7 +38,6 @@ var_dump(rmdir($subpath)); remove_data("dir_kartuli"); ?> -===DONE=== --EXPECTF-- bool(true) bool(true) @@ -50,4 +49,3 @@ bool(true) string(%d) "%s\ქáƒáƒ თველები42\ქáƒáƒ თველები4" Active code page: %d bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_2.phpt index bd493e178f..4944aade2d 100644 --- a/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_2.phpt @@ -26,10 +26,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); @@ -39,7 +39,6 @@ get_basename_with_cp($fn, 65001); remove_data("dir_kartuli"); ?> -===DONE=== --EXPECTF-- resource(%d) of type (stream) int(25) @@ -51,4 +50,3 @@ string(32) "ქáƒáƒ თველები33" bool(true) string(%d) "%s\ქáƒáƒ თველები33" Active code page: %d -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_3.phpt b/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_3.phpt index fd98bbcae9..8d498d1990 100644 --- a/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_3.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_3.phpt @@ -33,10 +33,8 @@ system("dir /b " . $fn); remove_data("file_kartuli"); ?> -===DONE=== --EXPECTF-- string(%d) "%s\ქáƒáƒ თველები55" bool(true) bool(true) ქáƒáƒ თველები55 -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_long_path_0.phpt b/ext/standard/tests/file/windows_mb_path/test_long_path_0.phpt index 181ba33ca1..3705582484 100644 --- a/ext/standard/tests/file/windows_mb_path/test_long_path_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_long_path_0.phpt @@ -17,8 +17,8 @@ $s = str_repeat('a', 50); $how_many = 32; for ($i = 0; $i < $how_many; $i++) { - $p .= "$s"; - $p .= DIRECTORY_SEPARATOR; + $p .= "$s"; + $p .= DIRECTORY_SEPARATOR; } $p = realpath(__DIR__) . DIRECTORY_SEPARATOR . $p; @@ -30,18 +30,16 @@ var_dump(mkdir($p, 0777, true)); var_dump(file_exists($p)); for ($i = 0; $i < $how_many; $i++) { - $p0 = substr($p, 0, strlen($p) - $i*51); - rmdir($p0); + $p0 = substr($p, 0, strlen($p) - $i*51); + rmdir($p0); } var_dump(file_exists(realpath(__DIR__) . DIRECTORY_SEPARATOR . $s)); ?> -===DONE=== --EXPECTF-- %d%d%d%d %s\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ bool(true) bool(true) bool(false) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_long_path_1.phpt b/ext/standard/tests/file/windows_mb_path/test_long_path_1.phpt index 48f30dbccd..427f0e9cf5 100644 --- a/ext/standard/tests/file/windows_mb_path/test_long_path_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_long_path_1.phpt @@ -17,8 +17,8 @@ $how_many = 32; for ($i = 0; $i < $how_many; $i++) { - $p .= "$s"; - $p .= DIRECTORY_SEPARATOR; + $p .= "$s"; + $p .= DIRECTORY_SEPARATOR; } $p = realpath(__DIR__) . DIRECTORY_SEPARATOR . $p; @@ -37,14 +37,13 @@ var_dump(file_get_contents($p7)); unlink($p7); for ($i = 0; $i < $how_many; $i++) { - $p0 = substr($p, 0, strlen($p) - $i*51); - rmdir($p0); + $p0 = substr($p, 0, strlen($p) - $i*51); + rmdir($p0); } var_dump(file_exists(realpath(__DIR__) . DIRECTORY_SEPARATOR . $s)); ?> -===DONE=== --EXPECTF-- %d%d%d%d %s\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ @@ -52,4 +51,3 @@ bool(true) bool(true) string(5) "hello" bool(false) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_long_path_2.phpt b/ext/standard/tests/file/windows_mb_path/test_long_path_2.phpt index 3437656eec..05982133c1 100644 --- a/ext/standard/tests/file/windows_mb_path/test_long_path_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_long_path_2.phpt @@ -17,8 +17,8 @@ $how_many = 32; for ($i = 0; $i < $how_many; $i++) { - $p .= "$s"; - $p .= DIRECTORY_SEPARATOR; + $p .= "$s"; + $p .= DIRECTORY_SEPARATOR; } /* path doesn't exist at this point! */ @@ -43,14 +43,13 @@ var_dump(file_get_contents($p7)); unlink($p7); for ($i = 0; $i < $how_many; $i++) { - $p0 = substr($p, 0, strlen($p) - $i*(strlen($s) + 1)); - rmdir($p0); + $p0 = substr($p, 0, strlen($p) - $i*(strlen($s) + 1)); + rmdir($p0); } var_dump(file_exists(realpath(__DIR__) . DIRECTORY_SEPARATOR . $s)); ?> -===DONE=== --EXPECTF-- %d%d%d%d %s\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü\ @@ -61,4 +60,3 @@ bool(true) int(5) string(5) "hello" bool(false) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_long_path_bug30730.phpt b/ext/standard/tests/file/windows_mb_path/test_long_path_bug30730.phpt index d572206c5d..6acdddd4c2 100644 --- a/ext/standard/tests/file/windows_mb_path/test_long_path_bug30730.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_long_path_bug30730.phpt @@ -34,11 +34,9 @@ var_dump(unlink($dest_file)); var_dump(rmdir($dest_dir)); ?> -===DONE=== --EXPECT-- bool(true) bool(true) bool(true) bool(true) bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_long_path_bug70943.phpt b/ext/standard/tests/file/windows_mb_path/test_long_path_bug70943.phpt index 6dd1e21afb..5b797d293b 100644 --- a/ext/standard/tests/file/windows_mb_path/test_long_path_bug70943.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_long_path_bug70943.phpt @@ -17,15 +17,13 @@ touch($testFile); echo "Opening file... "; if ($fp = fopen($testFile, "r")) { - fclose($fp); - echo "OK", "\n"; + fclose($fp); + echo "OK", "\n"; } unlink($testFile); ?> -===DONE=== --EXPECT-- Generating a file with a path length of 259 characters... Opening file... OK -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_long_path_bug71103.phpt b/ext/standard/tests/file/windows_mb_path/test_long_path_bug71103.phpt index 7a83c1e4f9..a81ff66dfb 100644 --- a/ext/standard/tests/file/windows_mb_path/test_long_path_bug71103.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_long_path_bug71103.phpt @@ -20,31 +20,30 @@ $bar = $d . '\\5b53796d666f6e795c42756e646c655c5477696742756e646c655c436f6e74726 mkdir($d, NULL, true); foreach (array($foo, $bar) as $f) { - touch($f); - - $foo_obj = new \SplFileInfo($f); - var_dump( - $f, - strlen($f) > 260, /* exceeds _MAX_PATH */ - file_exists($f), - file_exists($foo_obj), - is_readable($f), - is_readable($foo_obj), - is_writable($f), - is_writable($foo_obj) - ); - - unlink($f); + touch($f); + + $foo_obj = new \SplFileInfo($f); + var_dump( + $f, + strlen($f) > 260, /* exceeds _MAX_PATH */ + file_exists($f), + file_exists($foo_obj), + is_readable($f), + is_readable($foo_obj), + is_writable($f), + is_writable($foo_obj) + ); + + unlink($f); } $p = $d; do { - rmdir($p); - $p = dirname($p); + rmdir($p); + $p = dirname($p); } while ($p != $base); ?> -===DONE=== --EXPECTF-- string(%d) "%s\dev\http\tproj\app\cache\dev_old\annotations\72\5b53796d666f6e795c42756e646c655c5477696742756e646c655c436f6e74726f6c6c65725c457863657074696f6e436f6e74726f6c6c657223676574416e64436c65616e4f7574707574427566666572696e67405b416e6e6f745d5d5b.doctrinecache.data" bool(true) @@ -62,4 +61,3 @@ bool(true) bool(true) bool(true) bool(true) -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_long_path_mkdir.phpt b/ext/standard/tests/file/windows_mb_path/test_long_path_mkdir.phpt index 287dbf192e..1e3d7cd19c 100644 --- a/ext/standard/tests/file/windows_mb_path/test_long_path_mkdir.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_long_path_mkdir.phpt @@ -20,15 +20,15 @@ $s = str_repeat('a', 50); $how_many = 32; for ($i = 0; $i < $how_many; $i++) { - $p .= "$s\\"; + $p .= "$s\\"; } $start = realpath(__DIR__); $newstart = false; if (strlen($start) <= 248) { - // create the exact length - $start = $start . "\\" . str_repeat('a', 251 - strlen($start) - 1); - $newstart = true; + // create the exact length + $start = $start . "\\" . str_repeat('a', 251 - strlen($start) - 1); + $newstart = true; } var_dump($start); @@ -46,15 +46,14 @@ var_dump(file_get_contents($p7)); // cleanup unlink($p7); for ($i = 0; $i < $how_many; $i++) { - $p0 = substr($p, 0, strlen($p) - $i*51); - rmdir($p0); + $p0 = substr($p, 0, strlen($p) - $i*51); + rmdir($p0); } if ($newstart) { - rmdir($start); + rmdir($start); } ?> -===DONE=== --EXPECTF-- string(251) "%s" string(1884) "%s" @@ -62,4 +61,3 @@ bool(true) bool(true) int(5) string(5) "hello" -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_readdir_mb_names.phpt b/ext/standard/tests/file/windows_mb_path/test_readdir_mb_names.phpt index cbecf27929..84fe5e3273 100644 --- a/ext/standard/tests/file/windows_mb_path/test_readdir_mb_names.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_readdir_mb_names.phpt @@ -49,14 +49,13 @@ if (is_dir($dirw)) { closedir($dh); } } else { - echo "is_dir failed\n"; + echo "is_dir failed\n"; } set_active_cp($old_cp); remove_data("mb_names"); ?> -===DONE=== --EXPECTF-- Active code page: 65001 filename: . : filetype: dir @@ -78,4 +77,3 @@ filename: テストマルãƒãƒã‚¤ãƒˆãƒ»ãƒ‘ス42 : filetype: dir filename: 測試多å—節路徑 : filetype: file filename: 測試多å—節路徑5 : filetype: dir Active code page: %d -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/test_rename_mb_names.phpt b/ext/standard/tests/file/windows_mb_path/test_rename_mb_names.phpt index 6e00d69075..53dd1bd3ea 100644 --- a/ext/standard/tests/file/windows_mb_path/test_rename_mb_names.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_rename_mb_names.phpt @@ -57,7 +57,6 @@ set_active_cp($old_cp); remove_data("file2_mb"); ?> -===DONE=== --EXPECTF-- Active code page: 65001 bool(true) @@ -68,4 +67,3 @@ string(27) "測試多å—節路徑17.txt" bool(true) bool(true) Active code page: %d -===DONE=== diff --git a/ext/standard/tests/file/windows_mb_path/util.inc b/ext/standard/tests/file/windows_mb_path/util.inc index fc80a7613f..a26a66c017 100644 --- a/ext/standard/tests/file/windows_mb_path/util.inc +++ b/ext/standard/tests/file/windows_mb_path/util.inc @@ -2,153 +2,153 @@ function get_active_cp($kind = "") { - if (version_compare(PHP_VERSION, '7.1', '<')) { - $s = exec("chcp"); - preg_match(",.*: (\d+),", $s, $m); - - return $m[1]; - } else { - return sapi_windows_cp_get($kind); - } + if (version_compare(PHP_VERSION, '7.1', '<')) { + $s = exec("chcp"); + preg_match(",.*: (\d+),", $s, $m); + + return $m[1]; + } else { + return sapi_windows_cp_get($kind); + } } function set_active_cp($cp, $echo = true) { - if (version_compare(PHP_VERSION, '7.1', '<')) { - $ret = exec("chcp $cp"); - } else { - if (!sapi_windows_cp_set($cp)) { - echo "Failed to set cp $cp\n"; - return; - } - - if ($echo) echo "Active code page: ", get_active_cp(), "\n"; - } + if (version_compare(PHP_VERSION, '7.1', '<')) { + $ret = exec("chcp $cp"); + } else { + if (!sapi_windows_cp_set($cp)) { + echo "Failed to set cp $cp\n"; + return; + } + + if ($echo) echo "Active code page: ", get_active_cp(), "\n"; + } } function get_basename_with_cp($path, $cp, $echo = true) { - $old_cp = get_active_cp(); - set_active_cp($cp, $echo); + $old_cp = get_active_cp(); + set_active_cp($cp, $echo); - if ($echo) echo "getting basename of $path\n"; + if ($echo) echo "getting basename of $path\n"; - $cmd = "powershell -command \"Get-Item -Path '$path' | Format-Table -HideTableHeaders Name\""; - $out = trim(shell_exec($cmd)); + $cmd = "powershell -command \"Get-Item -Path '$path' | Format-Table -HideTableHeaders Name\""; + $out = trim(shell_exec($cmd)); - if ($echo) var_dump($out, $out == basename($path)); - if ($echo) var_dump(realpath($path)); + if ($echo) var_dump($out, $out == basename($path)); + if ($echo) var_dump(realpath($path)); - set_active_cp($old_cp, $echo); + set_active_cp($old_cp, $echo); - return $out; + return $out; } function skip_if_wrong_cp($cp, $kind = "") { - if (get_active_cp($kind) != $cp) { - die("skip this test expect codepage $cp"); - } + if (get_active_cp($kind) != $cp) { + die("skip this test expect codepage $cp"); + } } function skip_if_no_required_exts() { - $exts = func_get_args(); - $exts[] = "iconv"; - - foreach ($exts as $ext) { - if (!extension_loaded($ext)) { - die("skip $ext is not loaded"); - } - } + $exts = func_get_args(); + $exts[] = "iconv"; + + foreach ($exts as $ext) { + if (!extension_loaded($ext)) { + die("skip $ext is not loaded"); + } + } } function skip_if_not_win() { - if(substr(PHP_OS, 0, 3) != 'WIN' ) { - die('skip windows only test'); - } + if(substr(PHP_OS, 0, 3) != 'WIN' ) { + die('skip windows only test'); + } } function create_verify_file($prefix, $basename, $content = "", $cp = 65001) { - $full = $prefix . DIRECTORY_SEPARATOR . $basename; - - if (!touch($full)) { - echo "failed to touch create $full\n"; - return; - } - - $now = get_basename_with_cp($full, $cp, false); - if ($now !== $basename) { - echo "expected '$basename', got '$now'\n"; - return; - } - - if ($content) { - file_put_contents($full, $content); - } + $full = $prefix . DIRECTORY_SEPARATOR . $basename; + + if (!touch($full)) { + echo "failed to touch create $full\n"; + return; + } + + $now = get_basename_with_cp($full, $cp, false); + if ($now !== $basename) { + echo "expected '$basename', got '$now'\n"; + return; + } + + if ($content) { + file_put_contents($full, $content); + } } function create_verify_dir($prefix, $basename, $cp = 65001) { - $full = $prefix . DIRECTORY_SEPARATOR . $basename; + $full = $prefix . DIRECTORY_SEPARATOR . $basename; - if (!mkdir($full)) { - echo "failed to create dir '$full'\n"; - return; - } + if (!mkdir($full)) { + echo "failed to create dir '$full'\n"; + return; + } - $now = get_basename_with_cp($full, $cp, false); - if ($now !== $basename) { - echo "expected '$basename', got '$now'\n"; - } + $now = get_basename_with_cp($full, $cp, false); + if ($now !== $basename) { + echo "expected '$basename', got '$now'\n"; + } } function remove_data($id, $dir = NULL) { - if (!$dir) { - $dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . $id; - } - - if (is_dir($dir)) { - $objects = scandir($dir); - foreach ($objects as $object) { - if ($object != "." && $object != "..") { - if (filetype($dir . DIRECTORY_SEPARATOR . $object) == "dir") - remove_data($id, $dir . DIRECTORY_SEPARATOR . $object); - else - unlink($dir . DIRECTORY_SEPARATOR . $object); - } - } - reset($objects); - rmdir($dir); - } + if (!$dir) { + $dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . $id; + } + + if (is_dir($dir)) { + $objects = scandir($dir); + foreach ($objects as $object) { + if ($object != "." && $object != "..") { + if (filetype($dir . DIRECTORY_SEPARATOR . $object) == "dir") + remove_data($id, $dir . DIRECTORY_SEPARATOR . $object); + else + unlink($dir . DIRECTORY_SEPARATOR . $object); + } + } + reset($objects); + rmdir($dir); + } } function create_data($id, $item = "", $cp = 65001, $utf8 = true) { - if ($utf8) { - /* Keep this file ASCII, so zend.multibyte related stuff can be tasted as well. */ - include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util_utf8.inc"; - return create_data_from_utf8($id, $item, $cp); - } else { - - $prefix = dirname(__FILE__) . DIRECTORY_SEPARATOR . $id; - - if (!is_dir($prefix)) { - mkdir($prefix); - } - - if (0 === strpos($id, "dir")) { - create_verify_dir($prefix, $item, $cp); - } else if (0 === strpos($id, "file")) { - /* a bit unhandy, but content can be put from outside, if needed */ - create_verify_file($prefix, $item, "dummy content", $cp); - } else { - echo "Item has either to start with \"dir\" or \"file\""; - } - } - - return $prefix; + if ($utf8) { + /* Keep this file ASCII, so zend.multibyte related stuff can be tasted as well. */ + include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util_utf8.inc"; + return create_data_from_utf8($id, $item, $cp); + } else { + + $prefix = dirname(__FILE__) . DIRECTORY_SEPARATOR . $id; + + if (!is_dir($prefix)) { + mkdir($prefix); + } + + if (0 === strpos($id, "dir")) { + create_verify_dir($prefix, $item, $cp); + } else if (0 === strpos($id, "file")) { + /* a bit unhandy, but content can be put from outside, if needed */ + create_verify_file($prefix, $item, "dummy content", $cp); + } else { + echo "Item has either to start with \"dir\" or \"file\""; + } + } + + return $prefix; } diff --git a/ext/standard/tests/file/windows_mb_path/util_utf8.inc b/ext/standard/tests/file/windows_mb_path/util_utf8.inc index e091564998..e51fad13b6 100644 --- a/ext/standard/tests/file/windows_mb_path/util_utf8.inc +++ b/ext/standard/tests/file/windows_mb_path/util_utf8.inc @@ -2,93 +2,93 @@ function create_data_from_utf8($id, $item = "", $cp = 65001) { - $prefix = dirname(__FILE__) . DIRECTORY_SEPARATOR . $id; + $prefix = dirname(__FILE__) . DIRECTORY_SEPARATOR . $id; - if (!is_dir($prefix)) { - mkdir($prefix); - } + if (!is_dir($prefix)) { + mkdir($prefix); + } - /* Using a UTF-8 encoded filenames if !zend.multibyte, otherwise files in retrospective charset. */ - switch ($id) { + /* Using a UTF-8 encoded filenames if !zend.multibyte, otherwise files in retrospective charset. */ + switch ($id) { - case "file_mb3": - $content = "<?php + case "file_mb3": + $content = "<?php echo \"hello there from the include\n\";"; - create_verify_file($prefix, "ÄeskýtestovánÃ.inc", $content); - break; + create_verify_file($prefix, "ÄeskýtestovánÃ.inc", $content); + break; - case "bug71509": - $content = "that's my file with swedish filename + case "bug71509": + $content = "that's my file with swedish filename "; - create_verify_file($prefix, $item, $content); - break; + create_verify_file($prefix, $item, $content); + break; - case "file_mb4": - create_verify_file($prefix, "Å¡.txt", ""); - break; + case "file_mb4": + create_verify_file($prefix, "Å¡.txt", ""); + break; - case "file_cp1252": - $content = "hallo + case "file_cp1252": + $content = "hallo "; - create_verify_file($prefix, "tschüß", $content); - break; - - case "file2_cp1252": - create_verify_file($prefix, $item, "hola"); - break; - - case "file2_mb": - create_verify_file($prefix, "Ελλάδα.txt", ""); - break; - - case "file_cp1251": - create_verify_file($prefix, $item, "opened an utf8 filename for reading", $cp); - break; - - case "file_cp1255": - case "file_cp1254": - case "file_cp1253": - case "file_kartuli": - case "file_cp1250": - case "file_cp1256": - case "file_cp874": - case "file_big5": - case "file_cp936": - case "file_cp932": - case "file_eucjp": - case "file_mb": - $content = "reading file wihh multibyte filename + create_verify_file($prefix, "tschüß", $content); + break; + + case "file2_cp1252": + create_verify_file($prefix, $item, "hola"); + break; + + case "file2_mb": + create_verify_file($prefix, "Ελλάδα.txt", ""); + break; + + case "file_cp1251": + create_verify_file($prefix, $item, "opened an utf8 filename for reading", $cp); + break; + + case "file_cp1255": + case "file_cp1254": + case "file_cp1253": + case "file_kartuli": + case "file_cp1250": + case "file_cp1256": + case "file_cp874": + case "file_big5": + case "file_cp936": + case "file_cp932": + case "file_eucjp": + case "file_mb": + $content = "reading file wihh multibyte filename "; - create_verify_file($prefix, $item, $content, $cp); - break; - - case "dir_mb": - create_verify_dir($prefix, "テストマルãƒãƒã‚¤ãƒˆãƒ»ãƒ‘ス42"); - break; - - case "dir_cp1255": - case "dir_cp1254": - case "dir_cp1253": - case "dir_kartuli": - case "dir_cp1250": - case "dir_cp1256": - case "dir_cp874": - case "dir_cp932": - case "dir_cp936": - case "dir_eucjp": - case "dir2_cp1252": - case "dir_cp1252": - case "dir_cp1251": - case "dir_big5": - case "dir": - create_verify_dir($prefix, $item, $cp); - break; - - case "file": - create_verify_file($prefix, $item, "", $cp); - break; - } - - return $prefix; + create_verify_file($prefix, $item, $content, $cp); + break; + + case "dir_mb": + create_verify_dir($prefix, "テストマルãƒãƒã‚¤ãƒˆãƒ»ãƒ‘ス42"); + break; + + case "dir_cp1255": + case "dir_cp1254": + case "dir_cp1253": + case "dir_kartuli": + case "dir_cp1250": + case "dir_cp1256": + case "dir_cp874": + case "dir_cp932": + case "dir_cp936": + case "dir_eucjp": + case "dir2_cp1252": + case "dir_cp1252": + case "dir_cp1251": + case "dir_big5": + case "dir": + create_verify_dir($prefix, $item, $cp); + break; + + case "file": + create_verify_file($prefix, $item, "", $cp); + break; + } + + return $prefix; } |