summaryrefslogtreecommitdiff
path: root/ext/standard
diff options
context:
space:
mode:
authorJani Taskinen <jani@php.net>2007-11-05 17:43:21 +0000
committerJani Taskinen <jani@php.net>2007-11-05 17:43:21 +0000
commitb3a334eaf20e4f6b05e9c6a0472d99df98b6dcbb (patch)
treed0bc247698bceba73d299ed08ce32710ec8f1dfd /ext/standard
parent43e73a56ab126076bb31ef04c7656aa0734c5921 (diff)
downloadphp-git-b3a334eaf20e4f6b05e9c6a0472d99df98b6dcbb.tar.gz
Fix tests (MFH)
Diffstat (limited to 'ext/standard')
-rw-r--r--ext/standard/tests/file/005_error.phpt37
-rw-r--r--ext/standard/tests/file/006_error.phpt14
-rw-r--r--ext/standard/tests/file/006_variation2.phpt48
-rw-r--r--ext/standard/tests/file/bug37864.phpt2
-rw-r--r--ext/standard/tests/file/bug38450.phpt6
-rw-r--r--ext/standard/tests/file/bug38450_1.phpt6
-rw-r--r--ext/standard/tests/file/bug39551.phpt4
-rw-r--r--ext/standard/tests/file/bug40374.phpt2
-rw-r--r--ext/standard/tests/file/bug41815.phpt2
-rw-r--r--ext/standard/tests/file/clearstatcache_error.phpt5
-rw-r--r--ext/standard/tests/file/copy_basic.phpt1
-rw-r--r--ext/standard/tests/file/copy_error.phpt7
-rw-r--r--ext/standard/tests/file/copy_variation1.phpt2
-rw-r--r--ext/standard/tests/file/copy_variation10.phpt2
-rw-r--r--ext/standard/tests/file/copy_variation11.phpt2
-rw-r--r--ext/standard/tests/file/copy_variation13.phpt2
-rw-r--r--ext/standard/tests/file/copy_variation14.phpt2
-rw-r--r--ext/standard/tests/file/copy_variation15.phpt2
-rw-r--r--ext/standard/tests/file/copy_variation16-win32.phpt2
-rw-r--r--ext/standard/tests/file/copy_variation17.phpt2
-rw-r--r--ext/standard/tests/file/copy_variation18.phpt3
-rw-r--r--ext/standard/tests/file/copy_variation2-win32.phpt33
-rw-r--r--ext/standard/tests/file/copy_variation2.phpt2
-rw-r--r--ext/standard/tests/file/copy_variation3-win32.phpt4
-rw-r--r--ext/standard/tests/file/copy_variation3.phpt4
-rw-r--r--ext/standard/tests/file/copy_variation4-win32.phptbin4276 -> 4277 bytes
-rw-r--r--ext/standard/tests/file/copy_variation4.phptbin4480 -> 4481 bytes
-rw-r--r--ext/standard/tests/file/copy_variation5-win32.phpt2
-rw-r--r--ext/standard/tests/file/copy_variation5.phpt3
-rw-r--r--ext/standard/tests/file/copy_variation6.phpt2
-rw-r--r--ext/standard/tests/file/copy_variation7.phpt2
-rw-r--r--ext/standard/tests/file/copy_variation9.phpt2
-rw-r--r--ext/standard/tests/file/disk_free_space_basic.phpt29
-rw-r--r--ext/standard/tests/file/disk_free_space_error-win32.phpt1
-rw-r--r--ext/standard/tests/file/disk_free_space_error.phpt11
-rw-r--r--ext/standard/tests/file/disk_free_space_variation.phpt28
-rw-r--r--ext/standard/tests/file/disk_total_space_basic.phpt32
-rw-r--r--ext/standard/tests/file/disk_total_space_error-win32.phpt1
-rw-r--r--ext/standard/tests/file/disk_total_space_error.phpt9
-rw-r--r--ext/standard/tests/file/disk_total_space_variation.phpt21
-rw-r--r--ext/standard/tests/file/fflush_error.phpt6
-rw-r--r--ext/standard/tests/file/fflush_variation1-win32.phpt7
-rwxr-xr-xext/standard/tests/file/fflush_variation1.phpt18
-rwxr-xr-xext/standard/tests/file/fflush_variation2.phpt5
-rwxr-xr-xext/standard/tests/file/fflush_variation3.phpt5
-rwxr-xr-xext/standard/tests/file/fflush_variation4.phpt5
-rw-r--r--ext/standard/tests/file/file_basic.phpt9
-rw-r--r--ext/standard/tests/file/file_error.phpt20
-rw-r--r--ext/standard/tests/file/file_variation.phpt209
-rw-r--r--ext/standard/tests/file/filegroup_error.phpt5
-rw-r--r--ext/standard/tests/file/fileinode_basic.phpt1
-rw-r--r--ext/standard/tests/file/fileinode_error.phpt4
-rw-r--r--ext/standard/tests/file/fileinode_variation.phpt11
-rw-r--r--ext/standard/tests/file/fileowner_basic.phpt1
-rw-r--r--ext/standard/tests/file/fileowner_error.phpt5
-rw-r--r--ext/standard/tests/file/filesize_basic.phpt1
-rw-r--r--ext/standard/tests/file/filesize_error.phpt5
-rw-r--r--ext/standard/tests/file/filesize_variation2.phpt6
-rw-r--r--ext/standard/tests/file/filesize_variation3-win32.phpt3
-rw-r--r--ext/standard/tests/file/filesize_variation4-win32.phpt9
-rw-r--r--ext/standard/tests/file/filesize_variation4.phpt2
-rw-r--r--ext/standard/tests/file/filetype_error.phpt6
-rw-r--r--ext/standard/tests/file/flock_variation.phpt43
-rw-r--r--ext/standard/tests/file/fnmatch_error.phpt14
-rw-r--r--ext/standard/tests/file/fnmatch_variation.phpt38
-rw-r--r--ext/standard/tests/file/fpassthru_basic.phpt2
-rwxr-xr-xext/standard/tests/file/fputcsv.phpt4
-rw-r--r--ext/standard/tests/file/fputcsv_error.phpt1
-rw-r--r--ext/standard/tests/file/fputcsv_variation1.phpt1
-rw-r--r--ext/standard/tests/file/fputcsv_variation10.phpt1
-rw-r--r--ext/standard/tests/file/fputcsv_variation11.phpt1
-rw-r--r--ext/standard/tests/file/fputcsv_variation12.phpt1
-rw-r--r--ext/standard/tests/file/fputcsv_variation13.phpt1
-rw-r--r--ext/standard/tests/file/fputcsv_variation14.phpt1
-rw-r--r--ext/standard/tests/file/fputcsv_variation2.phpt1
-rw-r--r--ext/standard/tests/file/fputcsv_variation3.phpt1
-rw-r--r--ext/standard/tests/file/fputcsv_variation4.phpt1
-rw-r--r--ext/standard/tests/file/fputcsv_variation5.phpt1
-rw-r--r--ext/standard/tests/file/fputcsv_variation6.phpt1
-rw-r--r--ext/standard/tests/file/fputcsv_variation7.phpt1
-rw-r--r--ext/standard/tests/file/fputcsv_variation8.phpt1
-rw-r--r--ext/standard/tests/file/fputcsv_variation9.phpt1
-rw-r--r--ext/standard/tests/file/fscanf.phpt14
-rw-r--r--ext/standard/tests/file/fscanf_error.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation1.phpt5
-rw-r--r--ext/standard/tests/file/fscanf_variation10.phpt5
-rw-r--r--ext/standard/tests/file/fscanf_variation11.phpt29
-rw-r--r--ext/standard/tests/file/fscanf_variation12.phpt5
-rw-r--r--ext/standard/tests/file/fscanf_variation13.phpt5
-rw-r--r--ext/standard/tests/file/fscanf_variation14.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation15.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation16.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation17.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation18.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation19.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation2.phpt5
-rw-r--r--ext/standard/tests/file/fscanf_variation20.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation21.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation22.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation23.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation24.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation25.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation26.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation27.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation28.phpt2
-rw-r--r--ext/standard/tests/file/fscanf_variation29.phpt13
-rw-r--r--ext/standard/tests/file/fscanf_variation3.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation30.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation31.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation32.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation33.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation34.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation35.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation36.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation37.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation38.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation39.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation4.phpt5
-rw-r--r--ext/standard/tests/file/fscanf_variation40.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation41.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation42.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation43.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation44.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation45.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation46.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation47.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation49.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation5.phpt29
-rw-r--r--ext/standard/tests/file/fscanf_variation50.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation51.phpt3
-rw-r--r--ext/standard/tests/file/fscanf_variation52.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation53.phpt1
-rw-r--r--ext/standard/tests/file/fscanf_variation54.phpt3
-rw-r--r--ext/standard/tests/file/fscanf_variation55.phpt5
-rw-r--r--ext/standard/tests/file/fscanf_variation6.phpt5
-rw-r--r--ext/standard/tests/file/fscanf_variation7.phpt5
-rw-r--r--ext/standard/tests/file/fscanf_variation8.phpt5
-rw-r--r--ext/standard/tests/file/fscanf_variation9.phpt1
-rw-r--r--ext/standard/tests/file/fseek_ftell_rewind_basic1.phpt2
-rw-r--r--ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt10
-rw-r--r--ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt9
-rw-r--r--ext/standard/tests/file/fseek_ftell_rewind_variation1.phpt2
-rw-r--r--ext/standard/tests/file/fseek_ftell_rewind_variation2-win32.phpt367
-rw-r--r--ext/standard/tests/file/fseek_ftell_rewind_variation2.phpt9
-rw-r--r--ext/standard/tests/file/fseek_ftell_rewind_variation3.phpt2
-rw-r--r--ext/standard/tests/file/fseek_ftell_rewind_variation4-win32.phpt7
-rw-r--r--ext/standard/tests/file/fseek_ftell_rewind_variation4.phpt9
-rw-r--r--ext/standard/tests/file/fseek_ftell_rewind_variation5.phpt2
-rw-r--r--ext/standard/tests/file/fseek_ftell_rewind_variation6-win32.phpt10
-rw-r--r--ext/standard/tests/file/fseek_ftell_rewind_variation6.phpt9
-rw-r--r--ext/standard/tests/file/fseek_ftell_rewind_variation7.phpt2
-rw-r--r--ext/standard/tests/file/fseek_ftell_rewind_variation8-win32.phpt9
-rw-r--r--ext/standard/tests/file/fseek_ftell_rewind_variation8.phpt9
-rw-r--r--ext/standard/tests/file/ftruncate_error.phpt2
-rw-r--r--ext/standard/tests/file/ftruncate_variation1-win32.phpt2
-rw-r--r--ext/standard/tests/file/ftruncate_variation2-win32.phpt2
-rw-r--r--ext/standard/tests/file/ftruncate_variation3-win32.phpt2
-rw-r--r--ext/standard/tests/file/ftruncate_variation4-win32.phpt2
-rw-r--r--ext/standard/tests/file/ftruncate_variation5-win32.phpt2
-rw-r--r--ext/standard/tests/file/ftruncate_variation6-win32.phpt2
-rw-r--r--ext/standard/tests/file/ftruncate_variation7-win32.phpt2
-rw-r--r--ext/standard/tests/file/htmlentities19.phpt1
-rw-r--r--ext/standard/tests/file/htmlspecialchars.phpt1
-rw-r--r--ext/standard/tests/file/is_dir_error.phpt6
-rw-r--r--ext/standard/tests/file/is_dir_variation2.phpt2
-rw-r--r--ext/standard/tests/file/is_dir_variation3.phpt8
-rw-r--r--ext/standard/tests/file/is_executable_basic.phpt1
-rw-r--r--ext/standard/tests/file/is_executable_error.phpt4
-rw-r--r--ext/standard/tests/file/is_executable_variation1.phpt10
-rw-r--r--ext/standard/tests/file/is_executable_variation2.phpt10
-rw-r--r--ext/standard/tests/file/is_executable_variation3.phpt14
-rw-r--r--ext/standard/tests/file/is_file_error.phpt13
-rw-r--r--ext/standard/tests/file/is_file_variation3.phpt10
-rw-r--r--ext/standard/tests/file/is_readable_error.phpt4
-rw-r--r--ext/standard/tests/file/is_readable_variation1.phpt10
-rw-r--r--ext/standard/tests/file/is_readable_variation2.phpt10
-rw-r--r--ext/standard/tests/file/is_readable_variation3.phpt14
-rw-r--r--ext/standard/tests/file/is_writable_error.phpt8
-rw-r--r--ext/standard/tests/file/is_writable_variation1.phpt12
-rw-r--r--ext/standard/tests/file/is_writable_variation2.phpt10
-rw-r--r--ext/standard/tests/file/is_writable_variation3.phpt18
-rw-r--r--ext/standard/tests/file/lstat_stat_error.phpt22
-rw-r--r--ext/standard/tests/file/lstat_stat_variation14.phpt2
-rw-r--r--ext/standard/tests/file/lstat_stat_variation18.phpt2
-rw-r--r--ext/standard/tests/file/lstat_stat_variation19.phpt3
-rwxr-xr-xext/standard/tests/file/lstat_stat_variation2.phpt9
-rw-r--r--ext/standard/tests/file/lstat_stat_variation21.phpt1
-rwxr-xr-xext/standard/tests/file/lstat_stat_variation5.phpt1
-rwxr-xr-xext/standard/tests/file/lstat_stat_variation6.phpt2
-rw-r--r--ext/standard/tests/file/lstat_stat_variation7.phpt2
-rw-r--r--ext/standard/tests/file/lstat_stat_variation8.phpt4
-rw-r--r--ext/standard/tests/file/lstat_stat_variation9.phpt9
-rw-r--r--ext/standard/tests/file/mkdir_rmdir_error.phpt32
-rw-r--r--ext/standard/tests/file/mkdir_rmdir_variation2.phpt2
-rw-r--r--ext/standard/tests/file/popen_pclose_basic-win32.phpt4
-rw-r--r--ext/standard/tests/file/popen_pclose_basic.phpt33
-rw-r--r--ext/standard/tests/file/popen_pclose_error-sunos.phpt8
-rw-r--r--ext/standard/tests/file/popen_pclose_error-win32.phpt4
-rw-r--r--ext/standard/tests/file/popen_pclose_error.phpt5
-rw-r--r--ext/standard/tests/file/readfile_basic-win32.phpt2
-rw-r--r--ext/standard/tests/file/readfile_basic.phpt2
-rw-r--r--ext/standard/tests/file/readfile_variation2.phpt2
-rw-r--r--ext/standard/tests/file/readfile_variation3.phpt2
-rw-r--r--ext/standard/tests/file/realpath_basic-win32.phpt10
-rw-r--r--ext/standard/tests/file/realpath_error-win32.phpt4
-rw-r--r--ext/standard/tests/file/realpath_variation-win32.phpt2
-rw-r--r--ext/standard/tests/file/rename_variation-win32.phpt218
-rw-r--r--ext/standard/tests/file/stat_basic-win32.phpt3
-rw-r--r--ext/standard/tests/file/stat_error-win32.phpt13
-rw-r--r--ext/standard/tests/file/stat_variation1-win32.phpt1
-rw-r--r--ext/standard/tests/file/stat_variation2-win32.phpt1
-rw-r--r--ext/standard/tests/file/stat_variation3-win32.phpt6
-rw-r--r--ext/standard/tests/file/stat_variation4-win32.phpt6
-rw-r--r--ext/standard/tests/file/stat_variation5-win32.phpt6
-rw-r--r--ext/standard/tests/file/stat_variation6-win32.phpt6
-rw-r--r--ext/standard/tests/file/stat_variation7-win32.phpt1
-rw-r--r--ext/standard/tests/file/stat_variation8-win32.phpt6
-rw-r--r--ext/standard/tests/file/stream_get_line.phpt2
-rwxr-xr-xext/standard/tests/file/stream_rfc2397_001.phpt2
-rw-r--r--ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt4
-rw-r--r--ext/standard/tests/file/tempnam_error.phpt16
-rw-r--r--ext/standard/tests/file/tempnam_variation3.phpt7
-rw-r--r--ext/standard/tests/file/tempnam_variation7.phpt9
-rw-r--r--ext/standard/tests/file/touch.phpt2
-rw-r--r--ext/standard/tests/file/umask_basic.phpt2
-rw-r--r--ext/standard/tests/file/unlink_error-win32.phpt9
-rw-r--r--ext/standard/tests/file/unlink_error.phpt12
-rw-r--r--ext/standard/tests/file/unlink_variation1-win32.phpt2
-rw-r--r--ext/standard/tests/file/unlink_variation1.phpt2
-rw-r--r--ext/standard/tests/file/unlink_variation2-win32.phpt2
-rw-r--r--ext/standard/tests/file/unlink_variation4.phpt4
-rw-r--r--ext/standard/tests/file/userdirstream.phpt1
-rw-r--r--ext/standard/tests/file/userfilters.phpt2
-rw-r--r--ext/standard/tests/file/userstreams.phpt2
-rw-r--r--ext/standard/tests/general_functions/phpcredits.phpt2
-rw-r--r--ext/standard/tests/network/bug41347.phpt4
-rw-r--r--ext/standard/tests/strings/convert_cyr_string.phpt28
237 files changed, 856 insertions, 1314 deletions
diff --git a/ext/standard/tests/file/005_error.phpt b/ext/standard/tests/file/005_error.phpt
index 77fd4731c3..fc4852e4ad 100644
--- a/ext/standard/tests/file/005_error.phpt
+++ b/ext/standard/tests/file/005_error.phpt
@@ -54,7 +54,7 @@ var_dump( filemtime(__FILE__, 100) );
var_dump( filectime(__FILE__, TRUE) );
var_dump( touch(__FILE__, 10, 100, 123) );
-echo "\n*** Done ***\n";
+echo "\nDone";
?>
--EXPECTF--
*** Testing error conditions ***
@@ -72,54 +72,55 @@ 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: Wrong parameter count for fileatime() in %s on line %d
+Warning: fileatime() expects exactly 1 parameter, 2 given in %s on line %d
NULL
-Warning: Wrong parameter count for filemtime() in %s on line %d
+Warning: filemtime() expects exactly 1 parameter, 2 given in %s on line %d
NULL
-Warning: Wrong parameter count for filectime() in %s on line %d
+Warning: filectime() expects exactly 1 parameter, 2 given in %s on line %d
NULL
-Warning: Wrong parameter count for touch() in %s on line %d
+Warning: touch() expects at most 3 parameters, 4 given in %s on line %d
NULL
-- Testing No.of arguments less than expected --
-Warning: Wrong parameter count for fileatime() in %s on line %d
+Warning: fileatime() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for filemtime() in %s on line %d
+Warning: filemtime() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for filectime() in %s on line %d
+Warning: filectime() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for touch() in %s on line %d
+Warning: touch() expects at least 1 parameter, 0 given in %s on line %d
NULL
-- Testing No.of arguments greater than expected --
-Warning: Wrong parameter count for fileatime() in %s on line %d
+Warning: fileatime() expects exactly 1 parameter, 2 given in %s on line %d
NULL
-Warning: Wrong parameter count for filemtime() in %s on line %d
+Warning: filemtime() expects exactly 1 parameter, 2 given in %s on line %d
NULL
-Warning: Wrong parameter count for filectime() in %s on line %d
+Warning: filectime() expects exactly 1 parameter, 2 given in %s on line %d
NULL
-Warning: Wrong parameter count for touch() in %s on line %d
+Warning: touch() expects at most 3 parameters, 4 given in %s on line %d
NULL
-Warning: Wrong parameter count for fileatime() in %s on line %d
+Warning: fileatime() expects exactly 1 parameter, 2 given in %s on line %d
NULL
-Warning: Wrong parameter count for filemtime() in %s on line %d
+Warning: filemtime() expects exactly 1 parameter, 2 given in %s on line %d
NULL
-Warning: Wrong parameter count for filectime() in %s on line %d
+Warning: filectime() expects exactly 1 parameter, 2 given in %s on line %d
NULL
-Warning: Wrong parameter count for touch() in %s on line %d
+Warning: touch() expects at most 3 parameters, 4 given in %s on line %d
NULL
-*** Done ***
+Done
+
diff --git a/ext/standard/tests/file/006_error.phpt b/ext/standard/tests/file/006_error.phpt
index ac95ca5700..04cc274ecc 100644
--- a/ext/standard/tests/file/006_error.phpt
+++ b/ext/standard/tests/file/006_error.phpt
@@ -83,25 +83,25 @@ Warning: fileperms(): stat failed for /no/such/file/dir in %s on line %d
bool(false)
-Warning: Wrong parameter count for chmod() in %s on line %d
+Warning: chmod() expects exactly 2 parameters, 1 given in %s on line %d
NULL
-Warning: Wrong parameter count for chmod() in %s on line %d
+Warning: chmod() expects exactly 2 parameters, 1 given in %s on line %d
NULL
-Warning: Wrong parameter count for chmod() in %s on line %d
+Warning: chmod() expects exactly 2 parameters, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for fileperms() in %s on line %d
+Warning: fileperms() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for chmod() in %s on line %d
+Warning: chmod() expects exactly 2 parameters, 3 given in %s on line %d
NULL
-Warning: Wrong parameter count for fileperms() in %s on line %d
+Warning: fileperms() expects exactly 1 parameter, 2 given in %s on line %d
NULL
-Warning: Wrong parameter count for fileperms() in %s on line %d
+Warning: fileperms() expects exactly 1 parameter, 2 given in %s on line %d
NULL
*** Done ***
diff --git a/ext/standard/tests/file/006_variation2.phpt b/ext/standard/tests/file/006_variation2.phpt
index 348e9b869e..d56207a349 100644
--- a/ext/standard/tests/file/006_variation2.phpt
+++ b/ext/standard/tests/file/006_variation2.phpt
@@ -148,23 +148,39 @@ bool(true)
bool(true)
43567
-- Iteration 12 --
-bool(true)
-100000
-bool(true)
-40000
+
+Warning: chmod() expects parameter 2 to be long, string given in %s on line %d
+NULL
+103567
+
+Warning: chmod() expects parameter 2 to be long, string given in %s on line %d
+NULL
+43567
-- Iteration 13 --
-bool(true)
-100000
-bool(true)
-40000
+
+Warning: chmod() expects parameter 2 to be long, string given in %s on line %d
+NULL
+103567
+
+Warning: chmod() expects parameter 2 to be long, string given in %s on line %d
+NULL
+43567
-- Iteration 14 --
-bool(true)
-100000
-bool(true)
-40000
+
+Warning: chmod() expects parameter 2 to be long, string given in %s on line %d
+NULL
+103567
+
+Warning: chmod() expects parameter 2 to be long, string given in %s on line %d
+NULL
+43567
-- Iteration 15 --
-bool(true)
-100000
-bool(true)
-40000
+
+Warning: chmod() expects parameter 2 to be long, string given in %s on line %d
+NULL
+103567
+
+Warning: chmod() expects parameter 2 to be long, string given in %s on line %d
+NULL
+43567
*** Done ***
diff --git a/ext/standard/tests/file/bug37864.phpt b/ext/standard/tests/file/bug37864.phpt
index d74647cc79..f8743bd5ec 100644
--- a/ext/standard/tests/file/bug37864.phpt
+++ b/ext/standard/tests/file/bug37864.phpt
@@ -2,7 +2,7 @@
Bug #37864 (file_get_contents() leaks on empty file)
--FILE--
<?php
- $tmpfname = tempnam("/tmp", "emptyfile");
+ $tmpfname = tempnam(sys_get_temp_dir(), "emptyfile");
var_dump(file_get_contents($tmpfname));
echo "done.\n";
unlink($tmpfname);
diff --git a/ext/standard/tests/file/bug38450.phpt b/ext/standard/tests/file/bug38450.phpt
index 6fcdab871c..d108897988 100644
--- a/ext/standard/tests/file/bug38450.phpt
+++ b/ext/standard/tests/file/bug38450.phpt
@@ -88,9 +88,9 @@ $myvar = "";
$fp = fopen("var://myvar", "r+");
-fwrite($fp, "line1\n");
-fwrite($fp, "line2\n");
-fwrite($fp, "line3\n");
+fwrite($fp, b"line1\n");
+fwrite($fp, b"line2\n");
+fwrite($fp, b"line3\n");
rewind($fp);
while (!feof($fp)) {
diff --git a/ext/standard/tests/file/bug38450_1.phpt b/ext/standard/tests/file/bug38450_1.phpt
index 094755e470..07e413b92b 100644
--- a/ext/standard/tests/file/bug38450_1.phpt
+++ b/ext/standard/tests/file/bug38450_1.phpt
@@ -88,9 +88,9 @@ $myvar = "";
$fp = fopen("var://myvar", "r+");
-fwrite($fp, "line1\n");
-fwrite($fp, "line2\n");
-fwrite($fp, "line3\n");
+fwrite($fp, b"line1\n");
+fwrite($fp, b"line2\n");
+fwrite($fp, b"line3\n");
rewind($fp);
while (!feof($fp)) {
diff --git a/ext/standard/tests/file/bug39551.phpt b/ext/standard/tests/file/bug39551.phpt
index 67dc7e7b23..c047a306ec 100644
--- a/ext/standard/tests/file/bug39551.phpt
+++ b/ext/standard/tests/file/bug39551.phpt
@@ -22,7 +22,3 @@ echo "Done\n";
?>
--EXPECTF--
Done
---UEXPECTF--
-Done
-
-Notice: Unknown: 0 character unicode buffer downcoded for binary stream runtime_encoding in Unknown on line 0
diff --git a/ext/standard/tests/file/bug40374.phpt b/ext/standard/tests/file/bug40374.phpt
index 2be48008d9..327289eba2 100644
--- a/ext/standard/tests/file/bug40374.phpt
+++ b/ext/standard/tests/file/bug40374.phpt
@@ -5,7 +5,7 @@ Bug #40374 (php_shutdown_temporary_directory() tries to free local value)
$file = tempnam(sys_get_temp_dir(), "test_");
var_dump($file);
-$fp = fopen($file, "w");
+$fp = fopen($file, "wt");
fwrite($fp, "test");
fclose($fp);
unlink($file);
diff --git a/ext/standard/tests/file/bug41815.phpt b/ext/standard/tests/file/bug41815.phpt
index 984682d250..f77468d96d 100644
--- a/ext/standard/tests/file/bug41815.phpt
+++ b/ext/standard/tests/file/bug41815.phpt
@@ -6,7 +6,7 @@ Bug #41815 (Concurrent read/write fails when EOF is reached)
$filename = dirname(__FILE__)."/concur_rw.txt";
@unlink($filename);
-$writer = fopen($filename, "w");
+$writer = fopen($filename, "wt");
$reader = fopen($filename, "r");
fread($reader, 1);
fwrite($writer, "foo");
diff --git a/ext/standard/tests/file/clearstatcache_error.phpt b/ext/standard/tests/file/clearstatcache_error.phpt
index 71e458083e..77a97499b1 100644
--- a/ext/standard/tests/file/clearstatcache_error.phpt
+++ b/ext/standard/tests/file/clearstatcache_error.phpt
@@ -7,12 +7,13 @@ Test clearstatcache() function: error conditions
Description: clears files status cache
*/
-echo "*** Testing clearstatcache() function: error conditions --";
+echo "*** Testing clearstatcache() function: error conditions ***\n";
var_dump( clearstatcache("file") ); //No.of args more than expected
echo "*** Done ***\n";
?>
--EXPECTF--
-*** Testing clearstatcache() function: error conditions --
+*** Testing clearstatcache() function: error conditions ***
+
Warning: Wrong parameter count for clearstatcache() in %s on line %d
NULL
*** Done ***
diff --git a/ext/standard/tests/file/copy_basic.phpt b/ext/standard/tests/file/copy_basic.phpt
index 7663dc6019..32788f9f74 100644
--- a/ext/standard/tests/file/copy_basic.phpt
+++ b/ext/standard/tests/file/copy_basic.phpt
@@ -55,3 +55,4 @@ bool(true)
%d
%d
*** Done ***
+
diff --git a/ext/standard/tests/file/copy_error.phpt b/ext/standard/tests/file/copy_error.phpt
index c0c37121d8..96072ebfba 100644
--- a/ext/standard/tests/file/copy_error.phpt
+++ b/ext/standard/tests/file/copy_error.phpt
@@ -27,12 +27,13 @@ echo "*** Done ***\n";
Warning: copy(/no/file): failed to open stream: No such file or directory in %s on line %d
bool(false)
-Warning: Wrong parameter count for copy() in %s on line %d
+Warning: copy() expects at least 2 parameters, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for copy() in %s on line %d
+Warning: copy() expects at least 2 parameters, 1 given in %s on line %d
NULL
-Warning: Wrong parameter count for copy() in %s on line %d
+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 7cf20fd749..4d0a97302a 100644
--- a/ext/standard/tests/file/copy_variation1.phpt
+++ b/ext/standard/tests/file/copy_variation1.phpt
@@ -15,7 +15,7 @@ echo "*** Test copy() function: destination file names containing numerics/strin
$file_path = dirname(__FILE__);
$src_file_name = $file_path."/copy_variation1.tmp";
$file_handle = fopen($src_file_name, "w");
-fwrite( $file_handle, str_repeat("Hello2World...\n", 100) );
+fwrite( $file_handle, str_repeat(b"Hello2World...\n", 100) );
fclose($file_handle);
/* array of destination file names */
diff --git a/ext/standard/tests/file/copy_variation10.phpt b/ext/standard/tests/file/copy_variation10.phpt
index c5cbc84254..98494af043 100644
--- a/ext/standard/tests/file/copy_variation10.phpt
+++ b/ext/standard/tests/file/copy_variation10.phpt
@@ -14,7 +14,7 @@ $file_path = dirname(__FILE__);
echo "*** Test copy(): Trying to create a copy of file with the same source name ***\n";
$file = $file_path."/copy_variation10.tmp";
$file_handle = fopen($file, "w");
-fwrite($file_handle, str_repeat("Hello2world...\n", 100));
+fwrite($file_handle, str_repeat(b"Hello2world...\n", 100));
fclose($file_handle);
var_dump( copy($file, $file) );
diff --git a/ext/standard/tests/file/copy_variation11.phpt b/ext/standard/tests/file/copy_variation11.phpt
index b01dab0890..adee8e1c65 100644
--- a/ext/standard/tests/file/copy_variation11.phpt
+++ b/ext/standard/tests/file/copy_variation11.phpt
@@ -14,7 +14,7 @@ $file_path = dirname(__FILE__);
echo "*** Test copy() function: Trying to create a copy of source file as a dir ***\n";
$file = $file_path."/copy_variation11.tmp";
$file_handle = fopen($file, "w");
-fwrite($file_handle, str_repeat("Hello, world...", 20));
+fwrite($file_handle, str_repeat(b"Hello, world...", 20));
fclose($file_handle);
$dir = $file_path."/copy_variation11";
diff --git a/ext/standard/tests/file/copy_variation13.phpt b/ext/standard/tests/file/copy_variation13.phpt
index bd1a21dab5..97fc04d5ee 100644
--- a/ext/standard/tests/file/copy_variation13.phpt
+++ b/ext/standard/tests/file/copy_variation13.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test copy() function: usage variations - src as dir and dest as an existing file(Bug #42243)
+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 );
diff --git a/ext/standard/tests/file/copy_variation14.phpt b/ext/standard/tests/file/copy_variation14.phpt
index 6eb8fe3ee4..1a39c1c6a9 100644
--- a/ext/standard/tests/file/copy_variation14.phpt
+++ b/ext/standard/tests/file/copy_variation14.phpt
@@ -15,7 +15,7 @@ $file_path = dirname(__FILE__);
echo "*** Test copy() function: Trying to create a copy of non-existing source in existing destination ***";
$file = $file_path."/copy_variation14.tmp";
$file_handle = fopen($file, "w");
-fwrite($file_handle, str_repeat("Hello2world...\n", 100));
+fwrite($file_handle, str_repeat(b"Hello2world...\n", 100));
fclose($file_handle);
var_dump( copy($file_path."/nosuchfile.tmp", $file_path."/copy_nosuchfile.tmp") ); //With non-existing source
diff --git a/ext/standard/tests/file/copy_variation15.phpt b/ext/standard/tests/file/copy_variation15.phpt
index d5b7a4b8be..a6404fcd8d 100644
--- a/ext/standard/tests/file/copy_variation15.phpt
+++ b/ext/standard/tests/file/copy_variation15.phpt
@@ -28,7 +28,7 @@ $file_path = dirname(__FILE__);
echo "*** Test copy() function: Trying to create a copy of file in a dir which doesn't have write permissions ***";
$file = $file_path."/copy_variation15.tmp";
$file_handle = fopen($file, "w");
-fwrite($file_handle, str_repeat("Hello, world...", 20));
+fwrite($file_handle, str_repeat(b"Hello, world...", 20));
fclose($file_handle);
$dir = $file_path."/copy_variation15";
diff --git a/ext/standard/tests/file/copy_variation16-win32.phpt b/ext/standard/tests/file/copy_variation16-win32.phpt
index b206968f0c..7688f5eeab 100644
--- a/ext/standard/tests/file/copy_variation16-win32.phpt
+++ b/ext/standard/tests/file/copy_variation16-win32.phpt
@@ -27,7 +27,7 @@ mkdir($dirname_with_blank);
$src_file_name = dirname(__FILE__)."/copy_variation16.tmp";
$file_handle = fopen($src_file_name, "w");
-fwrite($file_handle, str_repeat("Hello world, this is 2007 year ...\n", 100));
+fwrite($file_handle, str_repeat(b"Hello world, this is 2007 year ...\n", 100));
fclose($file_handle);
echo "- Size of source file => ";
diff --git a/ext/standard/tests/file/copy_variation17.phpt b/ext/standard/tests/file/copy_variation17.phpt
index 2dfe94c6e9..97f1665f01 100644
--- a/ext/standard/tests/file/copy_variation17.phpt
+++ b/ext/standard/tests/file/copy_variation17.phpt
@@ -14,7 +14,7 @@ $file_path = dirname(__FILE__);
echo "*** Test copy() function: With source file names containing wild-card chars ***\n";
$src_file = $file_path."/copy_variation17.tmp";
$file_handle = fopen($src_file, "w");
-fwrite($file_handle, str_repeat("Hello2world...\n", 100));
+fwrite($file_handle, str_repeat(b"Hello2world...\n", 100));
fclose($file_handle);
$dir = $file_path."/copy_variation17";
diff --git a/ext/standard/tests/file/copy_variation18.phpt b/ext/standard/tests/file/copy_variation18.phpt
index 18407bd584..65c1dc2ef6 100644
--- a/ext/standard/tests/file/copy_variation18.phpt
+++ b/ext/standard/tests/file/copy_variation18.phpt
@@ -16,7 +16,7 @@ require($file_path."/file.inc");
echo "*** Test copy() function: stat of file before and after copy ***\n";
$src_file_name = $file_path."/copy_variation18.tmp";
$file_handle = fopen($src_file_name, "w");
-fwrite($file_handle, str_repeat("Hello2world...\n", 100));
+fwrite($file_handle, str_repeat(b"Hello2world...\n", 100));
fclose($file_handle);
$dest_file_name = $file_path."/copy_copy_variation18.tmp";
@@ -43,7 +43,6 @@ echo "*** Done ***\n";
unlink(dirname(__FILE__)."/copy_copy_variation18.tmp");
unlink(dirname(__FILE__)."/copy_variation18.tmp");
?>
-
--EXPECTF--
*** Test copy() function: stat of file before and after copy ***
Copy operation => bool(true)
diff --git a/ext/standard/tests/file/copy_variation2-win32.phpt b/ext/standard/tests/file/copy_variation2-win32.phpt
index f51cbaf078..4819d63e36 100644
--- a/ext/standard/tests/file/copy_variation2-win32.phpt
+++ b/ext/standard/tests/file/copy_variation2-win32.phpt
@@ -20,7 +20,7 @@ echo "*** Test copy() function: destination file names containing special charac
$file_path = dirname(__FILE__);
$src_file_name = $file_path."/copy_variation2.tmp";
$file_handle = fopen($src_file_name, "w");
-fwrite( $file_handle, str_repeat("Hello2World...\n", 100) );
+fwrite( $file_handle, str_repeat(b"Hello2World...\n", 100) );
fclose($file_handle);
/* array of destination file names */
@@ -31,7 +31,6 @@ $dest_files = array(
"@copy_variation2.tmp",
"#copy_variation2.tmp",
"+copy_variation2.tmp",
- "*copy_variation2.tmp",
"?copy_variation2.tmp",
">copy_variation2.tmp",
"!copy_variation2.tmp",
@@ -136,90 +135,84 @@ bool(false)
Existence of destination file => bool(false)
-- Iteration 7 --
-Copy operation =>
-Warning: copy(%s): %s
-bool(false)
-Existence of destination file => bool(false)
-
--- Iteration 8 --
Copy operation => bool(true)
Existence of destination file => bool(true)
Destination file name => %s/!copy_variation2.tmp
Size of source file => int(1500)
Size of destination file => int(1500)
--- Iteration 9 --
+-- Iteration 8 --
Copy operation => bool(true)
Existence of destination file => bool(true)
Destination file name => %s/&copy_variation2.tmp
Size of source file => int(1500)
Size of destination file => int(1500)
--- Iteration 10 --
+-- Iteration 9 --
Copy operation => bool(true)
Existence of destination file => bool(true)
Destination file name => %s/(copy_variation2.tmp
Size of source file => int(1500)
Size of destination file => int(1500)
--- Iteration 11 --
+-- Iteration 10 --
Copy operation =>
Warning: copy(%s): %s
bool(false)
Existence of destination file => bool(false)
--- Iteration 12 --
+-- Iteration 11 --
Copy operation => bool(true)
Existence of destination file => bool(true)
Destination file name => %s/;copy_variation2.tmp
Size of source file => int(1500)
Size of destination file => int(1500)
--- Iteration 13 --
+-- Iteration 12 --
Copy operation => bool(true)
Existence of destination file => bool(true)
Destination file name => %s/=copy_variation2.tmp
Size of source file => int(1500)
Size of destination file => int(1500)
--- Iteration 14 --
+-- Iteration 13 --
Copy operation => bool(true)
Existence of destination file => bool(true)
Destination file name => %s/[copy_variation2.tmp
Size of source file => int(1500)
Size of destination file => int(1500)
--- Iteration 15 --
+-- Iteration 14 --
Copy operation => bool(true)
Existence of destination file => bool(true)
Destination file name => %s/^copy_variation2.tmp
Size of source file => int(1500)
Size of destination file => int(1500)
--- Iteration 16 --
+-- Iteration 15 --
Copy operation => bool(true)
Existence of destination file => bool(true)
Destination file name => %s/{copy_variation2.tmp
Size of source file => int(1500)
Size of destination file => int(1500)
--- Iteration 17 --
+-- Iteration 16 --
Copy operation =>
Warning: copy(%s): %s
bool(false)
Existence of destination file => bool(false)
--- Iteration 18 --
+-- Iteration 17 --
Copy operation => bool(true)
Existence of destination file => bool(true)
Destination file name => %s/~copy_variation2.tmp
Size of source file => int(1500)
Size of destination file => int(1500)
--- Iteration 19 --
+-- Iteration 18 --
Copy operation => bool(true)
Existence of destination file => bool(true)
Destination file name => %s/$copy_variation2.tmp
Size of source file => int(1500)
Size of destination file => int(1500)
-*** Done *** \ No newline at end of file
+*** Done ***
diff --git a/ext/standard/tests/file/copy_variation2.phpt b/ext/standard/tests/file/copy_variation2.phpt
index a9b36803d9..d99f5a8da3 100644
--- a/ext/standard/tests/file/copy_variation2.phpt
+++ b/ext/standard/tests/file/copy_variation2.phpt
@@ -20,7 +20,7 @@ echo "*** Test copy() function: destination file names containing special charac
$file_path = dirname(__FILE__);
$src_file_name = $file_path."/copy_variation2.tmp";
$file_handle = fopen($src_file_name, "w");
-fwrite( $file_handle, str_repeat("Hello2World...\n", 100) );
+fwrite( $file_handle, str_repeat(b"Hello2World...\n", 100) );
fclose($file_handle);
/* array of destination file names */
diff --git a/ext/standard/tests/file/copy_variation3-win32.phpt b/ext/standard/tests/file/copy_variation3-win32.phpt
index a9a445d696..68ce4a1680 100644
--- a/ext/standard/tests/file/copy_variation3-win32.phpt
+++ b/ext/standard/tests/file/copy_variation3-win32.phpt
@@ -20,7 +20,7 @@ echo "*** Test copy() function: destination file names containing whitespaces **
$file_path = dirname(__FILE__);
$src_file_name = $file_path."/copy_variation3.tmp";
$file_handle = fopen($src_file_name, "w");
-fwrite( $file_handle, str_repeat("Hello2World...\n", 100) );
+fwrite( $file_handle, str_repeat(b"Hello2World...\n", 100) );
fclose($file_handle);
/* array of destination file names */
@@ -106,4 +106,4 @@ Copy operation =>
Warning: copy(%s): %s
bool(false)
Existence of destination file => bool(false)
-*** Done *** \ No newline at end of file
+*** Done ***
diff --git a/ext/standard/tests/file/copy_variation3.phpt b/ext/standard/tests/file/copy_variation3.phpt
index 73bf814520..1c45c8c129 100644
--- a/ext/standard/tests/file/copy_variation3.phpt
+++ b/ext/standard/tests/file/copy_variation3.phpt
@@ -20,7 +20,7 @@ echo "*** Test copy() function: destination file names containing whitespaces **
$file_path = dirname(__FILE__);
$src_file_name = $file_path."/copy_variation3.tmp";
$file_handle = fopen($src_file_name, "w");
-fwrite( $file_handle, str_repeat("Hello2World...\n", 100) );
+fwrite( $file_handle, str_repeat(b"Hello2World...\n", 100) );
fclose($file_handle);
/* array of destination file names */
@@ -107,4 +107,4 @@ Existence of destination file => bool(true)
Destination file name =>
Size of source file => int(1500)
Size of destination file => int(1500)
-*** Done *** \ No newline at end of file
+*** Done ***
diff --git a/ext/standard/tests/file/copy_variation4-win32.phpt b/ext/standard/tests/file/copy_variation4-win32.phpt
index 3c5408aeb0..ae2a1ed527 100644
--- a/ext/standard/tests/file/copy_variation4-win32.phpt
+++ b/ext/standard/tests/file/copy_variation4-win32.phpt
Binary files differ
diff --git a/ext/standard/tests/file/copy_variation4.phpt b/ext/standard/tests/file/copy_variation4.phpt
index 38363fc89e..e656210fa9 100644
--- a/ext/standard/tests/file/copy_variation4.phpt
+++ b/ext/standard/tests/file/copy_variation4.phpt
Binary files differ
diff --git a/ext/standard/tests/file/copy_variation5-win32.phpt b/ext/standard/tests/file/copy_variation5-win32.phpt
index 48e85eaf02..baf7be470c 100644
--- a/ext/standard/tests/file/copy_variation5-win32.phpt
+++ b/ext/standard/tests/file/copy_variation5-win32.phpt
@@ -20,7 +20,7 @@ echo "*** Test copy() function: checking case sensitivity in creation of destina
$file_path = dirname(__FILE__);
$src_file_name = $file_path."/copy_variation5.tmp";
$file_handle = fopen($src_file_name, "w");
-fwrite( $file_handle, str_repeat("Hello2World...\n", 100) );
+fwrite( $file_handle, str_repeat(b"Hello2World...\n", 100) );
fclose($file_handle);
/* array of destination file names */
diff --git a/ext/standard/tests/file/copy_variation5.phpt b/ext/standard/tests/file/copy_variation5.phpt
index f4b4f01700..8abc9c961a 100644
--- a/ext/standard/tests/file/copy_variation5.phpt
+++ b/ext/standard/tests/file/copy_variation5.phpt
@@ -20,7 +20,7 @@ echo "*** Test copy() function: checking case sensitivity in creation of destina
$file_path = dirname(__FILE__);
$src_file_name = $file_path."/copy_variation5.tmp";
$file_handle = fopen($src_file_name, "w");
-fwrite( $file_handle, str_repeat("Hello2World...\n", 100) );
+fwrite( $file_handle, str_repeat(b"Hello2World...\n", 100) );
fclose($file_handle);
/* array of destination file names */
@@ -64,7 +64,6 @@ foreach($dest_files as $dest_file) {
$count++;
}
-
$count = 1;
foreach($dest_files as $dest_file) {
unlink($file_path."/".$dest_file);
diff --git a/ext/standard/tests/file/copy_variation6.phpt b/ext/standard/tests/file/copy_variation6.phpt
index 1220e34283..3213c6b436 100644
--- a/ext/standard/tests/file/copy_variation6.phpt
+++ b/ext/standard/tests/file/copy_variation6.phpt
@@ -3,7 +3,7 @@ Test copy() function: usage variations - copy empty file across dirs
--SKIPIF--
<?php
if(substr(PHP_OS, 0, 3) == "WIN")
- die("skip do not run on Windows");
+ die("skip Do not run on Windows");
?>
--FILE--
<?php
diff --git a/ext/standard/tests/file/copy_variation7.phpt b/ext/standard/tests/file/copy_variation7.phpt
index 474d33bc49..d687b073c7 100644
--- a/ext/standard/tests/file/copy_variation7.phpt
+++ b/ext/standard/tests/file/copy_variation7.phpt
@@ -20,7 +20,7 @@ $file_path = dirname(__FILE__);
echo "*** Testing copy() with symlink and hardlink ***\n";
$file = $file_path."/copy_variation7.tmp";
$file_handle = fopen($file, "w");
-fwrite( $file_handle, str_repeat("Hello World, this is 2007 year ....\n", 100) );
+fwrite( $file_handle, str_repeat(b"Hello World, this is 2007 year ....\n", 100) );
fclose($file_handle);
$symlink = $file_path."/copy_variation7_symlink.tmp";
diff --git a/ext/standard/tests/file/copy_variation9.phpt b/ext/standard/tests/file/copy_variation9.phpt
index 8f9c2e921e..d5a0587de4 100644
--- a/ext/standard/tests/file/copy_variation9.phpt
+++ b/ext/standard/tests/file/copy_variation9.phpt
@@ -29,7 +29,7 @@ $file_path = dirname(__FILE__);
echo "*** Test copy() function: destination with/without write permissions ***\n";
$src_file_name = $file_path."/copy_variation9.tmp";
$file_handle = fopen($src_file_name, "w");
-fwrite($file_handle, str_repeat("Hello2world...\n", 100));
+fwrite($file_handle, str_repeat(b"Hello2world...\n", 100));
fclose($file_handle);
$dest_file_name = $file_path."/copy_copy_variation9.tmp";
diff --git a/ext/standard/tests/file/disk_free_space_basic.phpt b/ext/standard/tests/file/disk_free_space_basic.phpt
index d9412198a0..f8684e92a9 100644
--- a/ext/standard/tests/file/disk_free_space_basic.phpt
+++ b/ext/standard/tests/file/disk_free_space_basic.phpt
@@ -7,26 +7,27 @@ memory_limit=32M
/*
* 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
+ * will return the number of bytes available on the corresponding
+ * filesystem or disk partition
*/
$file_path = dirname(__FILE__);
-include($file_path."/file.inc");
echo "*** Testing with existing directory ***\n";
var_dump( disk_free_space($file_path) );
var_dump( diskfreespace($file_path) );
-$dir = "/disk_free_space";
echo "*** Testing with newly created directory ***\n";
+$dir = "/disk_free_space";
mkdir($file_path.$dir);
echo" \n Free Space before writing to a file\n";
$space1 = disk_free_space($file_path.$dir);
-var_dump($space1);
+var_dump( $space1 );
-fill_buffer($buffer, "text", 3000000);
-file_put_contents($file_path.$dir."/disk_free_space.tmp", $buffer);
+$fh = fopen($file_path.$dir."/disk_free_space.tmp", "a");
+for( $i=1; $i<=1000; $i++)
+fwrite($fh, (binary)"x");
+fclose($fh);
echo "\n Free Space after writing to a file\n";
$space2 = disk_free_space($file_path.$dir);
@@ -37,15 +38,17 @@ if( $space1 > $space2 )
else
echo "\n Free Space Value Is Incorrect\n";
-echo"\n-- Done --";
+echo "*** Testing with Binary Input ***\n";
+var_dump( disk_free_space(b"$file_path") );
+
+echo"\n--- Done ---";
?>
--CLEAN--
<?php
$file_path = dirname(__FILE__);
-$dir = "/disk_free_space";
-unlink($file_path.$dir."/disk_free_space.tmp");
-rmdir($file_path.$dir);
+unlink($file_path."/disk_free_space/disk_free_space.tmp");
+rmdir($file_path."/disk_free_space");
?>
--EXPECTF--
@@ -61,5 +64,7 @@ float(%d)
float(%d)
Free Space Value Is Correct
+*** Testing with Binary Input ***
+float(%d)
--- Done --
+--- Done ---
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 af322f482b..21e7bf653d 100644
--- a/ext/standard/tests/file/disk_free_space_error-win32.phpt
+++ b/ext/standard/tests/file/disk_free_space_error-win32.phpt
@@ -72,3 +72,4 @@ Warning: diskfreespace(): The directory name is invalid.
bool(false)
-- Done --
+
diff --git a/ext/standard/tests/file/disk_free_space_error.phpt b/ext/standard/tests/file/disk_free_space_error.phpt
index ee5abc8e8a..ddd25a35db 100644
--- a/ext/standard/tests/file/disk_free_space_error.phpt
+++ b/ext/standard/tests/file/disk_free_space_error.phpt
@@ -1,15 +1,15 @@
--TEST--
-Test disk_free_space and its alias diskfreespace() functions : error conditions
+Test disk_free_space and its alias diskfreespace() functions : error conditions.
--SKIPIF--
<?php
-if(substr(PHP_OS, 0, 3) == 'WIN' )
- die("skip Not Valid for Windows");
+if(substr(PHP_OS, 0, 3) == 'WIN')
+ die("skip Not valid on Windows");
?>
--FILE--
<?php
/*
* Prototype: float disk_free_space( string directory )
- * Description: Given a string containing a directory, this function will
+ * Description: Given a string containing a directory, this function will
* return the number of bytes available on the corresponding
* filesystem or disk partition
*/
@@ -27,7 +27,7 @@ var_dump( disk_free_space( $file_path."/dir1" )); // Invalid directory
var_dump( diskfreespace( $file_path."/dir1" ));
$fh = fopen( $file_path."/disk_free_space.tmp", "w" );
-fwrite( $fh, " Garbage data for the temporary file" );
+fwrite( $fh, (binary)" Garbage data for the temporary file" );
var_dump( disk_free_space( $file_path."/disk_free_space.tmp" )); // file input instead of directory
var_dump( diskfreespace( $file_path."/disk_free_space.tmp" ));
fclose($fh);
@@ -64,3 +64,4 @@ float(%d)
float(%d)
-- Done --
+
diff --git a/ext/standard/tests/file/disk_free_space_variation.phpt b/ext/standard/tests/file/disk_free_space_variation.phpt
index ee72eea465..c1809986fd 100644
--- a/ext/standard/tests/file/disk_free_space_variation.phpt
+++ b/ext/standard/tests/file/disk_free_space_variation.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test disk_free_space and its alias diskfreespace() functions : usage variations
+Test disk_free_space and its alias diskfreespace() functions : Usage Variations
--FILE--
<?php
/*
@@ -11,16 +11,15 @@ Test disk_free_space and its alias diskfreespace() functions : usage variations
$file_path = dirname(__FILE__);
-echo "*** Testing disk_free_space() function with a directory ***\n";
+echo "*** Testing with a directory ***\n";
var_dump( disk_free_space($file_path."/..") );
var_dump( diskfreespace($file_path."/..") );
-echo "\n*** Testing for the return type ***\n";
+echo "\nTesting for the return type ***\n";
$return_value = disk_free_space($file_path);
var_dump( is_float($return_value) );
-echo "\n*** Testing disk_free_space() function with different styles of file and directory ***";
-
+echo "\n*** Testing with different directory combinations ***";
$dir = "/disk_free_space";
mkdir($file_path.$dir);
@@ -42,15 +41,15 @@ $dirs_arr = array(
$file_path.$dir.chr(0),
$file_path."/.".$dir.chr(0),
".".chr(0).$file_path.$dir,
- ".".chr(0).$file_path.$dir.chr(0)
+ ".".chr(0).$file_path.$dir.chr(0)
);
$count = 1;
/* loop through to test each element the above array */
-foreach($dirs_arr as $dir) {
+foreach($dirs_arr as $dir1) {
echo "\n-- Iteration $count --\n";
- var_dump( disk_free_space( $dir ) );
- var_dump( diskfreespace( $dir ) );
+ var_dump( disk_free_space( $dir1 ) );
+ var_dump( diskfreespace( $dir1 ) );
$count++;
}
@@ -59,19 +58,20 @@ echo"\n--- Done ---";
--CLEAN--
<?php
-$file_path = dirname(__FILE__)."/disk_free_space";
-rmdir($file_path);
+$file_path = dirname(__FILE__);
+rmdir($file_path."/disk_free_space");
?>
+
--EXPECTF--
-*** Testing disk_free_space() function with a directory ***
+*** Testing with a directory ***
float(%d)
float(%d)
-*** Testing for the return type ***
+Testing for the return type ***
bool(true)
-*** Testing disk_free_space() function with different styles of file and directory ***
+*** Testing with different directory combinations ***
-- Iteration 1 --
float(%d)
float(%d)
diff --git a/ext/standard/tests/file/disk_total_space_basic.phpt b/ext/standard/tests/file/disk_total_space_basic.phpt
index caf7452e41..d211f39437 100644
--- a/ext/standard/tests/file/disk_total_space_basic.phpt
+++ b/ext/standard/tests/file/disk_total_space_basic.phpt
@@ -4,31 +4,31 @@ Test disk_total_space() function : basic functionality
<?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.
+ * 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 = dirname(__FILE__);
-echo "*** Testing with existing directory ***\n";
+echo "*** Testing with normal directory ***\n";
var_dump( disk_total_space($file_path) );
echo "*** Testing with newly created directory ***\n";
-mkdir($file_path."/disk_total_space");
-var_dump( disk_total_space($file_path."/disk_total_space") );
+$dir = "/disk_total_space";
-$fh = fopen($file_path."/disk_total_space/disk_total_space.tmp", "w");
-fwrite($fh, "Garbage Data Garbage Data Garbage Data Garbage Data Garbage Data Garbage Data Garbage Data");
+mkdir($file_path.$dir);
+var_dump( disk_total_space($file_path.$dir) );
+$fh = fopen($file_path.$dir."/disk_total_space.tmp", "w");
+fwrite($fh, (binary)"Garbage Data Garbage Data Garbage Data Garbage Data Garbage Data Garbage Data Garbage Data");
fclose($fh);
-echo" \n Total Space after writing to a file\n";
-var_dump( disk_total_space($file_path."/disk_total_space") );
+echo"\nTotal Space after writing to a file\n";
+var_dump( disk_total_space($file_path.$dir) );
-echo"\n--- Done ---";
+echo"\n-- Done --";
?>
-
--CLEAN--
<?php
$file_path = dirname(__FILE__);
@@ -37,12 +37,12 @@ rmdir($file_path."/disk_total_space");
?>
--EXPECTF--
-*** Testing with existing directory ***
+*** Testing with normal directory ***
float(%d)
*** Testing with newly created directory ***
float(%d)
-
- Total Space after writing to a file
+
+Total Space after writing to a file
float(%d)
---- Done ---
+-- Done --
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 19f3f93bef..a3ea183194 100644
--- a/ext/standard/tests/file/disk_total_space_error-win32.phpt
+++ b/ext/standard/tests/file/disk_total_space_error-win32.phpt
@@ -53,3 +53,4 @@ Warning: disk_total_space(): The directory name is invalid.
bool(false)
--- Done ---
+
diff --git a/ext/standard/tests/file/disk_total_space_error.phpt b/ext/standard/tests/file/disk_total_space_error.phpt
index 4050997e8e..d986f779ba 100644
--- a/ext/standard/tests/file/disk_total_space_error.phpt
+++ b/ext/standard/tests/file/disk_total_space_error.phpt
@@ -2,14 +2,14 @@
Test disk_total_space() function : error conditions
--SKIPIF--
<?php
-if(substr(PHP_OS, 0, 3) == 'WIN' )
- die("skip Not Valid for Windows");
+if(substr(PHP_OS, 0, 3) == 'WIN')
+ die("skip Not valid on Windows");
?>
--FILE--
<?php
/*
* Prototype: float disk_total_space( string $directory );
- * Description: given a string containing a directory, this function
+ * Description: given a string containing a directory, this function
* will return the total number of bytes on the corresponding
* filesystem or disk partition
*/
@@ -24,7 +24,7 @@ var_dump( disk_total_space( $file_path, "extra argument") ); // More than valid
var_dump( disk_total_space( $file_path."/dir1" )); // Invalid directory
$fh = fopen( $file_path."/disk_total_space.tmp", "w" );
-fwrite( $fh, " Garbage data for the temporary file" );
+fwrite( $fh, (binary)" Garbage data for the temporary file" );
var_dump( disk_total_space( $file_path."/disk_total_space.tmp" )); // file input instead of directory
fclose($fh);
@@ -49,3 +49,4 @@ bool(false)
float(%d)
--- Done ---
+
diff --git a/ext/standard/tests/file/disk_total_space_variation.phpt b/ext/standard/tests/file/disk_total_space_variation.phpt
index f722883a3c..c03ba594bd 100644
--- a/ext/standard/tests/file/disk_total_space_variation.phpt
+++ b/ext/standard/tests/file/disk_total_space_variation.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test disk_total_space() functions : usage variations
+Testing disk_total_space() functions : Usage Variations.
--FILE--
<?php
/*
@@ -18,9 +18,9 @@ echo "\nTesting for the return type ***\n";
$return_value = disk_total_space($file_path);
var_dump( is_float($return_value) );
-echo "\n*** Testing disk_total_space() function with different directory combinations ***";
-
+echo "\n*** Testing with different directory combinations ***";
$dir = "/disk_total_space";
+
mkdir($file_path.$dir);
$dirs_arr = array(
@@ -29,7 +29,7 @@ $dirs_arr = array(
$file_path."/.".$dir,
/* Testing a file trailing slash */
- $file_path.$dir."/",
+ $file_path."".$dir."/",
$file_path."/.".$dir."/",
/* Testing file with double trailing slashes */
@@ -44,6 +44,7 @@ $dirs_arr = array(
".".chr(0).$file_path.$dir.chr(0)
);
+
$count = 1;
/* loop through to test each element the above array */
foreach($dirs_arr as $dir1) {
@@ -52,15 +53,19 @@ foreach($dirs_arr as $dir1) {
$count++;
}
+echo "*** Testing with Binary Input ***\n";
+var_dump( disk_total_space(b"$file_path") );
+
echo"\n--- Done ---";
?>
--CLEAN--
<?php
$file_path = dirname(__FILE__);
-$dir = "/disk_total_space";
-rmdir($file_path.$dir);
+rmdir($file_path."/disk_total_space");
?>
+
+
--EXPECTF--
*** Testing with a directory ***
float(%d)
@@ -68,7 +73,7 @@ float(%d)
Testing for the return type ***
bool(true)
-*** Testing disk_total_space() function with different directory combinations ***
+*** Testing with different directory combinations ***
-- Iteration 1 --
float(%d)
@@ -104,5 +109,7 @@ float(%d)
-- Iteration 12 --
float(%d)
+*** Testing with Binary Input ***
+float(%d)
--- Done ---
diff --git a/ext/standard/tests/file/fflush_error.phpt b/ext/standard/tests/file/fflush_error.phpt
index bfbd6cc1b1..cb183e89c0 100644
--- a/ext/standard/tests/file/fflush_error.phpt
+++ b/ext/standard/tests/file/fflush_error.phpt
@@ -41,7 +41,7 @@ for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++) {
echo "-- Iteration $loop_counter --\n";
var_dump( fflush($invalid_args[$loop_counter - 1]) );
}
-echo "Done\n";
+echo "\n*** Done ***";
?>
--CLEAN--
@@ -85,4 +85,6 @@ bool(false)
Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d
bool(false)
-Done
+
+*** Done ***
+
diff --git a/ext/standard/tests/file/fflush_variation1-win32.phpt b/ext/standard/tests/file/fflush_variation1-win32.phpt
index 63cdf1721d..0b6b096a34 100644
--- a/ext/standard/tests/file/fflush_variation1-win32.phpt
+++ b/ext/standard/tests/file/fflush_variation1-win32.phpt
@@ -37,6 +37,8 @@ foreach( $file_types as $type ) {
$file_handle = fopen($file_name, "w");
if($file_handle == false)
exit("Error:failed to open file $file_name");
+
+ // filling the file some data if mode is append mode
if( substr($mode, 0, 1) == "a")
fill_file($file_handle, $type, 10);
fclose($file_handle);
@@ -59,7 +61,7 @@ foreach( $file_types as $type ) {
$count++;
}
-
+echo "\n*** Done ***";
?>
--EXPECTF--
*** Testing fflush(): with various types of files ***
@@ -524,3 +526,6 @@ ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50)
bool(true)
bool(true)
ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50)
+
+*** Done ***
+
diff --git a/ext/standard/tests/file/fflush_variation1.phpt b/ext/standard/tests/file/fflush_variation1.phpt
index dc55fde8eb..2ecf7ea919 100755
--- a/ext/standard/tests/file/fflush_variation1.phpt
+++ b/ext/standard/tests/file/fflush_variation1.phpt
@@ -35,11 +35,14 @@ foreach( $file_types as $type ) {
// creating the file except for x mode
if( substr($mode, 0, 1) != "x" ) {
$file_handle = fopen($file_name, "w");
- if($file_handle == false)
- exit("Error:failed to open file $file_name");
- if( substr($mode, 0, 1) == "a")
- fill_file($file_handle, $type, 10);
- fclose($file_handle);
+ if($file_handle == false)
+ exit("Error:failed to open file $file_name");
+
+ // filling the file with some data if mode is append mode
+ if( substr($mode, 0, 1) == "a")
+ fill_file($file_handle, $type, 10);
+ fclose($file_handle);
+
}
// opening the file in different modes
@@ -59,7 +62,7 @@ foreach( $file_types as $type ) {
$count++;
}
-
+echo "\n*** Done ***";
?>
--EXPECTF--
*** Testing fflush(): with various types of files ***
@@ -524,3 +527,6 @@ ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50)
bool(true)
bool(true)
ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(50)
+
+*** Done ***
+
diff --git a/ext/standard/tests/file/fflush_variation2.phpt b/ext/standard/tests/file/fflush_variation2.phpt
index 9498c978ef..651c716439 100755
--- a/ext/standard/tests/file/fflush_variation2.phpt
+++ b/ext/standard/tests/file/fflush_variation2.phpt
@@ -63,7 +63,7 @@ foreach( $file_types as $type ) {
$count++;
}
-echo "\n--- Done ---";
+echo "\n*** Done ***";
?>
--EXPECTF--
*** Testing fflush(): with soft links to files opened in diff modes ***
@@ -439,4 +439,5 @@ bool(true)
bool(true)
ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60)
---- Done ---
+*** Done ***
+
diff --git a/ext/standard/tests/file/fflush_variation3.phpt b/ext/standard/tests/file/fflush_variation3.phpt
index f239602486..6dfd49bc40 100755
--- a/ext/standard/tests/file/fflush_variation3.phpt
+++ b/ext/standard/tests/file/fflush_variation3.phpt
@@ -63,7 +63,7 @@ foreach( $file_types as $type ) {
$count++;
}
-echo "\n--- Done ---";
+echo "\n*** Done ***";
?>
--EXPECTF--
*** Testing fflush(): with hard links to files opened in diff modes ***
@@ -379,4 +379,5 @@ bool(true)
bool(true)
ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 int(60)
---- Done ---
+*** Done ***
+
diff --git a/ext/standard/tests/file/fflush_variation4.phpt b/ext/standard/tests/file/fflush_variation4.phpt
index cc0d9b0fb6..f98616c3d8 100755
--- a/ext/standard/tests/file/fflush_variation4.phpt
+++ b/ext/standard/tests/file/fflush_variation4.phpt
@@ -38,7 +38,7 @@ foreach( $file_modes as $mode ) {
$count++;
}
-echo "\n--- Done ---";
+echo "\n*** Done ***";
?>
--EXPECTF--
*** Testing fflush(): with file handles of files opened in various read modes ***
@@ -49,4 +49,5 @@ bool(true)
-- Iteration 3 with file opened in rt mode --
bool(true)
---- Done ---
+*** Done ***
+
diff --git a/ext/standard/tests/file/file_basic.phpt b/ext/standard/tests/file/file_basic.phpt
index e1d9ec561a..97a592fd0c 100644
--- a/ext/standard/tests/file/file_basic.phpt
+++ b/ext/standard/tests/file/file_basic.phpt
@@ -9,7 +9,7 @@ Test file() function : basic functionality
*/
require(dirname(__FILE__) . '/file.inc');
$file_path = dirname(__FILE__);
-echo "*** Testing file() with basic files ***\n";
+echo "*** Testing file() with basic types of files ***\n";
$filetypes = array("numeric", "text", "empty", "text_with_new_line");
foreach( $filetypes as $type ) {
@@ -18,7 +18,7 @@ foreach( $filetypes as $type ) {
delete_files($file_path, 1, "file_basic");
}
-echo "*** Testing for return type of file function ***\n";
+echo "*** Testing for return type of file() function ***\n";
foreach( $filetypes as $type ) {
create_files($file_path, 1, $type, 0755, 1, "w", "file_basic");
$ret_arr = file($file_path."/file_basic1.tmp");
@@ -29,7 +29,7 @@ foreach( $filetypes as $type ) {
echo "\n--- Done ---";
?>
--EXPECTF--
-*** Testing file() with basic files ***
+*** Testing file() with basic types of files ***
Array
(
[0] => 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
@@ -67,10 +67,11 @@ Array
[11] => line
)
-*** Testing for return type of file function ***
+*** Testing for return type of file() function ***
bool(true)
bool(true)
bool(true)
bool(true)
--- Done ---
+
diff --git a/ext/standard/tests/file/file_error.phpt b/ext/standard/tests/file/file_error.phpt
index e2562d3e23..a7f83807fc 100644
--- a/ext/standard/tests/file/file_error.phpt
+++ b/ext/standard/tests/file/file_error.phpt
@@ -1,15 +1,13 @@
--TEST--
-Testing file() function : error conditions
+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
- */
-
+ 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 = dirname(__FILE__);
-
echo "\n*** Testing error conditions ***";
$file_handle = fopen($file_path."/file.tmp", "w");
var_dump( file() ); // Zero No. of args
@@ -19,7 +17,8 @@ var_dump( file($filename, $filename, $filename, $filename) ); // more than expe
var_dump( file($filename, "INCORRECT_FLAG", NULL) ); // Incorrect flag
var_dump( file($filename, 10, NULL) ); // Incorrect flag
-var_dump( file( "nofile.tmp" ) ); // non existing filename
+
+var_dump( file("temp.tmp") ); // non existing filename
fclose($file_handle);
echo "\n--- Done ---";
@@ -28,7 +27,7 @@ echo "\n--- Done ---";
--CLEAN--
<?php
$file_path = dirname(__FILE__);
-unlink($file_path."/file.tmp");
+unlink($file_path."tmp.tmp");
?>
--EXPECTF--
@@ -44,7 +43,8 @@ NULL
array(0) {
}
-Warning: file(nofile.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_variation.phpt b/ext/standard/tests/file/file_variation.phpt
index 4672f7d683..512d5f3eb6 100644
--- a/ext/standard/tests/file/file_variation.phpt
+++ b/ext/standard/tests/file/file_variation.phpt
@@ -3,61 +3,65 @@ Test file() function : usage variations
--FILE--
<?php
/*
- * Prototype: array file ( string $filename [,int $flags [,resource $context]] );
- * Description: Reads entire file into an array
- * Returns the file in an array
+ * 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 = dirname(__FILE__);
-require($file_path."/file.inc");
-$filename = $file_path."/file_variation.tmp";
+require(dirname(__FILE__) . '/file.inc');
$data_array = array( "Garbage data", "Gar\nba\nge d\nata", "Gar\n\nbage \n\n data" );
-
echo "*** Using various flags values with different data in a file\n";
$count=1;
+$file_path = dirname(__FILE__);
foreach( $data_array as $data ) {
- echo "--Iteration $count --\n";
- $fh = fopen($filename, "w");
- fwrite($fh, $data);
- var_dump( file($filename, FILE_IGNORE_NEW_LINES) );
- var_dump( file($filename, FILE_SKIP_EMPTY_LINES) );
- $count++;
- fclose($fh);
+ echo "--Iteration $count --\n";
+ $fh = fopen($file_path."/file_variation.tmp", "w");
+ fwrite($fh, (binary)$data);
+ var_dump( file($file_path."/file_variation.tmp", FILE_IGNORE_NEW_LINES) );
+ var_dump( file($file_path."/file_variation.tmp", FILE_SKIP_EMPTY_LINES) );
+ $count++;
+ fclose($fh);
}
echo "*** Testing with variation in use_include_path argument ***\n";
-$dir = "/file_variation";
-$file_path = dirname(__FILE__).$dir;
+$file_path1 = dirname(__FILE__)."/file_variation";
+mkdir($file_path1);
+ini_set( 'include_path',$file_path.'/file_variation' );
-mkdir($file_path);
-ini_set( 'include_path', $file_path );
-$filename = $file_path."/file1_variation.tmp";
+file_put_contents( $file_path1."/file1_variation.tmp", "aaaaaaaaaaaaaaabbbbbbbbbbb111111111222222222" );
+var_dump( file("file1_variation.tmp", FILE_USE_INCLUDE_PATH) );
+var_dump( file($file_path1."/file1_variation.tmp", 1) );
-$buffer_types = array("text", "numeric", "alphanumeric", "text_with_new_line");
-foreach( $buffer_types as $type) {
- fill_buffer($buffer, $type, 100);
- file_put_contents($filename, $buffer );
- var_dump( file("file1_variation.tmp", FILE_USE_INCLUDE_PATH) );
- var_dump( file($filename, FILE_IGNORE_NEW_LINES) );
- var_dump( file($filename, FILE_SKIP_EMPTY_LINES) );
-
-}
+echo "*** Using file function to remove line containing a key string ***\n";
+$file_handle = fopen($file_path."/file2_variation.tmp", "w");
+$key = "SEARCH_KEY";
+fwrite( $file_handle, (binary)"The key string to be searched is SEARCH_KEY\nLine without key string\nThe key string to be searched is SEARCH_KEY" );
+$out_array = file($file_path."/file2_variation.tmp");
+
+echo "File contents in array form Before replacement of the key\n";
+var_dump( $out_array );
+$file_handle2 = fopen($file_path."/file3_variation.tmp", "w");
+// Loop through file content array
+foreach($out_array as $line) {
+ if( !strstr( $line, $key ) )
+ fputs($file_handle2,$line);
+}
+echo "File contents in array form After replacement of the key\n";
+var_dump( file($file_path."/file3_variation.tmp" ));
+fclose($file_handle);
+fclose($file_handle2);
echo "\n--- Done ---";
?>
--CLEAN--
<?php
-// Removing the temporary files and directory
-
$file_path = dirname(__FILE__);
unlink($file_path."/file_variation.tmp");
-
-$dir = "/file_variation";
-$file_path = dirname(__FILE__).$dir;
-unlink($file_path."/file1_variation.tmp");
-rmdir($file_path);
+unlink($file_path."/file_variation/file1_variation.tmp");
+unlink($file_path."/file2_variation.tmp");
+unlink($file_path."/file3_variation.tmp");
+rmdir($file_path."/file_variation");
?>
--EXPECTF--
@@ -127,139 +131,30 @@ array(5) {
*** Testing with variation in use_include_path argument ***
array(1) {
[0]=>
- string(100) "text text text text text text text text text text text text text text text text text text text text "
+ string(44) "aaaaaaaaaaaaaaabbbbbbbbbbb111111111222222222"
}
array(1) {
[0]=>
- string(100) "text text text text text text text text text text text text text text text text text text text text "
+ string(44) "aaaaaaaaaaaaaaabbbbbbbbbbb111111111222222222"
}
-array(1) {
- [0]=>
- string(100) "text text text text text text text text text text text text text text text text text text text text "
-}
-array(1) {
+*** Using file function to remove line containing a key string ***
+File contents in array form Before replacement of the key
+array(3) {
[0]=>
- string(100) "2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222"
-}
-array(1) {
- [0]=>
- string(100) "2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222"
-}
-array(1) {
- [0]=>
- string(100) "2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222"
-}
-array(1) {
- [0]=>
- string(100) "ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 "
-}
-array(1) {
- [0]=>
- string(100) "ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 "
-}
-array(1) {
- [0]=>
- string(100) "ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 "
-}
-array(12) {
- [0]=>
- string(5) "line
+ string(44) "The key string to be searched is SEARCH_KEY
"
[1]=>
- string(13) "line of text
-"
- [2]=>
- string(5) "line
+ string(24) "Line without key string
"
- [3]=>
- string(13) "line of text
-"
- [4]=>
- string(5) "line
-"
- [5]=>
- string(13) "line of text
-"
- [6]=>
- string(5) "line
-"
- [7]=>
- string(13) "line of text
-"
- [8]=>
- string(5) "line
-"
- [9]=>
- string(13) "line of text
-"
- [10]=>
- string(5) "line
-"
- [11]=>
- string(5) "line "
-}
-array(12) {
- [0]=>
- string(4) "line"
- [1]=>
- string(12) "line of text"
[2]=>
- string(4) "line"
- [3]=>
- string(12) "line of text"
- [4]=>
- string(4) "line"
- [5]=>
- string(12) "line of text"
- [6]=>
- string(4) "line"
- [7]=>
- string(12) "line of text"
- [8]=>
- string(4) "line"
- [9]=>
- string(12) "line of text"
- [10]=>
- string(4) "line"
- [11]=>
- string(5) "line "
+ string(43) "The key string to be searched is SEARCH_KEY"
}
-array(12) {
+File contents in array form After replacement of the key
+array(1) {
[0]=>
- string(5) "line
+ string(24) "Line without key string
"
- [1]=>
- string(13) "line of text
-"
- [2]=>
- string(5) "line
-"
- [3]=>
- string(13) "line of text
-"
- [4]=>
- string(5) "line
-"
- [5]=>
- string(13) "line of text
-"
- [6]=>
- string(5) "line
-"
- [7]=>
- string(13) "line of text
-"
- [8]=>
- string(5) "line
-"
- [9]=>
- string(13) "line of text
-"
- [10]=>
- string(5) "line
-"
- [11]=>
- string(5) "line "
}
--- Done ---
+
diff --git a/ext/standard/tests/file/filegroup_error.phpt b/ext/standard/tests/file/filegroup_error.phpt
index d1213941aa..3d96ffdaf0 100644
--- a/ext/standard/tests/file/filegroup_error.phpt
+++ b/ext/standard/tests/file/filegroup_error.phpt
@@ -34,10 +34,11 @@ bool(false)
Warning: filegroup(): stat failed for 100 in %s on line %d
bool(false)
-Warning: Wrong parameter count for filegroup() in %s on line %d
+Warning: filegroup() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for filegroup() in %s on line %d
+Warning: filegroup() expects exactly 1 parameter, 2 given in %s on line %d
NULL
*** Done ***
+
diff --git a/ext/standard/tests/file/fileinode_basic.phpt b/ext/standard/tests/file/fileinode_basic.phpt
index 27b7dbd799..98e5cf0836 100644
--- a/ext/standard/tests/file/fileinode_basic.phpt
+++ b/ext/standard/tests/file/fileinode_basic.phpt
@@ -26,7 +26,6 @@ echo "\n*** Done ***";
<?php
unlink (dirname(__FILE__)."/inode.tmp");
?>
-
--EXPECTF--
*** Testing fileinode() with file, directory ***
%d
diff --git a/ext/standard/tests/file/fileinode_error.phpt b/ext/standard/tests/file/fileinode_error.phpt
index eb88aa36b8..d716c4ae5b 100644
--- a/ext/standard/tests/file/fileinode_error.phpt
+++ b/ext/standard/tests/file/fileinode_error.phpt
@@ -35,10 +35,10 @@ bool(false)
Warning: fileinode(): stat failed for 100 in %s on line 14
bool(false)
-Warning: Wrong parameter count for fileinode() in %s on line 17
+Warning: fileinode() expects exactly 1 parameter, 0 given in %s on line 17
NULL
-Warning: Wrong parameter count for fileinode() in %s on line 20
+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 1f48d22491..1fac953098 100644
--- a/ext/standard/tests/file/fileinode_variation.phpt
+++ b/ext/standard/tests/file/fileinode_variation.phpt
@@ -73,7 +73,13 @@ print( fileinode("$file_path/dir") )."\n";
clearstatcache();
mkdir("$file_path/dir/subdir");
-print( fileinode("$file_path/dir/subdir") );
+print( fileinode("$file_path/dir/subdir") )."\n";
+clearstatcache();
+
+echo "-- Testing with binary input --\n";
+print( fileinode(b"$file_path/dir") )."\n";
+clearstatcache();
+print( fileinode(b"$file_path/dir/subdir") );
rmdir("$file_path/dir/subdir");
rmdir("$file_path/dir");
@@ -100,4 +106,7 @@ echo "\n*** Done ***";
-- Testing with directories --
%d
%d
+-- Testing with binary input --
+%d
+%d
*** Done ***
diff --git a/ext/standard/tests/file/fileowner_basic.phpt b/ext/standard/tests/file/fileowner_basic.phpt
index 703a36bed7..5b5ff9a900 100644
--- a/ext/standard/tests/file/fileowner_basic.phpt
+++ b/ext/standard/tests/file/fileowner_basic.phpt
@@ -48,3 +48,4 @@ int(%d)
int(%d)
int(%d)
*** Done ***
+
diff --git a/ext/standard/tests/file/fileowner_error.phpt b/ext/standard/tests/file/fileowner_error.phpt
index b58927f210..efffb36334 100644
--- a/ext/standard/tests/file/fileowner_error.phpt
+++ b/ext/standard/tests/file/fileowner_error.phpt
@@ -34,10 +34,11 @@ bool(false)
Warning: fileowner(): stat failed for 100 in %s on line %d
bool(false)
-Warning: Wrong parameter count for fileowner() in %s on line %d
+Warning: fileowner() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for fileowner() in %s on line %d
+Warning: fileowner() expects exactly 1 parameter, 2 given in %s on line %d
NULL
*** Done ***
+
diff --git a/ext/standard/tests/file/filesize_basic.phpt b/ext/standard/tests/file/filesize_basic.phpt
index 72ec487423..58041b95c3 100644
--- a/ext/standard/tests/file/filesize_basic.phpt
+++ b/ext/standard/tests/file/filesize_basic.phpt
@@ -36,3 +36,4 @@ int(%d)
int(%d)
int(0)
*** Done ***
+
diff --git a/ext/standard/tests/file/filesize_error.phpt b/ext/standard/tests/file/filesize_error.phpt
index f15a4f786e..6d8cfa8693 100644
--- a/ext/standard/tests/file/filesize_error.phpt
+++ b/ext/standard/tests/file/filesize_error.phpt
@@ -31,10 +31,11 @@ bool(false)
Warning: filesize(): stat failed for /no/such/dir in %s on line %d
bool(false)
-Warning: Wrong parameter count for filesize() in %s on line %d
+Warning: filesize() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for filesize() in %s on line %d
+Warning: filesize() expects exactly 1 parameter, 2 given in %s on line %d
NULL
*** Done ***
+
diff --git a/ext/standard/tests/file/filesize_variation2.phpt b/ext/standard/tests/file/filesize_variation2.phpt
index bf26bd206e..8a7594ee79 100644
--- a/ext/standard/tests/file/filesize_variation2.phpt
+++ b/ext/standard/tests/file/filesize_variation2.phpt
@@ -25,12 +25,12 @@ var_dump( filesize( $file_path."/filesize_variation2"));
clearstatcache();
echo "-- Creating a file inside base dir, and checking dir & file size --\n";
-create_files($file_path."/filesize_variation2", 1, "numeric", 0755, 1, "w", "filesize_variation", 2);
+create_files($file_path."/filesize_variation2", 1, "numeric", 0755, 1, "w", "filesize_variation");
var_dump( filesize( $file_path."/filesize_variation2"));
clearstatcache();
-var_dump( filesize( $file_path."/filesize_variation2/filesize_variation2.tmp"));
+var_dump( filesize( $file_path."/filesize_variation2/filesize_variation1.tmp"));
clearstatcache();
-delete_files($file_path."/filesize_variation2", 1, "filesize_variation", 2);
+delete_files($file_path."/filesize_variation2", 1, "filesize_variation");
echo "-- Creating an empty sub-dir in base-dir, and checking size of base and sub dir --\n";
mkdir( $file_path."/filesize_variation2/filesize_variation2_sub");
diff --git a/ext/standard/tests/file/filesize_variation3-win32.phpt b/ext/standard/tests/file/filesize_variation3-win32.phpt
index 51f6f3dacb..f46695954c 100644
--- a/ext/standard/tests/file/filesize_variation3-win32.phpt
+++ b/ext/standard/tests/file/filesize_variation3-win32.phpt
@@ -14,12 +14,11 @@ if (substr(PHP_OS, 0, 3) != 'WIN') {
*/
$file_path = dirname(__FILE__);
-require($file_path."/file.inc");
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
+fwrite($file_handle, (binary)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";
diff --git a/ext/standard/tests/file/filesize_variation4-win32.phpt b/ext/standard/tests/file/filesize_variation4-win32.phpt
index 2e6e49bb50..5f20f4210d 100644
--- a/ext/standard/tests/file/filesize_variation4-win32.phpt
+++ b/ext/standard/tests/file/filesize_variation4-win32.phpt
@@ -13,16 +13,14 @@ if (substr(PHP_OS, 0, 3) != 'WIN') {
(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 = dirname(__FILE__);
+require($file_path."/file.inc");
-echo "*** Testing filesize(): usage variations ***\n";
+echo "*** Testing filesize(): usage variations ***\n";
echo "\n*** Testing filesize() with data written using different file modes and by creating holes in file ***\n";
$filename = $file_path."/filesize_variation4.tmp";
$string = "Test 2 test the filesize() fn, with data containing all the types like !@@##$%^&*():<>?|~+!;',.\][{}(special) chars, 12345(numeric) chars, and \n(newline char), \t(tab), \0, \r and so on........\0";
-
echo "-- opening the file in 'w' mode and get the size --\n";
$file_handle = fopen($filename, "w");
var_dump( strlen($string) ); //strlen of the string
@@ -36,7 +34,6 @@ $file_handle = fopen($filename, "wt");
var_dump( strlen($string) ); //strlen of the string = 191 bytes
fwrite($file_handle, $string);
fclose($file_handle);
-/* '\n' treated as '\r\n' i.e two chars in 'wt' mode */
var_dump( filesize($filename) ); //size of the file = 192 bytes != strlen of string
clearstatcache();
@@ -44,7 +41,6 @@ echo "-- opening the file in 'a' mode, adding data and checking the file --\n";
$file_handle = fopen($filename, "a");
fwrite($file_handle, "Hello, world");
fclose($file_handle);
-/* '\n' treated as '\r\n' i.e two chars in 'wt' mode */
var_dump( filesize($filename) ); //204 bytes
clearstatcache();
@@ -52,7 +48,6 @@ echo "-- opening the file in 'at' mode, adding data and checking the file --\n";
$file_handle = fopen($filename, "at");
fwrite($file_handle, "Hello, world\n");
fclose($file_handle);
-/* '\n' treated as '\r\n' i.e two chars in 'wt' mode */
var_dump( filesize($filename) ); //218 bytes
clearstatcache();
diff --git a/ext/standard/tests/file/filesize_variation4.phpt b/ext/standard/tests/file/filesize_variation4.phpt
index 9d4330cbbe..29f85fc243 100644
--- a/ext/standard/tests/file/filesize_variation4.phpt
+++ b/ext/standard/tests/file/filesize_variation4.phpt
@@ -73,7 +73,7 @@ var_dump( filesize($filename) ); //0 bytes
clearstatcache();
echo "-- with empty file --\n";
-$filename= dirname(__FILE__)."/filesize_variation4_empty.tmp";
+$filename = dirname(__FILE__)."/filesize_variation4_empty.tmp";
fclose( fopen($filename, "w") );
var_dump( filesize($filename) ); //0 bytes
diff --git a/ext/standard/tests/file/filetype_error.phpt b/ext/standard/tests/file/filetype_error.phpt
index 9b4d71fffe..b965272011 100644
--- a/ext/standard/tests/file/filetype_error.phpt
+++ b/ext/standard/tests/file/filetype_error.phpt
@@ -8,7 +8,7 @@ Description: Returns the type of the file. Possible values are fifo, char,
dir, block, link, file, and unknown.
*/
-echo "\n*** Testing error conditions ***";
+echo "*** Testing error conditions ***";
/* non-existing file or dir */
print( filetype("/no/such/file/dir") );
@@ -32,8 +32,8 @@ Warning: filetype(): Lstat failed for string in %s on line %d
Warning: filetype(): Lstat failed for 100 in %s on line %d
-Warning: Wrong parameter count for filetype() in %s on line %d
+Warning: filetype() expects exactly 1 parameter, 0 given in %s on line %d
-Warning: Wrong parameter count for filetype() 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/flock_variation.phpt b/ext/standard/tests/file/flock_variation.phpt
index d34f78f7f2..af67ab402a 100644
--- a/ext/standard/tests/file/flock_variation.phpt
+++ b/ext/standard/tests/file/flock_variation.phpt
@@ -40,6 +40,9 @@ $wouldblocks = array(
array(),
"string",
"",
+ /* binary input */
+ b"string",
+ b"",
"\0"
);
@@ -90,6 +93,10 @@ bool(true)
bool(true)
-- Inner iteration 11 in 0 --
bool(true)
+-- Inner iteration 12 in 0 --
+bool(true)
+-- Inner iteration 13 in 0 --
+bool(true)
--- Outer iteration 1 ---
bool(true)
-- Inner iteration 0 in 1 --
@@ -116,6 +123,10 @@ bool(true)
bool(true)
-- Inner iteration 11 in 1 --
bool(true)
+-- Inner iteration 12 in 1 --
+bool(true)
+-- Inner iteration 13 in 1 --
+bool(true)
--- Outer iteration 2 ---
bool(true)
-- Inner iteration 0 in 2 --
@@ -142,6 +153,10 @@ bool(true)
bool(true)
-- Inner iteration 11 in 2 --
bool(true)
+-- Inner iteration 12 in 2 --
+bool(true)
+-- Inner iteration 13 in 2 --
+bool(true)
--- Outer iteration 3 ---
bool(true)
-- Inner iteration 0 in 3 --
@@ -168,6 +183,10 @@ bool(true)
bool(true)
-- Inner iteration 11 in 3 --
bool(true)
+-- Inner iteration 12 in 3 --
+bool(true)
+-- Inner iteration 13 in 3 --
+bool(true)
--- Outer iteration 4 ---
bool(true)
-- Inner iteration 0 in 4 --
@@ -194,6 +213,10 @@ bool(true)
bool(true)
-- Inner iteration 11 in 4 --
bool(true)
+-- Inner iteration 12 in 4 --
+bool(true)
+-- Inner iteration 13 in 4 --
+bool(true)
--- Outer iteration 5 ---
bool(true)
-- Inner iteration 0 in 5 --
@@ -220,6 +243,10 @@ bool(true)
bool(true)
-- Inner iteration 11 in 5 --
bool(true)
+-- Inner iteration 12 in 5 --
+bool(true)
+-- Inner iteration 13 in 5 --
+bool(true)
--- Outer iteration 6 ---
bool(true)
-- Inner iteration 0 in 6 --
@@ -246,6 +273,10 @@ bool(true)
bool(true)
-- Inner iteration 11 in 6 --
bool(true)
+-- Inner iteration 12 in 6 --
+bool(true)
+-- Inner iteration 13 in 6 --
+bool(true)
--- Outer iteration 7 ---
bool(true)
-- Inner iteration 0 in 7 --
@@ -272,6 +303,10 @@ bool(true)
bool(true)
-- Inner iteration 11 in 7 --
bool(true)
+-- Inner iteration 12 in 7 --
+bool(true)
+-- Inner iteration 13 in 7 --
+bool(true)
--- Outer iteration 8 ---
bool(true)
-- Inner iteration 0 in 8 --
@@ -298,6 +333,10 @@ bool(true)
bool(true)
-- Inner iteration 11 in 8 --
bool(true)
+-- Inner iteration 12 in 8 --
+bool(true)
+-- Inner iteration 13 in 8 --
+bool(true)
--- Outer iteration 9 ---
bool(true)
-- Inner iteration 0 in 9 --
@@ -324,5 +363,9 @@ bool(true)
bool(true)
-- Inner iteration 11 in 9 --
bool(true)
+-- Inner iteration 12 in 9 --
+bool(true)
+-- Inner iteration 13 in 9 --
+bool(true)
*** Done ***
diff --git a/ext/standard/tests/file/fnmatch_error.phpt b/ext/standard/tests/file/fnmatch_error.phpt
index 4e27bb41ad..9876133169 100644
--- a/ext/standard/tests/file/fnmatch_error.phpt
+++ b/ext/standard/tests/file/fnmatch_error.phpt
@@ -2,7 +2,7 @@
Test fnmatch() function: Error conditions
--SKIPIF--
<?php
-if( (stristr(PHP_OS, "Mac")) || (stristr(PHP_OS, "Win")) )
+if( (stristr(PHP_OS, "Mac")) || (stristr(PHP_OS, "Win")) )
die("skip do not run on MacOS/Windows");
?>
--FILE--
@@ -36,22 +36,22 @@ echo "\n*** Done ***\n";
?>
--EXPECTF--
*** Testing error conditions for fnmatch() ***
-Warning: fnmatch() expects parameter 1 to be string, array given in %s on line %d
+Warning: fnmatch() expects parameter 1 to be string, array given in %s on line %d%d
NULL
-Warning: fnmatch() expects parameter 1 to be string, resource given in %s on line %d
+Warning: fnmatch() expects parameter 1 to be string, resource given in %s on line %d%d
NULL
-Warning: fnmatch() expects parameter 1 to be string, object given in %s on line %d
+Warning: fnmatch() expects parameter 1 to be string, object given in %s on line %d%d
NULL
-Warning: fnmatch() expects at least 2 parameters, 1 given in %s on line %d
+Warning: fnmatch() expects at least 2 parameters, 1 given in %s on line %d%d
NULL
-Warning: fnmatch() expects at least 2 parameters, 1 given in %s on line %d
+Warning: fnmatch() expects at least 2 parameters, 1 given in %s on line %d%d
NULL
-Warning: fnmatch() expects at most 3 parameters, 4 given in %s on line %d
+Warning: fnmatch() expects at most 3 parameters, 4 given in %s on line %d%d
NULL
*** Done ***
diff --git a/ext/standard/tests/file/fnmatch_variation.phpt b/ext/standard/tests/file/fnmatch_variation.phpt
index 03e8de72e8..c2d9932dd3 100644
--- a/ext/standard/tests/file/fnmatch_variation.phpt
+++ b/ext/standard/tests/file/fnmatch_variation.phpt
@@ -2,7 +2,7 @@
Test fnmatch() function: Variations
--SKIPIF--
<?php
-if( (stristr(PHP_OS, "Mac")) || (stristr(PHP_OS, "Win")) )
+if( (stristr(PHP_OS, "Mac")) || (stristr(PHP_OS, "Win")) )
die("skip do not run on MacOS/Windows");
?>
--FILE--
@@ -49,7 +49,14 @@ $pattern_arr = array(
28 => chr(109).chr(97).chr(116).chr(99).chr(104).".".chr(116).chr(120).chr(116),
29 => "MATCH.TMP",
30 => "MATCH*",
-31 => $file_name
+31 => $file_name,
+
+/* binary inputs */
+32 => b"match*",
+33 => b"*.tmp",
+34 => b"mat*",
+35 => b"mat*tmp",
+36 => b"m*t",
);
for( $i = 0; $i<count($pattern_arr); $i++ ) {
@@ -88,7 +95,10 @@ $str_arr = array(
"string\0",
'string',
"str\0ing",
- "stringstring"
+ "stringstring",
+
+ /* binary input */
+ b"string"
);
match($str_arr, $str_arr);
@@ -185,6 +195,16 @@ bool(false)
bool(false)
-- Iteration 31 --
bool(true)
+-- Iteration 32 --
+bool(false)
+-- Iteration 33 --
+bool(true)
+-- Iteration 34 --
+bool(false)
+-- Iteration 35 --
+bool(false)
+-- Iteration 36 --
+bool(false)
*** Testing fnmatch() with other types other than files ***
--- With Integers ---
@@ -238,30 +258,42 @@ bool(true)
bool(true)
bool(false)
bool(false)
+bool(true)
-- Iteration 1 --
bool(true)
bool(true)
bool(true)
bool(false)
bool(false)
+bool(true)
-- Iteration 2 --
bool(true)
bool(true)
bool(true)
bool(false)
bool(false)
+bool(true)
-- Iteration 3 --
bool(false)
bool(false)
bool(false)
bool(true)
bool(false)
+bool(false)
-- Iteration 4 --
bool(false)
bool(false)
bool(false)
bool(false)
bool(true)
+bool(false)
+-- Iteration 5 --
+bool(true)
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+bool(true)
--- With booleans ---
-- Iteration 0 --
diff --git a/ext/standard/tests/file/fpassthru_basic.phpt b/ext/standard/tests/file/fpassthru_basic.phpt
index a6e6612dd5..db03abc490 100644
--- a/ext/standard/tests/file/fpassthru_basic.phpt
+++ b/ext/standard/tests/file/fpassthru_basic.phpt
@@ -123,4 +123,4 @@ int(99)
-- After seeking position to 1000 --
int(0)
-*** Done *** \ No newline at end of file
+*** Done ***
diff --git a/ext/standard/tests/file/fputcsv.phpt b/ext/standard/tests/file/fputcsv.phpt
index 486d10a1fc..63c41509bd 100755
--- a/ext/standard/tests/file/fputcsv.phpt
+++ b/ext/standard/tests/file/fputcsv.phpt
@@ -1,7 +1,5 @@
--TEST--
various fputcsv() functionality tests
---INI--
-magic_quotes_runtime=0
--FILE--
<?php
@@ -33,7 +31,7 @@ $file = dirname(__FILE__) . 'fgetcsv.csv';
$fp = fopen($file, "w");
foreach ($list as $v) {
- fputcsv($fp, split(',', $v));
+ fputcsv($fp, explode(',', $v));
}
fclose($fp);
diff --git a/ext/standard/tests/file/fputcsv_error.phpt b/ext/standard/tests/file/fputcsv_error.phpt
index 72196592f0..9403cf446a 100644
--- a/ext/standard/tests/file/fputcsv_error.phpt
+++ b/ext/standard/tests/file/fputcsv_error.phpt
@@ -94,3 +94,4 @@ NULL
Warning: fputcsv() expects parameter 1 to be resource, object given in %s on line %d
NULL
Done
+
diff --git a/ext/standard/tests/file/fputcsv_variation1.phpt b/ext/standard/tests/file/fputcsv_variation1.phpt
index da39f97a6c..68df33c8ec 100644
--- a/ext/standard/tests/file/fputcsv_variation1.phpt
+++ b/ext/standard/tests/file/fputcsv_variation1.phpt
@@ -831,3 +831,4 @@ bool(false)
string(%d) "&&&""""&&:&&"&&:,:":&&,&&:,,,,&
"
Done
+
diff --git a/ext/standard/tests/file/fputcsv_variation10.phpt b/ext/standard/tests/file/fputcsv_variation10.phpt
index b9e59bb08e..21d845ffa7 100644
--- a/ext/standard/tests/file/fputcsv_variation10.phpt
+++ b/ext/standard/tests/file/fputcsv_variation10.phpt
@@ -333,3 +333,4 @@ bool(false)
string(%d) "
"
Done
+
diff --git a/ext/standard/tests/file/fputcsv_variation11.phpt b/ext/standard/tests/file/fputcsv_variation11.phpt
index 52e5680340..770b89b711 100644
--- a/ext/standard/tests/file/fputcsv_variation11.phpt
+++ b/ext/standard/tests/file/fputcsv_variation11.phpt
@@ -831,3 +831,4 @@ bool(false)
string(%d) ""&""""""""&:&""&:,:"":&,&:,,,,"
"
Done
+
diff --git a/ext/standard/tests/file/fputcsv_variation12.phpt b/ext/standard/tests/file/fputcsv_variation12.phpt
index 154dcd3b55..24fe5c4658 100644
--- a/ext/standard/tests/file/fputcsv_variation12.phpt
+++ b/ext/standard/tests/file/fputcsv_variation12.phpt
@@ -832,3 +832,4 @@ bool(false)
string(%d) ""&""""""""&:&""&:,:"":&,&:,,,,"
"
Done
+
diff --git a/ext/standard/tests/file/fputcsv_variation13.phpt b/ext/standard/tests/file/fputcsv_variation13.phpt
index e533ad81c8..a8a350b222 100644
--- a/ext/standard/tests/file/fputcsv_variation13.phpt
+++ b/ext/standard/tests/file/fputcsv_variation13.phpt
@@ -1048,3 +1048,4 @@ bool(false)
string(%d) ""&""""""""&:&""&:,:"":&,&:,,,,"
"
Done
+
diff --git a/ext/standard/tests/file/fputcsv_variation14.phpt b/ext/standard/tests/file/fputcsv_variation14.phpt
index b641838f68..36a4975c12 100644
--- a/ext/standard/tests/file/fputcsv_variation14.phpt
+++ b/ext/standard/tests/file/fputcsv_variation14.phpt
@@ -354,3 +354,4 @@ int(0)
bool(false)
string(0) ""
Done
+
diff --git a/ext/standard/tests/file/fputcsv_variation2.phpt b/ext/standard/tests/file/fputcsv_variation2.phpt
index b01f573638..3ec4e91f2a 100644
--- a/ext/standard/tests/file/fputcsv_variation2.phpt
+++ b/ext/standard/tests/file/fputcsv_variation2.phpt
@@ -939,3 +939,4 @@ int(0)
bool(false)
string(0) ""
Done
+
diff --git a/ext/standard/tests/file/fputcsv_variation3.phpt b/ext/standard/tests/file/fputcsv_variation3.phpt
index e8a3bd6045..14a2503eca 100644
--- a/ext/standard/tests/file/fputcsv_variation3.phpt
+++ b/ext/standard/tests/file/fputcsv_variation3.phpt
@@ -939,3 +939,4 @@ int(0)
bool(false)
string(0) ""
Done
+
diff --git a/ext/standard/tests/file/fputcsv_variation4.phpt b/ext/standard/tests/file/fputcsv_variation4.phpt
index 6a41cfc012..bc374ad397 100644
--- a/ext/standard/tests/file/fputcsv_variation4.phpt
+++ b/ext/standard/tests/file/fputcsv_variation4.phpt
@@ -939,3 +939,4 @@ int(0)
bool(false)
string(0) ""
Done
+
diff --git a/ext/standard/tests/file/fputcsv_variation5.phpt b/ext/standard/tests/file/fputcsv_variation5.phpt
index 8f1a0f2909..9d78854d71 100644
--- a/ext/standard/tests/file/fputcsv_variation5.phpt
+++ b/ext/standard/tests/file/fputcsv_variation5.phpt
@@ -831,3 +831,4 @@ bool(false)
string(%d) ""&""""""""&:&""&:,:"":&,&:,,,,"
"
Done
+
diff --git a/ext/standard/tests/file/fputcsv_variation6.phpt b/ext/standard/tests/file/fputcsv_variation6.phpt
index 1e10167e3a..f30ce24f40 100644
--- a/ext/standard/tests/file/fputcsv_variation6.phpt
+++ b/ext/standard/tests/file/fputcsv_variation6.phpt
@@ -834,3 +834,4 @@ bool(false)
string(%d) "&""""&:&"&:,:":&,&:,,,,
"
Done
+
diff --git a/ext/standard/tests/file/fputcsv_variation7.phpt b/ext/standard/tests/file/fputcsv_variation7.phpt
index b6d69ef4d3..8329251d73 100644
--- a/ext/standard/tests/file/fputcsv_variation7.phpt
+++ b/ext/standard/tests/file/fputcsv_variation7.phpt
@@ -834,3 +834,4 @@ bool(false)
string(%d) "&&&""""&&:&&"&&:,:":&&,&&:,,,,&
"
Done
+
diff --git a/ext/standard/tests/file/fputcsv_variation8.phpt b/ext/standard/tests/file/fputcsv_variation8.phpt
index 51be05441d..096f37908a 100644
--- a/ext/standard/tests/file/fputcsv_variation8.phpt
+++ b/ext/standard/tests/file/fputcsv_variation8.phpt
@@ -834,3 +834,4 @@ bool(false)
string(%d) "+&""""&:&"&:,:":&,&:,,,,+
"
Done
+
diff --git a/ext/standard/tests/file/fputcsv_variation9.phpt b/ext/standard/tests/file/fputcsv_variation9.phpt
index 01551fdc0d..386d7bd1e7 100644
--- a/ext/standard/tests/file/fputcsv_variation9.phpt
+++ b/ext/standard/tests/file/fputcsv_variation9.phpt
@@ -1265,3 +1265,4 @@ bool(false)
string(%d) "&""""&:&"&:,:":&,&:,,,,
"
Done
+
diff --git a/ext/standard/tests/file/fscanf.phpt b/ext/standard/tests/file/fscanf.phpt
index 67bd8ee103..9e154b35f9 100644
--- a/ext/standard/tests/file/fscanf.phpt
+++ b/ext/standard/tests/file/fscanf.phpt
@@ -11,17 +11,17 @@ var_dump(fscanf(array(), array(), new stdclass));
file_put_contents($filename, "data");
-$fp = fopen($filename, "r");
+$fp = fopen($filename, "rt");
var_dump(fscanf($fp, "%d", $v));
var_dump($v);
fclose($fp);
-$fp = fopen($filename, "r");
+$fp = fopen($filename, "rt");
var_dump(fscanf($fp, "%s", $v));
var_dump($v);
fclose($fp);
-$fp = fopen($filename, "r");
+$fp = fopen($filename, "rt");
var_dump(fscanf($fp, "%s", $v, $v1));
var_dump($v);
var_dump($v1);
@@ -29,7 +29,7 @@ fclose($fp);
$v = array();
$v1 = array();
-$fp = fopen($filename, "r");
+$fp = fopen($filename, "rt");
var_dump(fscanf($fp, "", $v, $v1));
var_dump($v);
var_dump($v1);
@@ -37,7 +37,7 @@ fclose($fp);
$v = array();
$v1 = array();
-$fp = fopen($filename, "r");
+$fp = fopen($filename, "rt");
var_dump(fscanf($fp, "%.a", $v, $v1));
var_dump($v);
var_dump($v1);
@@ -46,14 +46,14 @@ fclose($fp);
@unlink($filename);
touch($filename);
-$fp = fopen($filename, "r");
+$fp = fopen($filename, "rt");
var_dump(fscanf($fp, "%s", $v));
var_dump($v);
fclose($fp);
file_put_contents($filename, "data");
-$fp = fopen($filename, "r");
+$fp = fopen($filename, "rt");
var_dump(fscanf($fp, "%s%d", $v));
@unlink($filename);
diff --git a/ext/standard/tests/file/fscanf_error.phpt b/ext/standard/tests/file/fscanf_error.phpt
index 71a9dfe5aa..c57c8bc86c 100644
--- a/ext/standard/tests/file/fscanf_error.phpt
+++ b/ext/standard/tests/file/fscanf_error.phpt
@@ -97,3 +97,4 @@ Warning: fscanf(): Bad scan conversion character "m" in %s on line %d
NULL
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation1.phpt b/ext/standard/tests/file/fscanf_variation1.phpt
index baebe61b12..b0c41e5f84 100644
--- a/ext/standard/tests/file/fscanf_variation1.phpt
+++ b/ext/standard/tests/file/fscanf_variation1.phpt
@@ -19,8 +19,8 @@ $filename = "$file_path/fscanf_variation1.tmp";
$file_handle = fopen($filename, "w");
if($file_handle == false)
exit("Error:failed to open file $filename");
-fwrite($file_handle, "hello_world ");
-fwrite($file_handle, 12345);
+@fwrite($file_handle, "hello_world ");
+@fwrite($file_handle, 12345);
fclose($file_handle);
// open file for reading
@@ -47,3 +47,4 @@ array(1) {
}
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation10.phpt b/ext/standard/tests/file/fscanf_variation10.phpt
index 0222becac3..501b937815 100644
--- a/ext/standard/tests/file/fscanf_variation10.phpt
+++ b/ext/standard/tests/file/fscanf_variation10.phpt
@@ -42,8 +42,8 @@ $counter = 1;
// writing to the file
foreach($resource_types as $value) {
- fprintf($file_handle, $value);
- fprintf($file_handle, "\n");
+ @fprintf($file_handle, $value);
+ @fprintf($file_handle, "\n");
}
// closing the file
fclose($file_handle);
@@ -219,3 +219,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation11.phpt b/ext/standard/tests/file/fscanf_variation11.phpt
index f01a72e5af..27de2ae5df 100644
--- a/ext/standard/tests/file/fscanf_variation11.phpt
+++ b/ext/standard/tests/file/fscanf_variation11.phpt
@@ -47,8 +47,8 @@ $counter = 1;
// writing to the file
foreach($array_types as $value) {
- fprintf($file_handle, $value);
- fprintf($file_handle, "\n");
+ @fprintf($file_handle, $value);
+ @fprintf($file_handle, "\n");
}
// closing the file
fclose($file_handle);
@@ -82,30 +82,6 @@ unlink($filename);
--EXPECTF--
*** Test fscanf(): different float format types with arrays ***
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-- iteration 1 --
array(1) {
[0]=>
@@ -734,3 +710,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation12.phpt b/ext/standard/tests/file/fscanf_variation12.phpt
index 99fd6d2faa..33bfb67db0 100644
--- a/ext/standard/tests/file/fscanf_variation12.phpt
+++ b/ext/standard/tests/file/fscanf_variation12.phpt
@@ -48,8 +48,8 @@ $counter = 1;
// writing to the file
foreach($strings as $string) {
- fprintf($file_handle, $string);
- fprintf($file_handle, "\n");
+ @fprintf($file_handle, $string);
+ @fprintf($file_handle, "\n");
}
// closing the file
fclose($file_handle);
@@ -943,3 +943,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation13.phpt b/ext/standard/tests/file/fscanf_variation13.phpt
index 354fe40002..49525b484c 100644
--- a/ext/standard/tests/file/fscanf_variation13.phpt
+++ b/ext/standard/tests/file/fscanf_variation13.phpt
@@ -34,8 +34,8 @@ $counter = 1;
// writing to the file
foreach($bool_types as $value) {
- fprintf($file_handle, $value);
- fprintf($file_handle, "\n");
+ @fprintf($file_handle, $value);
+ @fprintf($file_handle, "\n");
}
// closing the file
fclose($file_handle);
@@ -243,3 +243,4 @@ NULL
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation14.phpt b/ext/standard/tests/file/fscanf_variation14.phpt
index 2f2ec4f399..2b497c9f5b 100644
--- a/ext/standard/tests/file/fscanf_variation14.phpt
+++ b/ext/standard/tests/file/fscanf_variation14.phpt
@@ -1076,3 +1076,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation15.phpt b/ext/standard/tests/file/fscanf_variation15.phpt
index d925a9d1e5..76422dbc8c 100644
--- a/ext/standard/tests/file/fscanf_variation15.phpt
+++ b/ext/standard/tests/file/fscanf_variation15.phpt
@@ -860,3 +860,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation16.phpt b/ext/standard/tests/file/fscanf_variation16.phpt
index 1312c18de7..fb2fd0cd41 100644
--- a/ext/standard/tests/file/fscanf_variation16.phpt
+++ b/ext/standard/tests/file/fscanf_variation16.phpt
@@ -218,3 +218,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation17.phpt b/ext/standard/tests/file/fscanf_variation17.phpt
index f300e3c019..2db8871c2b 100644
--- a/ext/standard/tests/file/fscanf_variation17.phpt
+++ b/ext/standard/tests/file/fscanf_variation17.phpt
@@ -709,3 +709,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation18.phpt b/ext/standard/tests/file/fscanf_variation18.phpt
index be0f210b83..71b72984b8 100644
--- a/ext/standard/tests/file/fscanf_variation18.phpt
+++ b/ext/standard/tests/file/fscanf_variation18.phpt
@@ -1011,3 +1011,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation19.phpt b/ext/standard/tests/file/fscanf_variation19.phpt
index 85b7d76779..08edc522b4 100644
--- a/ext/standard/tests/file/fscanf_variation19.phpt
+++ b/ext/standard/tests/file/fscanf_variation19.phpt
@@ -247,3 +247,4 @@ NULL
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation2.phpt b/ext/standard/tests/file/fscanf_variation2.phpt
index 64161556e8..77ae474ccc 100644
--- a/ext/standard/tests/file/fscanf_variation2.phpt
+++ b/ext/standard/tests/file/fscanf_variation2.phpt
@@ -48,8 +48,8 @@ $counter = 1;
// writing to the file
foreach($valid_ints as $int_value) {
- fprintf($file_handle, $int_value);
- fprintf($file_handle, "\n");
+ @fprintf($file_handle, $int_value);
+ @fprintf($file_handle, "\n");
}
// closing the file
fclose($file_handle);
@@ -1005,3 +1005,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation20.phpt b/ext/standard/tests/file/fscanf_variation20.phpt
index cbd7fbefd3..7ce609c680 100644
--- a/ext/standard/tests/file/fscanf_variation20.phpt
+++ b/ext/standard/tests/file/fscanf_variation20.phpt
@@ -1009,3 +1009,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation21.phpt b/ext/standard/tests/file/fscanf_variation21.phpt
index a8eedd6bc9..51381ce479 100644
--- a/ext/standard/tests/file/fscanf_variation21.phpt
+++ b/ext/standard/tests/file/fscanf_variation21.phpt
@@ -860,3 +860,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation22.phpt b/ext/standard/tests/file/fscanf_variation22.phpt
index d43226a4f3..4c551befc5 100644
--- a/ext/standard/tests/file/fscanf_variation22.phpt
+++ b/ext/standard/tests/file/fscanf_variation22.phpt
@@ -218,3 +218,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation23.phpt b/ext/standard/tests/file/fscanf_variation23.phpt
index 86298ce85f..d536c28fde 100644
--- a/ext/standard/tests/file/fscanf_variation23.phpt
+++ b/ext/standard/tests/file/fscanf_variation23.phpt
@@ -709,3 +709,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation24.phpt b/ext/standard/tests/file/fscanf_variation24.phpt
index 6474ce8e5e..ddca007ccf 100644
--- a/ext/standard/tests/file/fscanf_variation24.phpt
+++ b/ext/standard/tests/file/fscanf_variation24.phpt
@@ -991,3 +991,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation25.phpt b/ext/standard/tests/file/fscanf_variation25.phpt
index 3a4a098af7..d874aba45e 100644
--- a/ext/standard/tests/file/fscanf_variation25.phpt
+++ b/ext/standard/tests/file/fscanf_variation25.phpt
@@ -291,3 +291,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation26.phpt b/ext/standard/tests/file/fscanf_variation26.phpt
index 1741a2684e..1a883f479b 100644
--- a/ext/standard/tests/file/fscanf_variation26.phpt
+++ b/ext/standard/tests/file/fscanf_variation26.phpt
@@ -353,3 +353,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation27.phpt b/ext/standard/tests/file/fscanf_variation27.phpt
index e3350758ad..7a691fcc60 100644
--- a/ext/standard/tests/file/fscanf_variation27.phpt
+++ b/ext/standard/tests/file/fscanf_variation27.phpt
@@ -1010,3 +1010,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation28.phpt b/ext/standard/tests/file/fscanf_variation28.phpt
index 6cb0dc6ba3..97f72089fe 100644
--- a/ext/standard/tests/file/fscanf_variation28.phpt
+++ b/ext/standard/tests/file/fscanf_variation28.phpt
@@ -41,7 +41,7 @@ $float_values = array (
);
$octal_formats = array( "%o",
- "%ho", "%lo", "%Lo",
+ "%ho", "%lo", "%Lo",
" %o", "%o ", "% o",
"\t%o", "\n%o", "%4o",
"%30o", "%[0-7]", "%*o"
diff --git a/ext/standard/tests/file/fscanf_variation29.phpt b/ext/standard/tests/file/fscanf_variation29.phpt
index 89f82e97d0..c5b93e5d86 100644
--- a/ext/standard/tests/file/fscanf_variation29.phpt
+++ b/ext/standard/tests/file/fscanf_variation29.phpt
@@ -31,12 +31,12 @@ $resource_types = array (
$dfp
);
-$octal_formats = array( "%o",
- "%ho", "%lo", "%Lo",
- " %o", "%o ", "% o",
- "\t%o", "\n%o", "%4o",
- "%30o", "%[0-9]", "%*o"
- );
+$octal_formats = array( "%o",
+ "%ho", "%lo", "%Lo",
+ " %o", "%o ", "% o",
+ "\t%o", "\n%o", "%4o",
+ "%30o", "%[0-7]", "%*o"
+ );
$counter = 1;
@@ -219,3 +219,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation3.phpt b/ext/standard/tests/file/fscanf_variation3.phpt
index c86869bbc1..8faff9d091 100644
--- a/ext/standard/tests/file/fscanf_variation3.phpt
+++ b/ext/standard/tests/file/fscanf_variation3.phpt
@@ -862,3 +862,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation30.phpt b/ext/standard/tests/file/fscanf_variation30.phpt
index ab95382e8d..b4cb350ed6 100644
--- a/ext/standard/tests/file/fscanf_variation30.phpt
+++ b/ext/standard/tests/file/fscanf_variation30.phpt
@@ -710,3 +710,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation31.phpt b/ext/standard/tests/file/fscanf_variation31.phpt
index ab14f52e0b..f6bc7465f5 100644
--- a/ext/standard/tests/file/fscanf_variation31.phpt
+++ b/ext/standard/tests/file/fscanf_variation31.phpt
@@ -943,3 +943,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation32.phpt b/ext/standard/tests/file/fscanf_variation32.phpt
index ba92c62525..52e45405d0 100644
--- a/ext/standard/tests/file/fscanf_variation32.phpt
+++ b/ext/standard/tests/file/fscanf_variation32.phpt
@@ -248,3 +248,4 @@ NULL
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation33.phpt b/ext/standard/tests/file/fscanf_variation33.phpt
index 6c788b13f7..7ecff33fb9 100644
--- a/ext/standard/tests/file/fscanf_variation33.phpt
+++ b/ext/standard/tests/file/fscanf_variation33.phpt
@@ -1016,3 +1016,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation34.phpt b/ext/standard/tests/file/fscanf_variation34.phpt
index b3f9c72f07..2acdc8ba1b 100644
--- a/ext/standard/tests/file/fscanf_variation34.phpt
+++ b/ext/standard/tests/file/fscanf_variation34.phpt
@@ -866,3 +866,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation35.phpt b/ext/standard/tests/file/fscanf_variation35.phpt
index d259f12d4b..f6498128cc 100644
--- a/ext/standard/tests/file/fscanf_variation35.phpt
+++ b/ext/standard/tests/file/fscanf_variation35.phpt
@@ -214,3 +214,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation36.phpt b/ext/standard/tests/file/fscanf_variation36.phpt
index 1e5f4e6d5c..44ff29536e 100644
--- a/ext/standard/tests/file/fscanf_variation36.phpt
+++ b/ext/standard/tests/file/fscanf_variation36.phpt
@@ -705,3 +705,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation37.phpt b/ext/standard/tests/file/fscanf_variation37.phpt
index aa07f588af..7ab302dd39 100644
--- a/ext/standard/tests/file/fscanf_variation37.phpt
+++ b/ext/standard/tests/file/fscanf_variation37.phpt
@@ -943,3 +943,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation38.phpt b/ext/standard/tests/file/fscanf_variation38.phpt
index 6bb868c2f9..32a7f77b42 100644
--- a/ext/standard/tests/file/fscanf_variation38.phpt
+++ b/ext/standard/tests/file/fscanf_variation38.phpt
@@ -243,3 +243,4 @@ NULL
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation39.phpt b/ext/standard/tests/file/fscanf_variation39.phpt
index 7c11428e03..f0d406c583 100644
--- a/ext/standard/tests/file/fscanf_variation39.phpt
+++ b/ext/standard/tests/file/fscanf_variation39.phpt
@@ -1005,3 +1005,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation4.phpt b/ext/standard/tests/file/fscanf_variation4.phpt
index 591836dffd..dff15309c0 100644
--- a/ext/standard/tests/file/fscanf_variation4.phpt
+++ b/ext/standard/tests/file/fscanf_variation4.phpt
@@ -38,8 +38,8 @@ $counter = 1;
// writing to the file
foreach($resource_types as $value) {
- fprintf($file_handle, $value);
- fprintf($file_handle, "\n");
+ @fprintf($file_handle, $value);
+ @fprintf($file_handle, "\n");
}
// closing the file
fclose($file_handle);
@@ -215,3 +215,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation40.phpt b/ext/standard/tests/file/fscanf_variation40.phpt
index 5d8770166a..f3a0c96a71 100644
--- a/ext/standard/tests/file/fscanf_variation40.phpt
+++ b/ext/standard/tests/file/fscanf_variation40.phpt
@@ -862,3 +862,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation41.phpt b/ext/standard/tests/file/fscanf_variation41.phpt
index 76faf0b09e..1591471ddf 100644
--- a/ext/standard/tests/file/fscanf_variation41.phpt
+++ b/ext/standard/tests/file/fscanf_variation41.phpt
@@ -214,3 +214,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation42.phpt b/ext/standard/tests/file/fscanf_variation42.phpt
index 1caf10cd71..978187c733 100644
--- a/ext/standard/tests/file/fscanf_variation42.phpt
+++ b/ext/standard/tests/file/fscanf_variation42.phpt
@@ -705,3 +705,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation43.phpt b/ext/standard/tests/file/fscanf_variation43.phpt
index 1b5b758a0a..8a0052f122 100644
--- a/ext/standard/tests/file/fscanf_variation43.phpt
+++ b/ext/standard/tests/file/fscanf_variation43.phpt
@@ -943,3 +943,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation44.phpt b/ext/standard/tests/file/fscanf_variation44.phpt
index 1f5b3bcf4b..0b30b61f20 100644
--- a/ext/standard/tests/file/fscanf_variation44.phpt
+++ b/ext/standard/tests/file/fscanf_variation44.phpt
@@ -243,3 +243,4 @@ NULL
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation45.phpt b/ext/standard/tests/file/fscanf_variation45.phpt
index 13655cb52c..7db0cc9748 100644
--- a/ext/standard/tests/file/fscanf_variation45.phpt
+++ b/ext/standard/tests/file/fscanf_variation45.phpt
@@ -1005,3 +1005,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation46.phpt b/ext/standard/tests/file/fscanf_variation46.phpt
index 9affb5e326..7145c8637a 100644
--- a/ext/standard/tests/file/fscanf_variation46.phpt
+++ b/ext/standard/tests/file/fscanf_variation46.phpt
@@ -856,3 +856,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation47.phpt b/ext/standard/tests/file/fscanf_variation47.phpt
index 011169a5c3..cda93cb1a6 100644
--- a/ext/standard/tests/file/fscanf_variation47.phpt
+++ b/ext/standard/tests/file/fscanf_variation47.phpt
@@ -214,3 +214,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation49.phpt b/ext/standard/tests/file/fscanf_variation49.phpt
index 29e1f31e5d..4e314fb7ce 100644
--- a/ext/standard/tests/file/fscanf_variation49.phpt
+++ b/ext/standard/tests/file/fscanf_variation49.phpt
@@ -943,3 +943,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation5.phpt b/ext/standard/tests/file/fscanf_variation5.phpt
index 1e457a6786..750e604586 100644
--- a/ext/standard/tests/file/fscanf_variation5.phpt
+++ b/ext/standard/tests/file/fscanf_variation5.phpt
@@ -42,8 +42,8 @@ $counter = 1;
// writing to the file
foreach($array_types as $value) {
- fprintf($file_handle, $value);
- fprintf($file_handle, "\n");
+ @fprintf($file_handle, $value);
+ @fprintf($file_handle, "\n");
}
// closing the file
fclose($file_handle);
@@ -77,30 +77,6 @@ unlink($filename);
--EXPECTF--
*** Test fscanf(): different integer format types with arrays ***
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-- iteration 1 --
array(1) {
[0]=>
@@ -729,3 +705,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation50.phpt b/ext/standard/tests/file/fscanf_variation50.phpt
index 7c4316c687..e46dbdb347 100644
--- a/ext/standard/tests/file/fscanf_variation50.phpt
+++ b/ext/standard/tests/file/fscanf_variation50.phpt
@@ -243,3 +243,4 @@ NULL
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation51.phpt b/ext/standard/tests/file/fscanf_variation51.phpt
index f27f56f889..5b6fbe926b 100644
--- a/ext/standard/tests/file/fscanf_variation51.phpt
+++ b/ext/standard/tests/file/fscanf_variation51.phpt
@@ -20,7 +20,7 @@ $file_handle = fopen($filename, "w");
if($file_handle == false)
exit("Error:failed to open file $filename");
//writing data to the file
-fwrite($file_handle,"sample text\n");
+@fwrite($file_handle,"sample text\n");
//closing the file
fclose($file_handle);
@@ -148,3 +148,4 @@ bool(false)
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation52.phpt b/ext/standard/tests/file/fscanf_variation52.phpt
index 5ca7653fb5..b917072922 100644
--- a/ext/standard/tests/file/fscanf_variation52.phpt
+++ b/ext/standard/tests/file/fscanf_variation52.phpt
@@ -173,3 +173,4 @@ bool(false)
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation53.phpt b/ext/standard/tests/file/fscanf_variation53.phpt
index c9ccbff8b8..61a78be026 100644
--- a/ext/standard/tests/file/fscanf_variation53.phpt
+++ b/ext/standard/tests/file/fscanf_variation53.phpt
@@ -224,3 +224,4 @@ bool(false)
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation54.phpt b/ext/standard/tests/file/fscanf_variation54.phpt
index 33f15c1044..0937e5b556 100644
--- a/ext/standard/tests/file/fscanf_variation54.phpt
+++ b/ext/standard/tests/file/fscanf_variation54.phpt
@@ -97,4 +97,5 @@ array(1) {
NULL
}
-*** Done *** \ No newline at end of file
+*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation55.phpt b/ext/standard/tests/file/fscanf_variation55.phpt
index a1ce9f3e9e..9b02d136d3 100644
--- a/ext/standard/tests/file/fscanf_variation55.phpt
+++ b/ext/standard/tests/file/fscanf_variation55.phpt
@@ -45,8 +45,8 @@ $counter = 1;
// writing to the file
foreach($valid_data as $data) {
- fprintf($file_handle, $data);
- fprintf($file_handle, "\n");
+ @fprintf($file_handle, $data);
+ @fprintf($file_handle, "\n");
}
// closing the file
fclose($file_handle);
@@ -1682,3 +1682,4 @@ int(68)
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation6.phpt b/ext/standard/tests/file/fscanf_variation6.phpt
index 0f2b97d6f3..74446f0851 100644
--- a/ext/standard/tests/file/fscanf_variation6.phpt
+++ b/ext/standard/tests/file/fscanf_variation6.phpt
@@ -48,8 +48,8 @@ $counter = 1;
// writing to the file
foreach($strings as $string) {
- fprintf($file_handle, $string);
- fprintf($file_handle, "\n");
+ @fprintf($file_handle, $string);
+ @fprintf($file_handle, "\n");
}
// closing the file
fclose($file_handle);
@@ -943,3 +943,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation7.phpt b/ext/standard/tests/file/fscanf_variation7.phpt
index d22c985904..33354e7faa 100644
--- a/ext/standard/tests/file/fscanf_variation7.phpt
+++ b/ext/standard/tests/file/fscanf_variation7.phpt
@@ -34,8 +34,8 @@ $counter = 1;
// writing to the file
foreach($bool_types as $value) {
- fprintf($file_handle, $value);
- fprintf($file_handle, "\n");
+ @fprintf($file_handle, $value);
+ @fprintf($file_handle, "\n");
}
// closing the file
fclose($file_handle);
@@ -243,3 +243,4 @@ NULL
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation8.phpt b/ext/standard/tests/file/fscanf_variation8.phpt
index 6212e35fe6..b1f5f4e554 100644
--- a/ext/standard/tests/file/fscanf_variation8.phpt
+++ b/ext/standard/tests/file/fscanf_variation8.phpt
@@ -66,8 +66,8 @@ $counter = 1;
// writing to the file
foreach($valid_floats as $float_value) {
- fprintf($file_handle, $float_value);
- fprintf($file_handle, "\n");
+ @fprintf($file_handle, $float_value);
+ @fprintf($file_handle, "\n");
}
// closing the file
fclose($file_handle);
@@ -1611,3 +1611,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fscanf_variation9.phpt b/ext/standard/tests/file/fscanf_variation9.phpt
index 6cea00aad8..f3551f08d2 100644
--- a/ext/standard/tests/file/fscanf_variation9.phpt
+++ b/ext/standard/tests/file/fscanf_variation9.phpt
@@ -1012,3 +1012,4 @@ array(0) {
bool(false)
*** Done ***
+
diff --git a/ext/standard/tests/file/fseek_ftell_rewind_basic1.phpt b/ext/standard/tests/file/fseek_ftell_rewind_basic1.phpt
index b348a78b2b..a9a54aba14 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_basic1.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_basic1.phpt
@@ -450,4 +450,4 @@ int(0)
int(522)
bool(false)
int(512)
-Done \ No newline at end of file
+Done
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 31c6ac3b6b..18ecf9a1dd 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt
@@ -2,10 +2,10 @@
Test fseek(), ftell() & rewind() functions : basic functionality - all w and x modes
--SKIPIF--
<?php
-if (substr(PHP_OS, 0, 3) != 'WIN') {
- die('skip only valid for Windows');
-}
+if( substr(PHP_OS, 0, 3) != "WIN" )
+ die("skip.. only valid for Windows");
?>
+
--FILE--
<?php
/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
@@ -49,7 +49,7 @@ foreach($file_content_types as $file_content_type){
$data_to_be_written="";
fill_buffer($data_to_be_written, $file_content_type, 512); //get the data of size 512
$data_to_be_written = $data_to_be_written;
- fwrite($file_handle,$data_to_be_written);
+ fwrite($file_handle,(binary)$data_to_be_written);
// set file pointer to 0
var_dump( rewind($file_handle) ); // set to begining of file
@@ -461,4 +461,4 @@ int(0)
int(522)
bool(false)
int(512)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt b/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt
index c129504e7a..866009467a 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt
@@ -2,9 +2,8 @@
Test fseek(), ftell() & rewind() functions : basic functionality - all w and x modes
--SKIPIF--
<?php
-if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip Not valid for Windows');
-}
+if( substr(PHP_OS, 0, 3) == "WIN" )
+ die("skip.. Not valid for Windows");
?>
--FILE--
<?php
@@ -49,7 +48,7 @@ foreach($file_content_types as $file_content_type){
$data_to_be_written="";
fill_buffer($data_to_be_written, $file_content_type, 512); //get the data of size 512
$data_to_be_written = $data_to_be_written;
- fwrite($file_handle,$data_to_be_written);
+ fwrite($file_handle,(binary)$data_to_be_written);
// set file pointer to 0
var_dump( rewind($file_handle) ); // set to begining of file
@@ -461,4 +460,4 @@ int(0)
int(522)
bool(false)
int(512)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation1.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation1.phpt
index e857d45871..7f6b2b4a8b 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_variation1.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_variation1.phpt
@@ -425,4 +425,4 @@ int(0)
int(513)
bool(false)
int(512)
-Done \ No newline at end of file
+Done
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 6920f9d2c6..ad01c3aef1 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_variation2-win32.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_variation2-win32.phpt
@@ -435,370 +435,3 @@ int(513)
bool(false)
int(512)
Done
---UEXPECTF--
-*** Testing fseek(), ftell(), rewind() : default whence & all w and x modes ***
-
--- File having data of type text_with_new_line --
--- File opened in mode w --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode wb --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode wt --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(569)
--- File opened in mode w+ --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode w+b --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode w+t --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(569)
--- File opened in mode x --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode xb --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode xt --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(569)
--- File opened in mode x+ --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode x+b --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode x+t --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(569)
-
--- File having data of type alphanumeric --
--- File opened in mode w --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode wb --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode wt --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode w+ --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode w+b --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode w+t --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode x --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode xb --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode xt --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode x+ --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode x+b --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
--- File opened in mode x+t --
--- Testing fseek() without using argument whence --
-int(-1)
-int(0)
-bool(false)
-int(0)
-int(0)
-bool(false)
-int(0)
-int(1)
-bool(false)
-int(0)
-int(513)
-bool(false)
-int(512)
-Done \ No newline at end of file
diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation2.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation2.phpt
index c9e2c802f8..67987cb712 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_variation2.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_variation2.phpt
@@ -2,9 +2,8 @@
Test fseek(), ftell() & rewind() functions : usage variations - all w and x modes, default whence
--SKIPIF--
<?php
-if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip Not valid for Windows');
-}
+if( substr(PHP_OS, 0, 3) == "WIN" )
+ die("skip.. Not valid for Windows");
?>
--FILE--
<?php
@@ -49,7 +48,7 @@ foreach($file_content_types as $file_content_type){
$data_to_be_written="";
fill_buffer($data_to_be_written, $file_content_type, 512); //get the data of size 512
$data_to_be_written = $data_to_be_written;
- fwrite($file_handle,$data_to_be_written);
+ fwrite($file_handle,(binary)$data_to_be_written);
rewind($file_handle);
echo "-- Testing fseek() without using argument whence --\n";
@@ -435,4 +434,4 @@ int(0)
int(513)
bool(false)
int(512)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation3.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation3.phpt
index a599d2e6a4..4b84d409f2 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_variation3.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_variation3.phpt
@@ -475,4 +475,4 @@ int(0)
int(600)
bool(false)
int(512)
-Done \ No newline at end of file
+Done
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 2f519c371f..09c83447d8 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_variation4-win32.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_variation4-win32.phpt
@@ -2,9 +2,8 @@
Test fseek(), ftell() & rewind() functions : usage variations - all w and x modes, SEEK_SET
--SKIPIF--
<?php
-if (substr(PHP_OS, 0, 3) != 'WIN') {
- die('skip only valid for Windows');
-}
+if( substr(PHP_OS, 0, 3) != "WIN" )
+ die("skip.. only valid for Windows");
?>
--FILE--
<?php
@@ -48,7 +47,7 @@ foreach($file_content_types as $file_content_type){
$data_to_be_written="";
fill_buffer($data_to_be_written, $file_content_type, 512); //get the data of size 512
$data_to_be_written = $data_to_be_written;
- fwrite($file_handle,$data_to_be_written);
+ fwrite($file_handle,(binary)$data_to_be_written);
rewind($file_handle);
foreach($offset as $count){
diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation4.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation4.phpt
index 045bc253f2..e4029c718a 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_variation4.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_variation4.phpt
@@ -2,9 +2,8 @@
Test fseek(), ftell() & rewind() functions : usage variations - all w and x modes, SEEK_SET
--SKIPIF--
<?php
-if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip Not valid for Windows');
-}
+if( substr(PHP_OS, 0, 3) == "WIN" )
+ die("skip.. Not valid for Windows");
?>
--FILE--
<?php
@@ -48,7 +47,7 @@ foreach($file_content_types as $file_content_type){
$data_to_be_written="";
fill_buffer($data_to_be_written, $file_content_type, 512); //get the data of size 512
$data_to_be_written = $data_to_be_written;
- fwrite($file_handle,$data_to_be_written);
+ fwrite($file_handle,(binary)$data_to_be_written);
rewind($file_handle);
foreach($offset as $count){
@@ -481,4 +480,4 @@ int(0)
int(600)
bool(false)
int(512)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation5.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation5.phpt
index d2edf82c3f..75f281291d 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_variation5.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_variation5.phpt
@@ -471,4 +471,4 @@ int(0)
int(1113)
bool(false)
int(512)
-Done \ No newline at end of file
+Done
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 bc75a38e02..d4519123c6 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_variation6-win32.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_variation6-win32.phpt
@@ -2,9 +2,8 @@
Test fseek(), ftell() & rewind() functions : usage variations - all w & x modes, SEEK_CUR
--SKIPIF--
<?php
-if (substr(PHP_OS, 0, 3) != 'WIN') {
- die('skip only valid for Windows');
-}
+if( substr(PHP_OS, 0, 3) != "WIN" )
+ die("skip.. only valid for Windows");
?>
--FILE--
<?php
@@ -48,7 +47,7 @@ foreach($file_content_types as $file_content_type){
$data_to_be_written="";
fill_buffer($data_to_be_written, $file_content_type, 512); //get the data of size 512
$data_to_be_written = $data_to_be_written;
- fwrite($file_handle,$data_to_be_written);
+ fwrite($file_handle,(binary)$data_to_be_written);
rewind($file_handle);
foreach($offset as $count){
@@ -68,7 +67,6 @@ foreach($file_content_types as $file_content_type){
echo "Done\n";
?>
--EXPECTF--
-
*** Testing fseek(), ftell(), rewind() : whence = SEEK_CUR & all w and x modes ***
-- File having data of type text_with_new_line --
@@ -482,4 +480,4 @@ int(0)
int(1113)
bool(false)
int(512)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation6.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation6.phpt
index cf5e6494f7..44519884a9 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_variation6.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_variation6.phpt
@@ -2,9 +2,8 @@
Test fseek(), ftell() & rewind() functions : usage variations - all w & x modes, SEEK_CUR
--SKIPIF--
<?php
-if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip Not valid for Windows');
-}
+if( substr(PHP_OS, 0, 3) == "WIN" )
+ die("skip.. Not valid for Windows");
?>
--FILE--
<?php
@@ -48,7 +47,7 @@ foreach($file_content_types as $file_content_type){
$data_to_be_written="";
fill_buffer($data_to_be_written, $file_content_type, 512); //get the data of size 512
$data_to_be_written = $data_to_be_written;
- fwrite($file_handle,$data_to_be_written);
+ fwrite($file_handle,(binary)$data_to_be_written);
rewind($file_handle);
foreach($offset as $count){
@@ -481,4 +480,4 @@ int(0)
int(1113)
bool(false)
int(512)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation7.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation7.phpt
index f6ac2656a0..f0e8e4619f 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_variation7.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_variation7.phpt
@@ -474,4 +474,4 @@ int(0)
int(1112)
bool(false)
int(512)
-Done \ No newline at end of file
+Done
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 4bc35b869c..5586e2bd5a 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_variation8-win32.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_variation8-win32.phpt
@@ -2,9 +2,8 @@
Test fseek(), ftell() & rewind() functions : usage variations - all w and x modes, SEEK_END
--SKIPIF--
<?php
-if (substr(PHP_OS, 0, 3) != 'WIN') {
- die('skip only valid for Windows');
-}
+if( substr(PHP_OS, 0, 3) != "WIN" )
+ die("skip.. only valid for Windows");
?>
--FILE--
<?php
@@ -49,7 +48,7 @@ foreach($file_content_types as $file_content_type){
$data_to_be_written="";
fill_buffer($data_to_be_written, $file_content_type, 512); //get the data of size 512
$data_to_be_written = $data_to_be_written;
- fwrite($file_handle,$data_to_be_written);
+ fwrite($file_handle,(binary)$data_to_be_written);
rewind($file_handle);
foreach($offset as $count){
@@ -482,4 +481,4 @@ int(0)
int(1112)
bool(false)
int(512)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/fseek_ftell_rewind_variation8.phpt b/ext/standard/tests/file/fseek_ftell_rewind_variation8.phpt
index 3e48804e3d..a2a0d676c2 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_variation8.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_variation8.phpt
@@ -2,9 +2,8 @@
Test fseek(), ftell() & rewind() functions : usage variations - all w and x modes, SEEK_END
--SKIPIF--
<?php
-if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip Not valid for Windows');
-}
+if( substr(PHP_OS, 0, 3) == "WIN" )
+ die("skip.. Not valid for Windows");
?>
--FILE--
<?php
@@ -49,7 +48,7 @@ foreach($file_content_types as $file_content_type){
$data_to_be_written="";
fill_buffer($data_to_be_written, $file_content_type, 512); //get the data of size 512
$data_to_be_written = $data_to_be_written;
- fwrite($file_handle,$data_to_be_written);
+ fwrite($file_handle,(binary)$data_to_be_written);
rewind($file_handle);
foreach($offset as $count){
@@ -482,4 +481,4 @@ int(0)
int(1112)
bool(false)
int(512)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/ftruncate_error.phpt b/ext/standard/tests/file/ftruncate_error.phpt
index 182ade5ffc..a6be930366 100644
--- a/ext/standard/tests/file/ftruncate_error.phpt
+++ b/ext/standard/tests/file/ftruncate_error.phpt
@@ -11,7 +11,7 @@ echo "*** Testing ftruncate() : error conditions ***\n";
$filename = dirname(__FILE__)."/ftruncate_error.tmp";
$file_handle = fopen($filename, "w" );
-fwrite($file_handle, "Testing ftruncate error conditions \n");
+fwrite($file_handle, (binary)"Testing ftruncate error conditions \n");
fflush($file_handle);
echo "\n Initial file size = ".filesize($filename)."\n";
diff --git a/ext/standard/tests/file/ftruncate_variation1-win32.phpt b/ext/standard/tests/file/ftruncate_variation1-win32.phpt
index 22a766742f..dbf1896d27 100644
--- a/ext/standard/tests/file/ftruncate_variation1-win32.phpt
+++ b/ext/standard/tests/file/ftruncate_variation1-win32.phpt
@@ -458,4 +458,4 @@ bool(true)
int(0)
bool(false)
int(0)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/ftruncate_variation2-win32.phpt b/ext/standard/tests/file/ftruncate_variation2-win32.phpt
index b2051d5bfd..7b2e0b42ee 100644
--- a/ext/standard/tests/file/ftruncate_variation2-win32.phpt
+++ b/ext/standard/tests/file/ftruncate_variation2-win32.phpt
@@ -459,4 +459,4 @@ bool(true)
int(0)
bool(false)
int(1024)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/ftruncate_variation3-win32.phpt b/ext/standard/tests/file/ftruncate_variation3-win32.phpt
index c3304e20e4..d9aa40e6e7 100644
--- a/ext/standard/tests/file/ftruncate_variation3-win32.phpt
+++ b/ext/standard/tests/file/ftruncate_variation3-win32.phpt
@@ -458,4 +458,4 @@ bool(true)
int(0)
bool(false)
int(512)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/ftruncate_variation4-win32.phpt b/ext/standard/tests/file/ftruncate_variation4-win32.phpt
index d61a29c275..ae9e5a4743 100644
--- a/ext/standard/tests/file/ftruncate_variation4-win32.phpt
+++ b/ext/standard/tests/file/ftruncate_variation4-win32.phpt
@@ -459,4 +459,4 @@ bool(false)
int(0)
bool(false)
int(1024)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/ftruncate_variation5-win32.phpt b/ext/standard/tests/file/ftruncate_variation5-win32.phpt
index 3156027b5b..eb45ffcdac 100644
--- a/ext/standard/tests/file/ftruncate_variation5-win32.phpt
+++ b/ext/standard/tests/file/ftruncate_variation5-win32.phpt
@@ -460,4 +460,4 @@ bool(true)
int(0)
bool(false)
int(1124)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/ftruncate_variation6-win32.phpt b/ext/standard/tests/file/ftruncate_variation6-win32.phpt
index 7009e61f62..0815092e2b 100644
--- a/ext/standard/tests/file/ftruncate_variation6-win32.phpt
+++ b/ext/standard/tests/file/ftruncate_variation6-win32.phpt
@@ -479,4 +479,4 @@ line of te"
int(0)
bool(false)
int(15)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/ftruncate_variation7-win32.phpt b/ext/standard/tests/file/ftruncate_variation7-win32.phpt
index e6424a729e..dc3a4cc10b 100644
--- a/ext/standard/tests/file/ftruncate_variation7-win32.phpt
+++ b/ext/standard/tests/file/ftruncate_variation7-win32.phpt
@@ -460,4 +460,4 @@ bool(true)
int(1024)
bool(false)
int(200)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/htmlentities19.phpt b/ext/standard/tests/file/htmlentities19.phpt
index d0cd662b1b..c858ccb7d4 100644
--- a/ext/standard/tests/file/htmlentities19.phpt
+++ b/ext/standard/tests/file/htmlentities19.phpt
@@ -328,3 +328,4 @@ Warning: htmlentities() expects at least 1 parameter, 0 given in %s on line %d
NULL
string(14) "&bdquo;&lsquo;"
Done
+
diff --git a/ext/standard/tests/file/htmlspecialchars.phpt b/ext/standard/tests/file/htmlspecialchars.phpt
index 48e37781f0..5d741e5ecb 100644
--- a/ext/standard/tests/file/htmlspecialchars.phpt
+++ b/ext/standard/tests/file/htmlspecialchars.phpt
@@ -328,3 +328,4 @@ Warning: htmlspecialchars() expects at least 1 parameter, 0 given in %s on line
NULL
string(10) "&lt;br&gt;"
Done
+
diff --git a/ext/standard/tests/file/is_dir_error.phpt b/ext/standard/tests/file/is_dir_error.phpt
index 1995e4319f..6040767686 100644
--- a/ext/standard/tests/file/is_dir_error.phpt
+++ b/ext/standard/tests/file/is_dir_error.phpt
@@ -7,7 +7,7 @@ Test is_dir() function: error conditions
* Returns TRUE if the filename exists and is a regular file
*/
-echo "\n*** Testing is_dir() error conditions ***";
+echo "*** Testing is_dir() error conditions ***";
var_dump( is_dir() ); // Zero No. of args
$dir_name = dirname(__FILE__)."/is_dir_error";
@@ -26,10 +26,10 @@ rmdir(dirname(__FILE__)."/is_dir_error");
?>
--EXPECTF--
*** Testing is_dir() error conditions ***
-Warning: Wrong parameter count for is_dir() in %s on line %d
+Warning: is_dir() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for is_dir() in %s on line %d
+Warning: is_dir() expects exactly 1 parameter, 2 given in %s on line %d
NULL
bool(false)
*** Done ***
diff --git a/ext/standard/tests/file/is_dir_variation2.phpt b/ext/standard/tests/file/is_dir_variation2.phpt
index df2464d3c2..be6338c239 100644
--- a/ext/standard/tests/file/is_dir_variation2.phpt
+++ b/ext/standard/tests/file/is_dir_variation2.phpt
@@ -14,7 +14,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
/* Testing is_dir() with dir, soft & hard link to dir,
and with file, soft & hard link to file */
-
+
$file_path = dirname(__FILE__);
echo "*** Testing is_dir() with dir and links to dir ***\n";
diff --git a/ext/standard/tests/file/is_dir_variation3.phpt b/ext/standard/tests/file/is_dir_variation3.phpt
index c9b20420c7..9c2cdf885a 100644
--- a/ext/standard/tests/file/is_dir_variation3.phpt
+++ b/ext/standard/tests/file/is_dir_variation3.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test is_dir() function: usage variations - invalid arguments
+Test is_dir() function: usage variations - invalid arguments
--FILE--
<?php
/* Prototype: bool is_dir ( string $dirname );
@@ -20,7 +20,7 @@ $dirnames = array(
NULL,
$dir_handle,
- /* scalars */
+ /* Non-existing dirnames */
0,
1234
);
@@ -39,7 +39,9 @@ bool(false)
bool(false)
bool(false)
bool(false)
-bool(false)
+
+Warning: is_dir() expects parameter 1 to be string, resource given in %s on line %d
+NULL
bool(false)
bool(false)
diff --git a/ext/standard/tests/file/is_executable_basic.phpt b/ext/standard/tests/file/is_executable_basic.phpt
index 730ffc9fc3..c0a04e64bb 100644
--- a/ext/standard/tests/file/is_executable_basic.phpt
+++ b/ext/standard/tests/file/is_executable_basic.phpt
@@ -5,7 +5,6 @@ Test is_executable() function: basic functionality
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip not for windows');
}
-
// Skip if being run by root (files are always readable, writeable and executable)
$filename = dirname(__FILE__)."/is_readable_root_check.tmp";
$fp = fopen($filename, 'w');
diff --git a/ext/standard/tests/file/is_executable_error.phpt b/ext/standard/tests/file/is_executable_error.phpt
index 60d22860a6..4fb3dbaf5f 100644
--- a/ext/standard/tests/file/is_executable_error.phpt
+++ b/ext/standard/tests/file/is_executable_error.phpt
@@ -18,10 +18,10 @@ echo "Done\n";
--EXPECTF--
*** Testing is_executable(): error conditions ***
-Warning: Wrong parameter count for is_executable() in %s on line %d
+Warning: is_executable() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for is_executable() in %s on line %d
+Warning: is_executable() expects exactly 1 parameter, 2 given in %s on line %d
NULL
*** Testing is_exceutable() on non-existent directory ***
diff --git a/ext/standard/tests/file/is_executable_variation1.phpt b/ext/standard/tests/file/is_executable_variation1.phpt
index f172f503ce..9969911ee1 100644
--- a/ext/standard/tests/file/is_executable_variation1.phpt
+++ b/ext/standard/tests/file/is_executable_variation1.phpt
@@ -5,16 +5,6 @@ Test is_executable() function: usage variations - diff. path notations
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip not for windows');
}
-// Skip if being run by root (files are always readable, writeable and executable)
-$filename = dirname(__FILE__)."/is_executable_root_check.tmp";
-$fp = fopen($filename, 'w');
-fclose($fp);
-if(fileowner($filename) == 0) {
- unlink ($filename);
- die('skip cannot be run as root');
-}
-
-unlink($filename);
?>
--FILE--
<?php
diff --git a/ext/standard/tests/file/is_executable_variation2.phpt b/ext/standard/tests/file/is_executable_variation2.phpt
index cc7439b06a..1235ec134f 100644
--- a/ext/standard/tests/file/is_executable_variation2.phpt
+++ b/ext/standard/tests/file/is_executable_variation2.phpt
@@ -5,16 +5,6 @@ Test is_executable() function: usage variations - file/dir with diff. perms
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip not for windows');
}
-// Skip if being run by root (files are always readable, writeable and executable)
-$filename = dirname(__FILE__)."/is_executable_root_check.tmp";
-$fp = fopen($filename, 'w');
-fclose($fp);
-if(fileowner($filename) == 0) {
- unlink ($filename);
- die('skip cannot be run as root');
-}
-
-unlink($filename);
?>
--FILE--
<?php
diff --git a/ext/standard/tests/file/is_executable_variation3.phpt b/ext/standard/tests/file/is_executable_variation3.phpt
index 777599cbf9..4ec53a5ab2 100644
--- a/ext/standard/tests/file/is_executable_variation3.phpt
+++ b/ext/standard/tests/file/is_executable_variation3.phpt
@@ -5,16 +5,6 @@ Test is_executable() function: usage variations - invalid file names
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip not for windows');
}
-// Skip if being run by root (files are always readable, writeable and executable)
-$filename = dirname(__FILE__)."/is_executable_root_check.tmp";
-$fp = fopen($filename, 'w');
-fclose($fp);
-if(fileowner($filename) == 0) {
- unlink ($filename);
- die('skip cannot be run as root');
-}
-
-unlink($filename);
?>
--FILE--
<?php
@@ -60,7 +50,7 @@ bool(false)
bool(false)
bool(false)
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: is_executable() expects parameter 1 to be string, array given in %s on line %d
+NULL
bool(false)
Done
diff --git a/ext/standard/tests/file/is_file_error.phpt b/ext/standard/tests/file/is_file_error.phpt
index 5ba07e2e39..1a605d1040 100644
--- a/ext/standard/tests/file/is_file_error.phpt
+++ b/ext/standard/tests/file/is_file_error.phpt
@@ -7,11 +7,11 @@ Test is_file() function: error conditions
Returns TRUE if the filename exists and is a regular file
*/
-echo "\n*** Testing is_file() error conditions ***";
+echo "*** Testing is_file() error conditions ***";
$file_path = dirname(__FILE__);
var_dump( is_file() ); // Zero No. of args
-/* no.of args > expected no.of args */
+/* no of args > expected */
$file_handle = fopen($file_path."/is_file_error.tmp", "w");
var_dump( is_file( $file_path."/is_file_error.tmp", $file_path."/is_file_error1.tmp") );
@@ -30,15 +30,18 @@ echo "\n*** Done ***";
<?php
$file_path = dirname(__FILE__);
unlink($file_path."/is_file_error.tmp");
+unlink($file_path."/is_file_error1.tmp");
?>
--EXPECTF--
*** Testing is_file() error conditions ***
-Warning: Wrong parameter count for is_file() in %s on line %d
+Warning: is_file() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for is_file() in %s on line %d
+Warning: is_file() expects exactly 1 parameter, 2 given in %s on line %d
NULL
bool(false)
-bool(false)
+
+Warning: is_file() expects parameter 1 to be string, resource given in %s on line %d
+NULL
*** Done ***
diff --git a/ext/standard/tests/file/is_file_variation3.phpt b/ext/standard/tests/file/is_file_variation3.phpt
index af7501315e..fd952fa096 100644
--- a/ext/standard/tests/file/is_file_variation3.phpt
+++ b/ext/standard/tests/file/is_file_variation3.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test is_file() function: usage variations - invalid filenames
+Test is_file() function: usage variations - invalid arguments
--FILE--
<?php
/* Prototype: bool is_file ( string $filename );
@@ -21,12 +21,12 @@ $filenames = array(
FALSE,
NULL,
$file_handle,
-
+
/* scalars */
1234,
0
);
-
+
/* loop through to test each element the above array */
foreach( $filenames as $filename ) {
var_dump( is_file($filename) );
@@ -48,7 +48,9 @@ bool(false)
bool(false)
bool(false)
bool(false)
-bool(false)
+
+Warning: is_file() expects parameter 1 to be string, resource given in %s on line %d
+NULL
bool(false)
bool(false)
diff --git a/ext/standard/tests/file/is_readable_error.phpt b/ext/standard/tests/file/is_readable_error.phpt
index bf01fcdcad..9a734cd14d 100644
--- a/ext/standard/tests/file/is_readable_error.phpt
+++ b/ext/standard/tests/file/is_readable_error.phpt
@@ -18,10 +18,10 @@ echo "Done\n";
--EXPECTF--
*** Testing is_readable(): error conditions ***
-Warning: Wrong parameter count for is_readable() in %s on line %d
+Warning: is_readable() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for is_readable() in %s on line %d
+Warning: is_readable() expects exactly 1 parameter, 2 given in %s on line %d
NULL
*** Testing is_readable() on non-existent file ***
diff --git a/ext/standard/tests/file/is_readable_variation1.phpt b/ext/standard/tests/file/is_readable_variation1.phpt
index 2ab1e3d679..76eafd0b5a 100644
--- a/ext/standard/tests/file/is_readable_variation1.phpt
+++ b/ext/standard/tests/file/is_readable_variation1.phpt
@@ -5,16 +5,6 @@ Test is_readable() function: usage variations - diff. file notations
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip not for windows');
}
-// Skip if being run by root (files are always readable, writeable and executable)
-$filename = dirname(__FILE__)."/is_readable_root_check.tmp";
-$fp = fopen($filename, 'w');
-fclose($fp);
-if(fileowner($filename) == 0) {
- unlink ($filename);
- die('skip cannot be run as root');
-}
-
-unlink($filename);
?>
--FILE--
<?php
diff --git a/ext/standard/tests/file/is_readable_variation2.phpt b/ext/standard/tests/file/is_readable_variation2.phpt
index 0a3e4f7da0..1017870028 100644
--- a/ext/standard/tests/file/is_readable_variation2.phpt
+++ b/ext/standard/tests/file/is_readable_variation2.phpt
@@ -5,16 +5,6 @@ Test is_readable() function: usage variations - file/dir with diff. perms
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip not for windows');
}
-// Skip if being run by root (files are always readable, writeable and executable)
-$filename = dirname(__FILE__)."/is_readable_root_check.tmp";
-$fp = fopen($filename, 'w');
-fclose($fp);
-if(fileowner($filename) == 0) {
- unlink ($filename);
- die('skip cannot be run as root');
-}
-
-unlink($filename);
?>
--FILE--
<?php
diff --git a/ext/standard/tests/file/is_readable_variation3.phpt b/ext/standard/tests/file/is_readable_variation3.phpt
index e42839ed9d..fefd7a2c4c 100644
--- a/ext/standard/tests/file/is_readable_variation3.phpt
+++ b/ext/standard/tests/file/is_readable_variation3.phpt
@@ -5,16 +5,6 @@ Test is_readable() function: usage variations - invalid file names
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip not for windows');
}
-// Skip if being run by root (files are always readable, writeable and executable)
-$filename = dirname(__FILE__)."/is_readable_root_check.tmp";
-$fp = fopen($filename, 'w');
-fclose($fp);
-if(fileowner($filename) == 0) {
- unlink ($filename);
- die('skip cannot be run as root');
-}
-
-unlink($filename);
?>
--FILE--
<?php
@@ -60,7 +50,7 @@ bool(false)
bool(false)
bool(false)
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: is_readable() expects parameter 1 to be string, array given in %s on line %d
+NULL
bool(false)
Done
diff --git a/ext/standard/tests/file/is_writable_error.phpt b/ext/standard/tests/file/is_writable_error.phpt
index 277d3d0c1b..e3755bc748 100644
--- a/ext/standard/tests/file/is_writable_error.phpt
+++ b/ext/standard/tests/file/is_writable_error.phpt
@@ -25,18 +25,18 @@ echo "Done\n";
--EXPECTF--
*** Testing is_writable(): error conditions ***
-Warning: Wrong parameter count for is_writable() in %s on line %d
+Warning: is_writable() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for is_writeable() in %s on line %d
+Warning: is_writeable() expects exactly 1 parameter, 0 given in %s on line %d
NULL
*** Testing is_writeable(): error conditions ***
-Warning: Wrong parameter count for is_writable() in %s on line %d
+Warning: is_writable() expects exactly 1 parameter, 2 given in %s on line %d
NULL
-Warning: Wrong parameter count for is_writeable() in %s on line %d
+Warning: is_writeable() expects exactly 1 parameter, 2 given in %s on line %d
NULL
*** Testing is_writable() on non-existent file ***
diff --git a/ext/standard/tests/file/is_writable_variation1.phpt b/ext/standard/tests/file/is_writable_variation1.phpt
index 2d0da9b186..97232b4320 100644
--- a/ext/standard/tests/file/is_writable_variation1.phpt
+++ b/ext/standard/tests/file/is_writable_variation1.phpt
@@ -5,16 +5,6 @@ Test is_writable() and its alias is_writeable() function: usage variations - dif
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. only on LINUX');
}
-// Skip if being run by root (files are always readable, writeable and executable)
-$filename = dirname(__FILE__)."/is_writable_root_check.tmp";
-$fp = fopen($filename, 'w');
-fclose($fp);
-if(fileowner($filename) == 0) {
- unlink ($filename);
- die('skip cannot be run as root');
-}
-
-unlink($filename);
?>
--FILE--
<?php
@@ -110,4 +100,4 @@ bool(true)
-- Iteration 11 --
bool(true)
bool(true)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/is_writable_variation2.phpt b/ext/standard/tests/file/is_writable_variation2.phpt
index 40f93b38a2..5fcbb5d4ae 100644
--- a/ext/standard/tests/file/is_writable_variation2.phpt
+++ b/ext/standard/tests/file/is_writable_variation2.phpt
@@ -5,16 +5,6 @@ Test is_writable() and its alias is_writeable() function: usage variations - fil
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. only on LINUX');
}
-// Skip if being run by root (files are always readable, writeable and executable)
-$filename = dirname(__FILE__)."/is_writable_root_check.tmp";
-$fp = fopen($filename, 'w');
-fclose($fp);
-if(fileowner($filename) == 0) {
- unlink ($filename);
- die('skip cannot be run as root');
-}
-
-unlink($filename);
?>
--FILE--
<?php
diff --git a/ext/standard/tests/file/is_writable_variation3.phpt b/ext/standard/tests/file/is_writable_variation3.phpt
index 69de6046d5..e2cc13c33a 100644
--- a/ext/standard/tests/file/is_writable_variation3.phpt
+++ b/ext/standard/tests/file/is_writable_variation3.phpt
@@ -5,16 +5,6 @@ Test is_writable() and its alias is_writeable() function: usage variations - inv
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. only on LINUX');
}
-// Skip if being run by root (files are always readable, writeable and executable)
-$filename = dirname(__FILE__)."/is_writable_root_check.tmp";
-$fp = fopen($filename, 'w');
-fclose($fp);
-if(fileowner($filename) == 0) {
- unlink ($filename);
- die('skip cannot be run as root');
-}
-
-unlink($filename);
?>
--FILE--
<?php
@@ -66,11 +56,11 @@ bool(false)
bool(false)
bool(false)
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: is_writable() expects parameter 1 to be string, array given in %s on line %d
+NULL
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: is_writeable() expects parameter 1 to be string, array given in %s on line %d
+NULL
bool(false)
bool(false)
Done
diff --git a/ext/standard/tests/file/lstat_stat_error.phpt b/ext/standard/tests/file/lstat_stat_error.phpt
index e5a971461e..2a220084a4 100644
--- a/ext/standard/tests/file/lstat_stat_error.phpt
+++ b/ext/standard/tests/file/lstat_stat_error.phpt
@@ -39,10 +39,10 @@ echo "Done\n";
--EXPECTF--
*** Testing lstat() for error conditions ***
-Warning: Wrong parameter count for lstat() in %s on line %d
+Warning: lstat() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for lstat() in %s on line %d
+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
@@ -51,20 +51,18 @@ bool(false)
Warning: lstat(): Lstat failed for 22 in %s on line %d
bool(false)
-Notice: Array to string conversion in %s on line %d
-
-Warning: lstat(): Lstat failed for Array in %s on line %d
-bool(false)
+Warning: lstat() expects parameter 1 to be string, array given in %s on line %d
+NULL
*** Testing stat() for error conditions ***
-Warning: Wrong parameter count for stat() in %s on line %d
+Warning: stat() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for stat() in %s on line %d
+Warning: stat() expects exactly 1 parameter, 2 given in %s on line %d
NULL
-Warning: Wrong parameter count for stat() in %s on line %d
+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
@@ -76,8 +74,6 @@ bool(false)
Warning: stat(): stat failed for 22 in %s on line %d
bool(false)
-Notice: Array to string conversion in %s on line %d
-
-Warning: stat(): stat failed for Array in %s on line %d
-bool(false)
+Warning: stat() expects parameter 1 to be string, array given in %s on line %d
+NULL
Done
diff --git a/ext/standard/tests/file/lstat_stat_variation14.phpt b/ext/standard/tests/file/lstat_stat_variation14.phpt
index 1e5289fed1..517f77e3f5 100644
--- a/ext/standard/tests/file/lstat_stat_variation14.phpt
+++ b/ext/standard/tests/file/lstat_stat_variation14.phpt
@@ -15,7 +15,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
Description: Gives information about a file
*/
-/* test the effects of is_link() on stats of link */
+/* test the effects of is_link() on stats of hard link */
$file_path = dirname(__FILE__);
require "$file_path/file.inc";
diff --git a/ext/standard/tests/file/lstat_stat_variation18.phpt b/ext/standard/tests/file/lstat_stat_variation18.phpt
index b675ab50f9..fc98739fa7 100644
--- a/ext/standard/tests/file/lstat_stat_variation18.phpt
+++ b/ext/standard/tests/file/lstat_stat_variation18.phpt
@@ -36,7 +36,7 @@ class names {
}
// directory name stored in an object
-$dir_name = new names("$file_path/lstat_stat_variation18/");
+$dir_name = new names("$file_path/lstat_stat_variation18");
// file name stored in an object
$file_name = new names("$file_path/lstat_stat_variation18.tmp");
diff --git a/ext/standard/tests/file/lstat_stat_variation19.phpt b/ext/standard/tests/file/lstat_stat_variation19.phpt
index 7dcb9b5c5f..c481575ce9 100644
--- a/ext/standard/tests/file/lstat_stat_variation19.phpt
+++ b/ext/standard/tests/file/lstat_stat_variation19.phpt
@@ -22,7 +22,8 @@ require "$file_path/file.inc";
/* create temp file, link and directory */
-mkdir("$file_path/lstat_stat_variation19/"); // temp dir
+@rmdir("$file_path/lstat_stat_variation19"); // ensure that dir doesn't exists
+mkdir("$file_path/lstat_stat_variation19"); // temp dir
$fp = fopen("$file_path/lstat_stat_variation19.tmp", "w"); // temp file
fclose($fp);
diff --git a/ext/standard/tests/file/lstat_stat_variation2.phpt b/ext/standard/tests/file/lstat_stat_variation2.phpt
index bc1304f341..c845bb478a 100755
--- a/ext/standard/tests/file/lstat_stat_variation2.phpt
+++ b/ext/standard/tests/file/lstat_stat_variation2.phpt
@@ -21,12 +21,13 @@ $file_path = dirname(__FILE__);
require("file.inc");
/* create temp directory */
-mkdir("$file_path/lstat_stat_variation1/"); // temp dir
+@rmdir("$file_path/lstat_stat_variation2/"); //ensure that dir doesn't exists
+mkdir("$file_path/lstat_stat_variation2/"); // temp dir
// renaming a directory and check stat
echo "*** Testing stat() for directory after being renamed ***\n";
-$old_dirname = "$file_path/lstat_stat_variation1";
-$new_dirname = "$file_path/lstat_stat_variation1a";
+$old_dirname = "$file_path/lstat_stat_variation2";
+$new_dirname = "$file_path/lstat_stat_variation2a";
$old_stat = stat($old_dirname);
clearstatcache();
var_dump( rename($old_dirname, $new_dirname) );
@@ -47,7 +48,7 @@ echo "\n--- Done ---";
--CLEAN--
<?php
$file_path = dirname(__FILE__);
-rmdir("$file_path/lstat_stat_variation1a");
+rmdir("$file_path/lstat_stat_variation2a");
?>
--EXPECTF--
*** Testing stat() for directory after being renamed ***
diff --git a/ext/standard/tests/file/lstat_stat_variation21.phpt b/ext/standard/tests/file/lstat_stat_variation21.phpt
index 146509bd6f..1009c92c5a 100644
--- a/ext/standard/tests/file/lstat_stat_variation21.phpt
+++ b/ext/standard/tests/file/lstat_stat_variation21.phpt
@@ -54,7 +54,6 @@ echo "\n--- Done ---";
$file_path = dirname(__FILE__);
unlink("$file_path/lstat_stat_variation21.tmp");
?>
-
--EXPECTF--
*** Testing stat() on file by truncating it to given size ***
bool(true)
diff --git a/ext/standard/tests/file/lstat_stat_variation5.phpt b/ext/standard/tests/file/lstat_stat_variation5.phpt
index b8f4478c83..895e606b9a 100755
--- a/ext/standard/tests/file/lstat_stat_variation5.phpt
+++ b/ext/standard/tests/file/lstat_stat_variation5.phpt
@@ -25,6 +25,7 @@ require "$file_path/file.inc";
/* create temp directory */
$dir_name = "$file_path/lstat_stat_variation5";
+@rmdir($dir_name); //ensure that dir doesn't exists
mkdir($dir_name); // temp dir
// touch a directory and check stat, there should be difference in atime
diff --git a/ext/standard/tests/file/lstat_stat_variation6.phpt b/ext/standard/tests/file/lstat_stat_variation6.phpt
index aff6fdc709..b7913e0b34 100755
--- a/ext/standard/tests/file/lstat_stat_variation6.phpt
+++ b/ext/standard/tests/file/lstat_stat_variation6.phpt
@@ -12,7 +12,7 @@ foreach( $mount_output as $out ) {
if( stristr($out, "noatime") )
die('skip.. atime update is disabled, hence skip the test');
}
-
+
?>
--FILE--
<?php
diff --git a/ext/standard/tests/file/lstat_stat_variation7.phpt b/ext/standard/tests/file/lstat_stat_variation7.phpt
index 0f788959bc..f950c8fe6b 100644
--- a/ext/standard/tests/file/lstat_stat_variation7.phpt
+++ b/ext/standard/tests/file/lstat_stat_variation7.phpt
@@ -29,7 +29,7 @@ echo "*** Testing stat() on file after data is written in it ***\n";
$fh = fopen($file_name,"w");
$old_stat = stat($file_name);
clearstatcache();
-fwrite($fh, "Hello World");
+fwrite($fh, (binary)"Hello World");
$new_stat = stat($file_name);
// compare self stats
diff --git a/ext/standard/tests/file/lstat_stat_variation8.phpt b/ext/standard/tests/file/lstat_stat_variation8.phpt
index bd029a3ab3..412c3bf038 100644
--- a/ext/standard/tests/file/lstat_stat_variation8.phpt
+++ b/ext/standard/tests/file/lstat_stat_variation8.phpt
@@ -18,11 +18,10 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
$file_path = dirname(__FILE__);
require "$file_path/file.inc";
-/* test the effects on stats dir by creating file/subdir in a dir
+/* test the effects on stats with creating file/subdir in a dir
*/
/* create temp file */
-@rmdir("$file_path/lstat_stat_variation8/"); //ensure that dir doesn't exists
mkdir("$file_path/lstat_stat_variation8/"); // temp dir
// creating and deleting subdir and files in the dir
@@ -31,7 +30,6 @@ $dirname = "$file_path/lstat_stat_variation8";
$old_stat = stat($dirname);
clearstatcache();
sleep(2);
-@rmdir("$dirname/lstat_stat_variation8_subdir"); // ensure that dir doesn't exists
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/lstat_stat_variation9.phpt b/ext/standard/tests/file/lstat_stat_variation9.phpt
index 90fcb1eb72..b3c1281e61 100644
--- a/ext/standard/tests/file/lstat_stat_variation9.phpt
+++ b/ext/standard/tests/file/lstat_stat_variation9.phpt
@@ -18,19 +18,18 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
$file_path = dirname(__FILE__);
require "$file_path/file.inc";
-/* test the effects on stats of dir by deleting file/subdir from a dir
+/* test the effects on stats by deleting file/subdir from a dir
*/
echo "*** Testing stat() for comparing stats after the deletion of subdir and file ***\n";
/* first create the dir/subdir and files, record the stat */
-// ensure that dir doesn't exists
-@rmdir("$file_path/lstat_stat_variation9"); //delete if exists
-mkdir("$file_path/lstat_stat_variation9"); // temp dir
+@rmdir("$file_path/lstat_stat_variation9/"); // ensure that dir doesn't exists
+mkdir("$file_path/lstat_stat_variation9/"); // temp dir
// creating and deleting subdir and files in the dir
$dirname = "$file_path/lstat_stat_variation9";
-@rmdir("$dirname/lstat_stat_variation9_subdir"); // delete if exists
+@rmdir("$dirname/lstat_stat_variation9_subdir"); // ensure that dir doesn't exists
mkdir("$dirname/lstat_stat_variation9_subdir");
$file_handle = fopen("$dirname/lstat_stat_variation9a.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 3742b37cf6..17f908c3f6 100644
--- a/ext/standard/tests/file/mkdir_rmdir_error.phpt
+++ b/ext/standard/tests/file/mkdir_rmdir_error.phpt
@@ -56,35 +56,3 @@ bool(false)
Warning: rmdir(temp): No such file or directory in %s on line %d
bool(false)
Done
---UEXPECTF--
-*** 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
-bool(false)
-Done
diff --git a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt
index d09fa58711..54977b1b47 100644
--- a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt
+++ b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt
@@ -70,8 +70,6 @@ bool(true)
*** Testing mkdir() with miscelleneous input ***
bool(true)
-
-Warning: mkdir(): Permission denied in %s on line %d
bool(false)
bool(true)
Done
diff --git a/ext/standard/tests/file/popen_pclose_basic-win32.phpt b/ext/standard/tests/file/popen_pclose_basic-win32.phpt
index 816014fd91..8c2ba4252d 100644
--- a/ext/standard/tests/file/popen_pclose_basic-win32.phpt
+++ b/ext/standard/tests/file/popen_pclose_basic-win32.phpt
@@ -31,8 +31,8 @@ $arr = array("ggg", "ddd", "aaa", "sss");
$file_handle = popen("sort", "w");
$newline = "\n";
foreach($arr as $str) {
- fwrite($file_handle, $str);
- fwrite($file_handle, $newline);
+ fwrite($file_handle, (binary)$str);
+ fwrite($file_handle, (binary)(binary)(binary)(binary)(binary)(binary)(binary)(binary)(binary)$newline);
}
pclose($file_handle);
diff --git a/ext/standard/tests/file/popen_pclose_basic.phpt b/ext/standard/tests/file/popen_pclose_basic.phpt
index bb6cbd213f..9812193c66 100644
--- a/ext/standard/tests/file/popen_pclose_basic.phpt
+++ b/ext/standard/tests/file/popen_pclose_basic.phpt
@@ -47,8 +47,8 @@ $file_handle = popen("sort", "w");
$counter = 0;
$newline = "\n";
foreach($arr as $str) {
- fwrite($file_handle, $str);
- fwrite($file_handle, $newline);
+ fwrite($file_handle, (binary)$str);
+ fwrite($file_handle, (binary)$newline);
}
pclose($file_handle);
@@ -101,32 +101,3 @@ Test String
bool(true)
--- Done ---
---UEXPECTF--
-*** Testing popen() and pclose() with different processes ***
--- Testing popen(): reading from the pipe --
-popen_basic.tmp
--- Testing popen(): reading from a file using 'cat' command --
-line
-line of text
-line
-line of text
-line
-line of text
-line
-line of text
-line
-line of text
-line
-line
-int(100)
-*** Testing popen(): writing to the pipe ***
-aaa
-ddd
-ggg
-sss
-*** Testing for return type of popen() and pclose() functions ***
-bool(true)
-Test String
-bool(true)
-
---- Done ---
diff --git a/ext/standard/tests/file/popen_pclose_error-sunos.phpt b/ext/standard/tests/file/popen_pclose_error-sunos.phpt
index d2de737cff..4c85c9e494 100644
--- a/ext/standard/tests/file/popen_pclose_error-sunos.phpt
+++ b/ext/standard/tests/file/popen_pclose_error-sunos.phpt
@@ -2,8 +2,8 @@
Test popen() and pclose function: error conditions
--SKIPIF--
<?php
-if( substr(PHP_OS, 0, 3) != 'Sun')
- die("skip Only valid for Sun Solaris");
+if(substr(PHP_OS, 0, 3) != 'Sun' )
+ die("skip Only Valid for Sun Solaris");
?>
--FILE--
@@ -35,10 +35,10 @@ unlink($file_path."/popen.tmp");
--EXPECTF--
*** Testing for error conditions ***
-Warning: Wrong parameter count for popen() in %s on line %d
+Warning: popen() expects exactly 2 parameters, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for popen() in %s on line %d
+Warning: popen() expects exactly 2 parameters, 1 given in %s on line %d
NULL
resource(%d) of type (stream)
sh: abc.txt: not found
diff --git a/ext/standard/tests/file/popen_pclose_error-win32.phpt b/ext/standard/tests/file/popen_pclose_error-win32.phpt
index ea160cf166..9b6944581c 100644
--- a/ext/standard/tests/file/popen_pclose_error-win32.phpt
+++ b/ext/standard/tests/file/popen_pclose_error-win32.phpt
@@ -36,10 +36,10 @@ unlink($file_path."/popen.tmp");
--EXPECTF--
*** Testing for error conditions ***
-Warning: Wrong parameter count for popen() in %s on line %d
+Warning: popen() expects exactly 2 parameters, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for popen() in %s on line %d
+Warning: popen() expects exactly 2 parameters, 1 given in %s on line %d
NULL
resource(%d) of type (stream)
'abc.txt' is not recognized as an internal or external command,
diff --git a/ext/standard/tests/file/popen_pclose_error.phpt b/ext/standard/tests/file/popen_pclose_error.phpt
index 3680c091ef..0d33184905 100644
--- a/ext/standard/tests/file/popen_pclose_error.phpt
+++ b/ext/standard/tests/file/popen_pclose_error.phpt
@@ -5,6 +5,7 @@ Test popen() and pclose function: error conditions
if(substr(PHP_OS, 0, 3) == 'WIN' || strtoupper( substr(PHP_OS, 0, 3) ) == 'SUN')
die("skip Not Valid for Windows & Sun Solaris");
?>
+
--FILE--
<?php
/*
@@ -34,10 +35,10 @@ unlink($file_path."/popen.tmp");
--EXPECTF--
*** Testing for error conditions ***
-Warning: Wrong parameter count for popen() in %s on line %d
+Warning: popen() expects exactly 2 parameters, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for popen() in %s on line %d
+Warning: popen() expects exactly 2 parameters, 1 given in %s on line %d
NULL
Warning: popen(abc.txt,rw): %s on line %d
diff --git a/ext/standard/tests/file/readfile_basic-win32.phpt b/ext/standard/tests/file/readfile_basic-win32.phpt
index 1c164bc7cc..05e18a2099 100644
--- a/ext/standard/tests/file/readfile_basic-win32.phpt
+++ b/ext/standard/tests/file/readfile_basic-win32.phpt
@@ -527,4 +527,4 @@ line of text
line
line
int(111)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/readfile_basic.phpt b/ext/standard/tests/file/readfile_basic.phpt
index 13de95da36..e67fd58545 100644
--- a/ext/standard/tests/file/readfile_basic.phpt
+++ b/ext/standard/tests/file/readfile_basic.phpt
@@ -527,4 +527,4 @@ line of text
line
line
int(100)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/readfile_variation2.phpt b/ext/standard/tests/file/readfile_variation2.phpt
index 3356b9e749..0c43bf5661 100644
--- a/ext/standard/tests/file/readfile_variation2.phpt
+++ b/ext/standard/tests/file/readfile_variation2.phpt
@@ -84,4 +84,4 @@ line of text
line
line of t
int(50)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/readfile_variation3.phpt b/ext/standard/tests/file/readfile_variation3.phpt
index 152e8609f8..854642a36d 100644
--- a/ext/standard/tests/file/readfile_variation3.phpt
+++ b/ext/standard/tests/file/readfile_variation3.phpt
@@ -60,4 +60,4 @@ line of text
line
line of t
int(50)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/realpath_basic-win32.phpt b/ext/standard/tests/file/realpath_basic-win32.phpt
index fb3a01d869..429fd6f2aa 100644
--- a/ext/standard/tests/file/realpath_basic-win32.phpt
+++ b/ext/standard/tests/file/realpath_basic-win32.phpt
@@ -33,12 +33,12 @@ $filenames = array (
"$file_path/realpath_basic//home/test//../test/./realpath_basic.tmp",
"$file_path/realpath_basic/home//../././realpath_basic.tmp//",
- /* filenames with invalid path */
- // checking for binary safe
- "$file_path/realpath_basicx000/home/realpath_basic.tmp",
+ // checking for binary safe
+ b"$file_path/realpath_basic/home/realpath_basic.tmp",
+ /* filenames with invalid path */
"$file_path///realpath_basic/home//..//././test//realpath_basic.tmp",
- "$file_path/realpath_basic/home/../home/../test/..realpath_basic.tmp"
+ "$file_path/realpath_basic/home/../home/../test/../..realpath_basic.tmp"
);
$counter = 1;
@@ -79,7 +79,7 @@ string(%d) "%s\realpath_basic\home\test\realpath_basic.tmp"
string(%d) "%s\realpath_basic\realpath_basic.tmp"
-- Iteration 5 --
-bool(false)
+string(%d) "%s\realpath_basic\home\realpath_basic.tmp"
-- Iteration 6 --
bool(false)
diff --git a/ext/standard/tests/file/realpath_error-win32.phpt b/ext/standard/tests/file/realpath_error-win32.phpt
index d4beff85ab..2fd221e45a 100644
--- a/ext/standard/tests/file/realpath_error-win32.phpt
+++ b/ext/standard/tests/file/realpath_error-win32.phpt
@@ -21,9 +21,9 @@ echo "Done\n";
--EXPECTF--
*** Testing realpath() for error conditions ***
-Warning: Wrong parameter count for realpath() in %s on line %d
+Warning: realpath() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for realpath() in %s on line %d
+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.phpt b/ext/standard/tests/file/realpath_variation-win32.phpt
index 5604bb65dd..59db125fb9 100644
--- a/ext/standard/tests/file/realpath_variation-win32.phpt
+++ b/ext/standard/tests/file/realpath_variation-win32.phpt
@@ -5,7 +5,7 @@ Test realpath() function: usage variation
if (substr(PHP_OS, 0, 3) != 'WIN') {
die('skip only on Windows');
}
-?>/
+?>
--FILE--
<?php
/* Prototype: string realpath ( string $path );
diff --git a/ext/standard/tests/file/rename_variation-win32.phpt b/ext/standard/tests/file/rename_variation-win32.phpt
index 3cac5ccadd..7f1484dcec 100644
--- a/ext/standard/tests/file/rename_variation-win32.phpt
+++ b/ext/standard/tests/file/rename_variation-win32.phpt
@@ -16,43 +16,36 @@ require dirname(__FILE__).'/file.inc';
/* creating directory */
$file_path = dirname(__FILE__);
-mkdir("$file_path/rename_variation");
+mkdir("$file_path/rename_variation/");
-/* rename files across directories */
-echo "*** Testing rename() : rename files across directories ***\n";
-$src_filenames = array(
+/* Testing rename() function on files */
+echo "*** Testing variations of rename() on files ***\n";
+$files_arr = array(
"$file_path/rename_variation/rename_variation.tmp",
- /* Testing a file trailing slash */
- "$file_path/rename_variation/rename_variation.tmp/",
-
/* Testing file with double slashes */
"$file_path/rename_variation//rename_variation.tmp",
- "$file_path//rename_variation//rename_variation.tmp",
+ "$file_path/rename_variation/r*.tmp",
+
+ /* Testing Binary safe */
+ "$file_path/rename_variation/rename_variationx000.tmp"
);
$counter = 1;
/* loop through each $file and rename it to rename_variation2.tmp */
-foreach($src_filenames as $src_filename) {
- echo "-- Iteration $counter --\n";
+foreach($files_arr as $file) {
$fp = fopen("$file_path/rename_variation/rename_variation.tmp", "w");
fclose($fp);
- $dest_filename = "$file_path/rename_variation2.tmp";
- var_dump( rename($src_filename, $dest_filename) );
- // ensure that file got renamed to new name
- var_dump( file_exists($src_filename) ); // expecting false
- var_dump( file_exists($dest_filename) ); // expecting true
+ echo "-- Iteration $counter --\n";
+ var_dump( rename($file, "$file_path/rename_variation2.tmp") );
$counter++;
-
- // unlink the file
- unlink($dest_filename);
+ unlink("$file_path/rename_variation2.tmp");
}
+unlink("$file_path/rename_variation/rename_variation.tmp");
+rmdir("$file_path/rename_variation/"); // deleting temp directory
-// clean the temp dir and file
-rmdir("$file_path/rename_variation");
-
-// rename dirs across directories
-echo "\n*** Testing rename() : renaming directory across directories ***\n";
-$src_dirs = array (
+/* Testing rename() function on directories */
+echo "\n*** Testing variations of rename() on directories ***\n";
+$directories = array (
/* Testing simple directory tree */
"$file_path/rename_variation/",
@@ -60,140 +53,163 @@ $src_dirs = array (
"$file_path/rename_variation/",
/* Testing dir with double trailing slashes */
- "$file_path//rename_variation//",
-);
+ "$file_path/rename_variation//",
-$dest_dir = "$file_path/rename_variation_dir";
-// create the $dest_dir
-mkdir($dest_dir);
+ /* Testing Binary safe */
+ "$file_path/rename_variationx000/",
-$counter = 1;
-/* loop through each $src_dirs and rename it to $dest_dir */
-foreach($src_dirs as $src_dir) {
- echo "-- Iteration $counter --\n";
+ /* Testing current directory */
+ ".",
+
+ /* Dir name as empty string */
+ "",
+ '',
- // create the src dir
+ /* Dir name as string with a space */
+ " ",
+ ' '
+);
+$counter = 1;
+/* loop through each $dir and rename it to rename_variation1 */
+foreach($directories as $dir) {
mkdir("$file_path/rename_variation/");
- // rename the src dir to a new dir in dest dir
- var_dump( rename($src_dir, $dest_dir."/new_dir") );
- // ensure that dir was renamed
- var_dump( file_exists($src_dir) ); // expecting false
- var_dump( file_exists($dest_dir."/new_dir") ); // expecting true
-
- // remove the new dir
- rmdir($dest_dir."/new_dir");
+ echo "-- Iteration $counter --\n";
+ var_dump( rename($dir, "$file_path/rename_variation1/") );
$counter++;
+ rmdir("$file_path/rename_variation1/");
}
+/* Testing rename() on non-existing file and directory as first argument */
+echo "\n*** Testing rename() with non-existing file and directory ***\n";
+// renaming a non-existing file to existing file
+var_dump( rename(dirname(__FILE__)."/rename_variation123.tmp", __FILE__) );
+// renaming a non-existing directory to existing directory
+var_dump( rename(dirname(__FILE__)."/rename_variation123/", dirname(__FILE__)) );
+
/* Renaming a file and directory to numeric name */
echo "\n*** Testing rename() by renaming a file and directory to numeric name ***\n";
-$fp = fopen($file_path."/rename_variation.tmp", "w");
+$fp = fopen(dirname(__FILE__)."/rename_variation.tmp", "w");
fclose($fp);
// renaming existing file to numeric name
-var_dump( rename($file_path."/rename_variation.tmp", $file_path."/12345") );
-// ensure that rename worked fine
-var_dump( file_exists($file_path."/rename_variation.tmp" ) ); // expecting false
-var_dump( file_exists($file_path."/12345" ) ); // expecting true
-// remove the file
-unlink($file_path."/12345");
-
-// renaming a directory to numeric name
-var_dump( rename($file_path."/rename_variation_dir/", $file_path."/12345") );
-// ensure that rename worked fine
-var_dump( file_exists($file_path."/rename_variation_dir" ) ); // expecting false
-var_dump( file_exists($file_path."/12345" ) ); // expecting true
-
-// delete the file and dir
-rmdir($file_path."/12345");
-
-/* test rename() by trying to rename an existing file/dir to the same name
- and one another */
-// create a dir
+var_dump( rename(dirname(__FILE__)."/rename_variation.tmp", dirname(__FILE__)."/12345.tmp") );
+unlink(dirname(__FILE__)."/12345.tmp");
+// renaming existing directory to numeric name
+var_dump( rename(dirname(__FILE__)."/rename_variation/", dirname(__FILE__)."/12345/") );
+
+echo "\n*** Testing rename() with miscelleneous input ***\n";
$file_path = dirname(__FILE__);
-$dirname = "$file_path/rename_variation_dir";
-mkdir($dirname);
-//create a file
-$filename = "$file_path/rename_variation.tmp";
-$fp = fopen($filename, "w");
+mkdir("$file_path/rename_variation");
+$fp = fopen("$file_path/rename_variation.tmp", "w");
fclose($fp);
echo "\n-- Renaming file to same file name --\n";
-var_dump( rename($filename, $filename) );
+var_dump( rename("$file_path/rename_variation.tmp", "$file_path/rename_variation.tmp") );
echo "\n-- Renaming directory to same directory name --\n";
-var_dump( rename($dirname, $dirname) );
+var_dump( rename("$file_path/rename_variation/", "$file_path/rename_variation/") );
-echo "\n-- Renaming existing file to existing directory name --\n";
-var_dump( rename($filename, $dirname) );
+echo "\n-- Renaming existing file to directory name --\n";
+var_dump( rename("$file_path/rename_variation.tmp", "$file_path/rename_variation/") );
-echo "\n-- Renaming existing directory to existing file name --\n";
-$fp = fopen($filename, "w");
-fclose($fp);
-var_dump( rename($dirname, $filename) );
+echo "\n-- Renaming existing directory to file name --\n";
+var_dump( rename("$file_path/rename_variation", "$file_path/rename_variation.tmp") );
echo "Done\n";
?>
--CLEAN--
<?php
-$file_path = dirname(__FILE__);
-unlink($file_path."/rename_variation_link.tmp");
-unlink($file_path."/rename_variation.tmp");
-rmdir($file_path."/rename_variation_dir");
+unlink(dirname(__FILE__)."/12345.tmp");
+unlink(dirname(__FILE__)."/rename_variation.tmp");
+rmdir(dirname(__FILE__)."/rename_variation.tmp/");
+rmdir(dirname(__FILE__)."/rename_variation/");
+rmdir(dirname(__FILE__)."/12345/");
?>
--EXPECTF--
-*** Testing rename() : rename files across directories ***
+*** Testing variations of rename() on files ***
-- Iteration 1 --
bool(true)
-bool(false)
-bool(true)
-- Iteration 2 --
bool(true)
-bool(false)
-bool(true)
-- Iteration 3 --
bool(true)
-bool(false)
-bool(true)
-- Iteration 4 --
-bool(true)
+
+Warning: rename(%s,%s): No such file or directory in %s on line %d
bool(false)
-bool(true)
-*** Testing rename() : renaming directory across directories ***
+Warning: unlink(%s): No such file or directory in %s on line %d
+
+*** Testing variations of rename() on directories ***
-- Iteration 1 --
bool(true)
-bool(false)
-bool(true)
-- Iteration 2 --
bool(true)
-bool(false)
-bool(true)
-- Iteration 3 --
bool(true)
+-- Iteration 4 --
+
+Warning: rename(%s,%s): No such file or directory in %s on line %d
bool(false)
-bool(true)
-*** Testing rename() by renaming a file and directory to numeric name ***
-bool(true)
+Warning: rmdir(%s): No such file or directory in %s on line %d
+-- Iteration 5 --
+
+Warning: rename(.,%s): Permission denied in %s on line %d
bool(false)
-bool(true)
-bool(true)
+
+Warning: rmdir(%s): No such file or directory in %s on line %d
+-- Iteration 6 --
+
+Warning: rename(,%s): Permission denied in %s on line %d
+bool(false)
+
+Warning: rmdir(%s): No such file or directory in %s on line %d
+-- Iteration 7 --
+
+Warning: rename(,%s): Permission denied in %s on line %d
+bool(false)
+
+Warning: rmdir(%s): No such file or directory in %s on line %d
+-- Iteration 8 --
+
+Warning: rename( ,%s): File exists in %s on line %d
+bool(false)
+
+Warning: rmdir(%s): No such file or directory in %s on line %d
+-- Iteration 9 --
+
+Warning: rename( ,%s): File exists in %s on line %d
bool(false)
+
+Warning: rmdir(%s): No such file or directory in %s on line %d
+
+*** Testing rename() with non-existing file and directory ***
+
+Warning: rename(%s,%s): No such file or directory in %s on line %d
+bool(false)
+
+Warning: rename(%s,%s): No such file or directory in %s on line %d
+bool(false)
+
+*** Testing rename() by renaming a file and directory to numeric name ***
+bool(true)
bool(true)
+*** Testing rename() with miscelleneous input ***
+
-- Renaming file to same file name --
bool(true)
-- Renaming directory to same directory name --
bool(true)
--- Renaming existing file to existing directory name --
+-- Renaming existing file to directory name --
Warning: rename(%s,%s): File exists in %s on line %d
bool(false)
--- Renaming existing directory to existing file name --
+-- Renaming existing directory to file name --
Warning: rename(%s,%s): File exists in %s on line %d
bool(false)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/stat_basic-win32.phpt b/ext/standard/tests/file/stat_basic-win32.phpt
index 9f2e5cc256..6c467d7619 100644
--- a/ext/standard/tests/file/stat_basic-win32.phpt
+++ b/ext/standard/tests/file/stat_basic-win32.phpt
@@ -3,7 +3,7 @@ Test stat() function: basic functionality
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) != 'WIN') {
- die('skip.. stat() only for windows');
+ die('skip.. valid only for Windows');
}
?>
--FILE--
@@ -189,3 +189,4 @@ bool(true)
bool(true)
---Done---
+
diff --git a/ext/standard/tests/file/stat_error-win32.phpt b/ext/standard/tests/file/stat_error-win32.phpt
index fcbac5ff0b..c15ef58dd8 100644
--- a/ext/standard/tests/file/stat_error-win32.phpt
+++ b/ext/standard/tests/file/stat_error-win32.phpt
@@ -31,13 +31,13 @@ echo "Done\n";
--EXPECTF--
*** Testing stat() for error conditions ***
-Warning: Wrong parameter count for stat() in %s on line %d
+Warning: stat() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for stat() in %s on line %d
+Warning: stat() expects exactly 1 parameter, 2 given in %s on line %d
NULL
-Warning: Wrong parameter count for stat() in %s on line %d
+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
@@ -49,8 +49,7 @@ bool(false)
Warning: stat(): stat failed for 22 in %s on line %d
bool(false)
-Notice: Array to string conversion in %s on line %d
-
-Warning: stat(): stat failed for Array in %s on line %d
-bool(false)
+Warning: stat() expects parameter 1 to be string, array given in %s on line %d
+NULL
Done
+
diff --git a/ext/standard/tests/file/stat_variation1-win32.phpt b/ext/standard/tests/file/stat_variation1-win32.phpt
index f8a8e95c5e..abbc88f945 100644
--- a/ext/standard/tests/file/stat_variation1-win32.phpt
+++ b/ext/standard/tests/file/stat_variation1-win32.phpt
@@ -91,3 +91,4 @@ bool(true)
bool(true)
*** Done ***
+
diff --git a/ext/standard/tests/file/stat_variation2-win32.phpt b/ext/standard/tests/file/stat_variation2-win32.phpt
index 021596f4db..2bd9f80c50 100644
--- a/ext/standard/tests/file/stat_variation2-win32.phpt
+++ b/ext/standard/tests/file/stat_variation2-win32.phpt
@@ -62,3 +62,4 @@ bool(true)
bool(true)
*** Done ***
+
diff --git a/ext/standard/tests/file/stat_variation3-win32.phpt b/ext/standard/tests/file/stat_variation3-win32.phpt
index 4269aa49a3..e248116486 100644
--- a/ext/standard/tests/file/stat_variation3-win32.phpt
+++ b/ext/standard/tests/file/stat_variation3-win32.phpt
@@ -57,7 +57,7 @@ var_dump( compare_self_stat($new_stat1) );
var_dump(compare_stats($new_stat, $new_stat1, $all_stat_keys, "="));
clearstatcache();
-echo "Done\n";
+echo "\n*** Done ***";
?>
--CLEAN--
@@ -75,4 +75,6 @@ bool(true)
-- Testing stat() for comparing stats after the deletion of subdir and file --
bool(true)
bool(true)
-Done \ No newline at end of file
+
+*** Done ***
+
diff --git a/ext/standard/tests/file/stat_variation4-win32.phpt b/ext/standard/tests/file/stat_variation4-win32.phpt
index 55916852ac..a0ffed285f 100644
--- a/ext/standard/tests/file/stat_variation4-win32.phpt
+++ b/ext/standard/tests/file/stat_variation4-win32.phpt
@@ -66,7 +66,7 @@ var_dump( compare_stats($old_stat, $new_stat, $all_stat_keys, "=") );
// clear the stat
clearstatcache();
-echo "Done\n";
+echo "\n*** Done ***";
?>
--CLEAN--
@@ -88,4 +88,6 @@ bool(true)
bool(true)
bool(true)
bool(true)
-Done
+
+*** Done ***
+
diff --git a/ext/standard/tests/file/stat_variation5-win32.phpt b/ext/standard/tests/file/stat_variation5-win32.phpt
index 8de45b6331..038b9b64eb 100644
--- a/ext/standard/tests/file/stat_variation5-win32.phpt
+++ b/ext/standard/tests/file/stat_variation5-win32.phpt
@@ -47,7 +47,7 @@ var_dump( compare_stats($old_stat, $new_stat, $affected_members, "=") );
clearstatcache();
-echo "Done\n";
+echo "\n*** Done ***";
?>
--CLEAN--
@@ -61,4 +61,6 @@ unlink("$file_path/stat_variation5.tmp");
bool(true)
bool(true)
bool(true)
-Done
+
+*** Done ***
+
diff --git a/ext/standard/tests/file/stat_variation6-win32.phpt b/ext/standard/tests/file/stat_variation6-win32.phpt
index 18b87f7af6..3dae75b2e6 100644
--- a/ext/standard/tests/file/stat_variation6-win32.phpt
+++ b/ext/standard/tests/file/stat_variation6-win32.phpt
@@ -65,7 +65,7 @@ var_dump( compare_stats($old_stat, $new_stat, $affected_members, "=") );
clearstatcache(); // clear statement cache
-echo "Done\n";
+echo "\n*** Done ***";
?>
--CLEAN--
@@ -87,4 +87,6 @@ bool(true)
bool(true)
bool(true)
bool(true)
-Done
+
+*** Done ***
+
diff --git a/ext/standard/tests/file/stat_variation7-win32.phpt b/ext/standard/tests/file/stat_variation7-win32.phpt
index a96a72ba5b..d72305fa84 100644
--- a/ext/standard/tests/file/stat_variation7-win32.phpt
+++ b/ext/standard/tests/file/stat_variation7-win32.phpt
@@ -295,3 +295,4 @@ array(26) {
}
*** Done ***
+
diff --git a/ext/standard/tests/file/stat_variation8-win32.phpt b/ext/standard/tests/file/stat_variation8-win32.phpt
index e682f2dab6..5c11afd02d 100644
--- a/ext/standard/tests/file/stat_variation8-win32.phpt
+++ b/ext/standard/tests/file/stat_variation8-win32.phpt
@@ -58,7 +58,7 @@ var_dump( compare_stats($old_stat, $new_stat, $affected_members, '!=') );
// clear the stat
clearstatcache(); // clear previous size value in cache
-echo "Done\n";
+echo "\n*** Done ***";
?>
--CLEAN--
@@ -72,4 +72,6 @@ bool(true)
bool(true)
bool(true)
bool(true)
-Done
+
+*** Done ***
+
diff --git a/ext/standard/tests/file/stream_get_line.phpt b/ext/standard/tests/file/stream_get_line.phpt
index 2c11f00eed..89798ef95e 100644
--- a/ext/standard/tests/file/stream_get_line.phpt
+++ b/ext/standard/tests/file/stream_get_line.phpt
@@ -4,7 +4,7 @@ Crash inside stream_get_line(), when length=0
<?php
$path = dirname(__FILE__) . '/test.html';
-file_put_contents($path, "foo<br>bar<br>foo");
+file_put_contents($path, b"foo<br>bar<br>foo");
$fp = fopen($path, "r");
while ($fp && !feof($fp)) {
echo stream_get_line($fp, 0, "<br>")."\n";
diff --git a/ext/standard/tests/file/stream_rfc2397_001.phpt b/ext/standard/tests/file/stream_rfc2397_001.phpt
index 23a5730923..774bb089bc 100755
--- a/ext/standard/tests/file/stream_rfc2397_001.phpt
+++ b/ext/standard/tests/file/stream_rfc2397_001.phpt
@@ -1,5 +1,5 @@
--TEST--
-Stream: RFC2397
+Stream: RFC2397 getting the data
--FILE--
<?php
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 b2ba0c889f..b8b233ab60 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
@@ -95,10 +95,10 @@ bool(false)
*** Testing is_link() for error conditions ***
-Warning: Wrong parameter count for is_link() in %s on line %d
+Warning: is_link() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for is_link() in %s on line %d
+Warning: is_link() expects exactly 1 parameter, 2 given in %s on line %d
NULL
bool(false)
bool(false)
diff --git a/ext/standard/tests/file/tempnam_error.phpt b/ext/standard/tests/file/tempnam_error.phpt
index 65ea3c7466..91ca6a308e 100644
--- a/ext/standard/tests/file/tempnam_error.phpt
+++ b/ext/standard/tests/file/tempnam_error.phpt
@@ -20,27 +20,29 @@ var_dump( tempnam("") ); //Empty string
var_dump( tempnam(NULL) ); //NULL as arg
var_dump( tempnam() ); //Zero args
+echo "*** Done ***\n";
?>
--EXPECTF--
*** Testing tempnam() error conditions ***
-Warning: Wrong parameter count for tempnam() in %s on line %d
+Warning: tempnam() expects exactly 2 parameters, 3 given in %s on line %d
NULL
-Warning: Wrong parameter count for tempnam() in %s on line %d
+Warning: tempnam() expects exactly 2 parameters, 3 given in %s on line %d
NULL
-Warning: Wrong parameter count for tempnam() in %s on line %d
+Warning: tempnam() expects exactly 2 parameters, 1 given in %s on line %d
NULL
-Warning: Wrong parameter count for tempnam() in %s on line %d
+Warning: tempnam() expects exactly 2 parameters, 1 given in %s on line %d
NULL
-Warning: Wrong parameter count for tempnam() in %s on line %d
+Warning: tempnam() expects exactly 2 parameters, 1 given in %s on line %d
NULL
-Warning: Wrong parameter count for tempnam() in %s on line %d
+Warning: tempnam() expects exactly 2 parameters, 1 given in %s on line %d
NULL
-Warning: Wrong parameter count for tempnam() in %s on line %d
+Warning: tempnam() expects exactly 2 parameters, 0 given in %s on line %d
NULL
+*** Done ***
diff --git a/ext/standard/tests/file/tempnam_variation3.phpt b/ext/standard/tests/file/tempnam_variation3.phpt
index 08748bdc5a..aed0a066d3 100644
--- a/ext/standard/tests/file/tempnam_variation3.phpt
+++ b/ext/standard/tests/file/tempnam_variation3.phpt
@@ -78,9 +78,10 @@ File name is => %s
File permissions are => 100600
-- Iteration 7 --
-Notice: Array to string conversion in %s on line %d
-File name is => %s
-File permissions are => 100600
+Warning: tempnam() expects parameter 2 to be string, array given in %s on line %d
+-- File is not created --
+
+Warning: unlink(): No such file or directory in %s on line %d
-- Iteration 8 --
File name is => %s
File permissions are => 100600
diff --git a/ext/standard/tests/file/tempnam_variation7.phpt b/ext/standard/tests/file/tempnam_variation7.phpt
index b4b0035c9c..ebecd1601f 100644
--- a/ext/standard/tests/file/tempnam_variation7.phpt
+++ b/ext/standard/tests/file/tempnam_variation7.phpt
@@ -3,7 +3,7 @@ Test tempnam() function: usage variations - invalid/non-existing dir
--SKIPIF--
<?php
if(substr(PHP_OS, 0, 3) == "WIN")
- die("skip Do not run on Windows");
+ die("skip DO not run on Windows");
?>
--FILE--
<?php
@@ -79,9 +79,10 @@ File name is => %s
File permissions are => 100600
-- Iteration 7 --
-Notice: Array to string conversion in %s on line %d
-File name is => %s
-File permissions are => 100600
+Warning: tempnam() expects parameter 1 to be string, array given in %s on line %d
+-- File is not created --
+
+Warning: unlink(): No such file or directory in %s on line %d
-- Iteration 8 --
File name is => %s
File permissions are => 100600
diff --git a/ext/standard/tests/file/touch.phpt b/ext/standard/tests/file/touch.phpt
index 504674f17d..aea68b0d44 100644
--- a/ext/standard/tests/file/touch.phpt
+++ b/ext/standard/tests/file/touch.phpt
@@ -31,7 +31,7 @@ var_dump(touch("/no/such/file/or/directory"));
echo "Done\n";
?>
--EXPECTF--
-Warning: Wrong parameter count for touch() in %s on line %d
+Warning: touch() expects at least 1 parameter, 0 given in %s on line %d
NULL
bool(true)
int(%d)
diff --git a/ext/standard/tests/file/umask_basic.phpt b/ext/standard/tests/file/umask_basic.phpt
index 8534071813..7a2eb762db 100644
--- a/ext/standard/tests/file/umask_basic.phpt
+++ b/ext/standard/tests/file/umask_basic.phpt
@@ -2076,4 +2076,4 @@ int(510)
int(510)
int(511)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/file/unlink_error-win32.phpt b/ext/standard/tests/file/unlink_error-win32.phpt
index ac167d6502..d51513978f 100644
--- a/ext/standard/tests/file/unlink_error-win32.phpt
+++ b/ext/standard/tests/file/unlink_error-win32.phpt
@@ -8,6 +8,12 @@ if (substr(PHP_OS, 0, 3) != 'WIN') {
?>
--FILE--
<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ die('skip.. only on Windows');
+}
+?>
+--FILE--
+<?php
/* Prototype : bool unlink ( string $filename [, resource $context] );
Description : Deletes filename
*/
@@ -28,7 +34,7 @@ echo "-- Testing unlink() on unexpected no. of arguments --\n";
var_dump( unlink() );
// args > expected
var_dump( unlink($filename, $context, true) );
-var_dump( file_exists($filename) );
+var_dump( file_exists($filename) ); // expected: true
echo "\n-- Testing unlink() on invalid arguments --\n";
// invalid arguments
@@ -58,7 +64,6 @@ mkdir($dirname);
var_dump( unlink($dirname) ); // expected: false as unlink() does not work on dir
echo "Done\n";
-
?>
--CLEAN--
<?php
diff --git a/ext/standard/tests/file/unlink_error.phpt b/ext/standard/tests/file/unlink_error.phpt
index 9dfe808b12..ae888bce4a 100644
--- a/ext/standard/tests/file/unlink_error.phpt
+++ b/ext/standard/tests/file/unlink_error.phpt
@@ -28,7 +28,7 @@ echo "-- Testing unlink() on unexpected no. of arguments --\n";
var_dump( unlink() );
// args > expected
var_dump( unlink($filename, $context, true) );
-var_dump( file_exists($filename) );
+var_dump( file_exists($filename) ); // expected true
echo "\n-- Testing unlink() on invalid arguments --\n";
// invalid arguments
@@ -56,12 +56,14 @@ $dirname = "$file_path/unlink_error";
mkdir($dirname);
// unlinking directory
var_dump( unlink($dirname) ); // expected: false as unlink() does not work on dir
-rmdir($dirname);
-// delete temp file
-unlink($filename);
echo "Done\n";
?>
+--CLEAN--
+<?php
+unlink(dirname(__FILE__)."/unlink_error.tmp");
+rmdir(dirname(__FILE__)."/unlink_error");
+?>
--EXPECTF--
*** Testing unlink() : error conditions ***
-- Testing unlink() on unexpected no. of arguments --
@@ -98,7 +100,7 @@ bool(false)
-- Testing unlink() on non-existent file --
-Warning: unlink(%s/non_existent_file.tmp): %s in %s on line %d
+Warning: unlink(%s/non_existent_file.tmp): No such file or directory in %s on line %d
bool(false)
-- Testing unlink() on directory --
diff --git a/ext/standard/tests/file/unlink_variation1-win32.phpt b/ext/standard/tests/file/unlink_variation1-win32.phpt
index 49dfb9e30b..b00e546d01 100644
--- a/ext/standard/tests/file/unlink_variation1-win32.phpt
+++ b/ext/standard/tests/file/unlink_variation1-win32.phpt
@@ -24,7 +24,7 @@ $dirname = "$file_path/unlink_variation1";
// temp filename used here
$filename = "$dirname/unlink_variation1-win32.tmp";
-echo "*** Testing unlink() on file inside a directory ***\n";
+echo "\n*** Testing unlink() on file inside a directory ***\n";
// create temp dir
mkdir($dirname);
// create temp file inside $dirname
diff --git a/ext/standard/tests/file/unlink_variation1.phpt b/ext/standard/tests/file/unlink_variation1.phpt
index c8a5675424..c27c13dfc4 100644
--- a/ext/standard/tests/file/unlink_variation1.phpt
+++ b/ext/standard/tests/file/unlink_variation1.phpt
@@ -34,7 +34,7 @@ $dirname = "$file_path/unlink_variation1";
// temp filename used here
$filename = "$dirname/unlink_variation1.tmp";
-echo "*** Testing unlink() on file inside a directory ***\n";
+echo "\n*** Testing unlink() on file inside a directory ***\n";
// create temp dir
mkdir($dirname);
// create temp file inside $dirname
diff --git a/ext/standard/tests/file/unlink_variation2-win32.phpt b/ext/standard/tests/file/unlink_variation2-win32.phpt
index 6a8a38a2a3..af7b381547 100644
--- a/ext/standard/tests/file/unlink_variation2-win32.phpt
+++ b/ext/standard/tests/file/unlink_variation2-win32.phpt
@@ -18,7 +18,7 @@ $file_path = dirname(__FILE__);
echo "*** Testing unlink() on a file when file handle is open ***\n";
// temp file name used here
-$filename = "$file_path/unlink_variation2.tmp";
+$filename = "$file_path/unlink_variation2-win32.tmp";
// create file
$fp = fopen($filename, "w");
diff --git a/ext/standard/tests/file/unlink_variation4.phpt b/ext/standard/tests/file/unlink_variation4.phpt
index 10bd38dd13..746cfd3249 100644
--- a/ext/standard/tests/file/unlink_variation4.phpt
+++ b/ext/standard/tests/file/unlink_variation4.phpt
@@ -6,13 +6,13 @@ Test unlink() function : usage variations - unlink deleted file
Description : Deletes filename
*/
+/* Try deleting a file which is already deleted */
+
$file_path = dirname(__FILE__);
// temp file used
$filename = "$file_path/unlink_variation4.tmp";
-/* Try deleting a file which is already deleted */
-
echo "*** Testing unlink() on deleted file ***\n";
// create temp file
$fp = fopen($filename, "w");
diff --git a/ext/standard/tests/file/userdirstream.phpt b/ext/standard/tests/file/userdirstream.phpt
index d457b1988d..a83e899b83 100644
--- a/ext/standard/tests/file/userdirstream.phpt
+++ b/ext/standard/tests/file/userdirstream.phpt
@@ -49,4 +49,3 @@ array(4) {
[3]=>
string(5) "third"
}
-
diff --git a/ext/standard/tests/file/userfilters.phpt b/ext/standard/tests/file/userfilters.phpt
index dfa8376fff..2246b5d8a4 100644
--- a/ext/standard/tests/file/userfilters.phpt
+++ b/ext/standard/tests/file/userfilters.phpt
@@ -20,7 +20,7 @@ class testfilter extends php_user_filter {
stream_filter_register('testfilter','testfilter');
-$text = "Hello There!";
+$text = b"Hello There!";
$fp = tmpfile();
fwrite($fp, $text);
diff --git a/ext/standard/tests/file/userstreams.phpt b/ext/standard/tests/file/userstreams.phpt
index 9b80508b3b..b5a9707e95 100644
--- a/ext/standard/tests/file/userstreams.phpt
+++ b/ext/standard/tests/file/userstreams.phpt
@@ -67,7 +67,7 @@ for ($i = 0; $i < 30; $i++) {
/* store the data in a regular file so that we can compare
* the results */
$tf = tmpfile();
-fwrite($tf, $DATA);
+fwrite($tf, (binary)$DATA);
$n = ftell($tf);
rewind($tf) or die("failed to rewind tmp file!");
if (ftell($tf) != 0)
diff --git a/ext/standard/tests/general_functions/phpcredits.phpt b/ext/standard/tests/general_functions/phpcredits.phpt
index cc1a308799..69515dfe6a 100644
--- a/ext/standard/tests/general_functions/phpcredits.phpt
+++ b/ext/standard/tests/general_functions/phpcredits.phpt
@@ -22,7 +22,7 @@ PHP Group
Language Design & Concept
%a
-%wPHP %d Authors%w
+%wPHP Authors%w
%a
%wSAPI Modules%w
diff --git a/ext/standard/tests/network/bug41347.phpt b/ext/standard/tests/network/bug41347.phpt
index 53d4439cb7..21fc002fa5 100644
--- a/ext/standard/tests/network/bug41347.phpt
+++ b/ext/standard/tests/network/bug41347.phpt
@@ -9,11 +9,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
--FILE--
<?php
var_dump(dns_check_record(''));
-var_dump(dns_check_record('', ''));
?>
--EXPECTF--
Warning: dns_check_record(): Host cannot be empty in %s on line %d
bool(false)
-
-Warning: dns_check_record(): Host and type cannot be empty in %s on line %d
-bool(false)
diff --git a/ext/standard/tests/strings/convert_cyr_string.phpt b/ext/standard/tests/strings/convert_cyr_string.phpt
index a6f3657312..0b4db2510a 100644
--- a/ext/standard/tests/strings/convert_cyr_string.phpt
+++ b/ext/standard/tests/strings/convert_cyr_string.phpt
@@ -9,24 +9,24 @@ var_dump(convert_cyr_string("", ""));
var_dump(convert_cyr_string("", "", ""));
var_dump(convert_cyr_string(array(), array(), array()));
-var_dump(convert_cyr_string("[[[[[[", "q", "m"));
-var_dump(convert_cyr_string("[[[[[[", "k", "w"));
-var_dump(convert_cyr_string("[[[[[[", "m", "a"));
-var_dump(convert_cyr_string("[[[[[[", "d", "i"));
-var_dump(convert_cyr_string("[[[[[[", "w", "k"));
-var_dump(convert_cyr_string("[[[[[[", "i", "q"));
-var_dump(convert_cyr_string("", "d", "i"));
+var_dump(convert_cyr_string((binary)"[[[[[[", "q", "m"));
+var_dump(convert_cyr_string((binary)"[[[[[[", "k", "w"));
+var_dump(convert_cyr_string((binary)"[[[[[[", "m", "a"));
+var_dump(convert_cyr_string((binary)"[[[[[[", "d", "i"));
+var_dump(convert_cyr_string((binary)"[[[[[[", "w", "k"));
+var_dump(convert_cyr_string((binary)"[[[[[[", "i", "q"));
+var_dump(convert_cyr_string((binary)"", "d", "i"));
echo "Done\n";
?>
--EXPECTF--
-Warning: Wrong parameter count for convert_cyr_string() in %s on line %d
+Warning: convert_cyr_string() expects exactly 3 parameters, 0 given in %s on line %d
NULL
-Warning: Wrong parameter count for convert_cyr_string() in %s on line %d
+Warning: convert_cyr_string() expects exactly 3 parameters, 1 given in %s on line %d
NULL
-Warning: Wrong parameter count for convert_cyr_string() in %s on line %d
+Warning: convert_cyr_string() expects exactly 3 parameters, 2 given in %s on line %d
NULL
Warning: convert_cyr_string(): Unknown source charset: in %s on line %d
@@ -34,12 +34,8 @@ Warning: convert_cyr_string(): Unknown source charset: in %s on line %d
Warning: convert_cyr_string(): Unknown destination charset: in %s on line %d
string(0) ""
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-
-Notice: Array to string conversion in %s on line %d
-string(5) "Array"
+Warning: convert_cyr_string() expects parameter 1 to be string, array given in %s on line %d
+NULL
Warning: convert_cyr_string(): Unknown source charset: q in %s on line %d
string(6) "[[[[[["