diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2018-07-05 18:43:42 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2018-07-21 22:38:35 +0200 |
commit | d9acfa45b849a9444ae5f341fd016137e4212066 (patch) | |
tree | 47bb970dc16c010d9e3b22bb5c180f1b24a113ae | |
parent | 5c4047b3396818e51bc95878cd45bcd3ff6d357b (diff) | |
download | php-git-d9acfa45b849a9444ae5f341fd016137e4212066.tar.gz |
Deprecate fgetss() and gzgetss()
SplFileObject::fgetss() will also generate a deprecation notice
through an internal call to fgetss().
Part of RFC https://wiki.php.net/rfc/deprecations_php_7_3.
19 files changed, 108 insertions, 5 deletions
diff --git a/ext/spl/tests/bug45216.phpt b/ext/spl/tests/bug45216.phpt index 0c4ab93ff3..5cf7cd948c 100644 --- a/ext/spl/tests/bug45216.phpt +++ b/ext/spl/tests/bug45216.phpt @@ -17,6 +17,9 @@ var_dump(fgetss($handle)); <?php unlink(dirname(__FILE__) . '/foo.html'); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: Function fgetss() is deprecated in %s on line %d string(12) "text 0text 1" + +Deprecated: Function fgetss() is deprecated in %s on line %d string(12) "text 0text 1" diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 85092dea10..31636e0fc2 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -3137,7 +3137,7 @@ static const zend_function_entry basic_functions[] = { /* {{{ */ PHP_FE(feof, arginfo_feof) PHP_FE(fgetc, arginfo_fgetc) PHP_FE(fgets, arginfo_fgets) - PHP_FE(fgetss, arginfo_fgetss) + PHP_DEP_FE(fgetss, arginfo_fgetss) PHP_FE(fread, arginfo_fread) PHP_NAMED_FE(fopen, php_if_fopen, arginfo_fopen) PHP_FE(fpassthru, arginfo_fpassthru) diff --git a/ext/standard/tests/file/fgetss.phpt b/ext/standard/tests/file/fgetss.phpt index 2e2bb6b71c..fc685113fc 100644 --- a/ext/standard/tests/file/fgetss.phpt +++ b/ext/standard/tests/file/fgetss.phpt @@ -39,45 +39,106 @@ var_dump(fgetss($fp, 0)); echo "Done\n"; ?> --EXPECTF-- +Deprecated: Function fgetss() is deprecated in %s on line %d string(18) "askasdfasdfaaaaaa " + +Deprecated: Function fgetss() is deprecated in %s on line %d string(6) "dddddd" + +Deprecated: Function fgetss() is deprecated in %s on line %d string(6) "asdqw " + +Deprecated: Function fgetss() is deprecated in %s on line %d string(8) "aaaaqqqq" + +Deprecated: Function fgetss() is deprecated in %s on line %d string(23) "aaafunction foo() {}qqq" + +Deprecated: Function fgetss() is deprecated in %s on line %d bool(false) + +Deprecated: Function fgetss() is deprecated in %s on line %d string(6) "asdasd" + +Deprecated: Function fgetss() is deprecated in %s on line %d string(0) "" + +Deprecated: Function fgetss() is deprecated in %s on line %d bool(false) + +Deprecated: Function fgetss() is deprecated in %s on line %d bool(false) + +Deprecated: Function fgetss() is deprecated in %s on line %d string(11) "some text " + +Deprecated: Function fgetss() is deprecated in %s on line %d string(4) "blah" + +Deprecated: Function fgetss() is deprecated in %s on line %d string(24) "some another text hoho " + +Deprecated: Function fgetss() is deprecated in %s on line %d bool(false) + +Deprecated: Function fgetss() is deprecated in %s on line %d string(9) "askasdfas" + +Deprecated: Function fgetss() is deprecated in %s on line %d string(6) "dfaaaa" + +Deprecated: Function fgetss() is deprecated in %s on line %d string(5) "asdqw" + +Deprecated: Function fgetss() is deprecated in %s on line %d string(0) "" + +Deprecated: Function fgetss() is deprecated in %s on line %d string(3) "aaa" + +Deprecated: Function fgetss() is deprecated in %s on line %d string(7) "functio" + +Deprecated: Function fgetss() is deprecated in %s on line %d string(6) "asdasd" + +Deprecated: Function fgetss() is deprecated in %s on line %d string(0) "" + +Deprecated: Function fgetss() is deprecated in %s on line %d bool(false) + +Deprecated: Function fgetss() is deprecated in %s on line %d bool(false) + +Deprecated: Function fgetss() is deprecated in %s on line %d string(9) "some text" + +Deprecated: Function fgetss() is deprecated in %s on line %d string(2) " " + +Deprecated: Function fgetss() is deprecated in %s on line %d string(9) "some anot" + +Deprecated: Function fgetss() is deprecated in %s on line %d string(9) "her text " +Deprecated: Function fgetss() is deprecated in %s on line %d + Warning: fgetss(): Length parameter must be greater than 0 in %s on line %d bool(false) +Deprecated: Function fgetss() is deprecated in %s on line %d + Warning: fgetss(): Length parameter must be greater than 0 in %s on line %d bool(false) +Deprecated: Function fgetss() is deprecated in %s on line %d + Warning: fgetss(): supplied resource is not a valid stream resource in %s on line %d bool(false) Done diff --git a/ext/standard/tests/file/fgetss1.phpt b/ext/standard/tests/file/fgetss1.phpt index 66985453df..5054086d7d 100644 --- a/ext/standard/tests/file/fgetss1.phpt +++ b/ext/standard/tests/file/fgetss1.phpt @@ -2,6 +2,7 @@ more fgetss() tests --FILE-- <?php +error_reporting(E_ALL & ~E_DEPRECATED); $filename = dirname(__FILE__)."/fgetss1.html"; diff --git a/ext/standard/tests/file/fgetss_basic1.phpt b/ext/standard/tests/file/fgetss_basic1.phpt index 4c5881d588..53ef38d4d8 100644 --- a/ext/standard/tests/file/fgetss_basic1.phpt +++ b/ext/standard/tests/file/fgetss_basic1.phpt @@ -2,6 +2,8 @@ Test fgetss() function : Basic functionality - read modes only --FILE-- <?php +error_reporting(E_ALL & ~E_DEPRECATED); + /* Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); Description: Gets line from file pointer and strip HTML tags diff --git a/ext/standard/tests/file/fgetss_basic2-win32-mb.phpt b/ext/standard/tests/file/fgetss_basic2-win32-mb.phpt index 783e6c3edd..c875024718 100644 --- a/ext/standard/tests/file/fgetss_basic2-win32-mb.phpt +++ b/ext/standard/tests/file/fgetss_basic2-win32-mb.phpt @@ -8,6 +8,8 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php +error_reporting(E_ALL & ~E_DEPRECATED); + /* Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); Description: Gets line from file pointer and strip HTML tags diff --git a/ext/standard/tests/file/fgetss_basic2-win32.phpt b/ext/standard/tests/file/fgetss_basic2-win32.phpt index 1fac3afb15..c7f3aa4c06 100644 --- a/ext/standard/tests/file/fgetss_basic2-win32.phpt +++ b/ext/standard/tests/file/fgetss_basic2-win32.phpt @@ -8,6 +8,8 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php +error_reporting(E_ALL & ~E_DEPRECATED); + /* Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); Description: Gets line from file pointer and strip HTML tags diff --git a/ext/standard/tests/file/fgetss_basic2.phpt b/ext/standard/tests/file/fgetss_basic2.phpt index 8ce08bbd81..771eabeaa1 100644 --- a/ext/standard/tests/file/fgetss_basic2.phpt +++ b/ext/standard/tests/file/fgetss_basic2.phpt @@ -8,6 +8,8 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php +error_reporting(E_ALL & ~E_DEPRECATED); + /* Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); Description: Gets line from file pointer and strip HTML tags diff --git a/ext/standard/tests/file/fgetss_error.phpt b/ext/standard/tests/file/fgetss_error.phpt index 1eb90589a7..893aca221a 100644 --- a/ext/standard/tests/file/fgetss_error.phpt +++ b/ext/standard/tests/file/fgetss_error.phpt @@ -2,6 +2,8 @@ Test fgetss() function : error conditions --FILE-- <?php +error_reporting(E_ALL & ~E_DEPRECATED); + /* Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); Description: Gets line from file pointer and strip HTML tags diff --git a/ext/standard/tests/file/fgetss_variation1-win32.phpt b/ext/standard/tests/file/fgetss_variation1-win32.phpt index 7cd49333bf..688f5e624a 100644 --- a/ext/standard/tests/file/fgetss_variation1-win32.phpt +++ b/ext/standard/tests/file/fgetss_variation1-win32.phpt @@ -8,6 +8,8 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php +error_reporting(E_ALL & ~E_DEPRECATED); + /* Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); Description: Gets line from file pointer and strip HTML tags diff --git a/ext/standard/tests/file/fgetss_variation1.phpt b/ext/standard/tests/file/fgetss_variation1.phpt index 51c15fff96..c716090541 100644 --- a/ext/standard/tests/file/fgetss_variation1.phpt +++ b/ext/standard/tests/file/fgetss_variation1.phpt @@ -8,6 +8,8 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php +error_reporting(E_ALL & ~E_DEPRECATED); + /* Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); Description: Gets line from file pointer and strip HTML tags diff --git a/ext/standard/tests/file/fgetss_variation2.phpt b/ext/standard/tests/file/fgetss_variation2.phpt index aef653a406..e8d168e46f 100644 --- a/ext/standard/tests/file/fgetss_variation2.phpt +++ b/ext/standard/tests/file/fgetss_variation2.phpt @@ -2,6 +2,8 @@ Test fgetss() function : usage variations - read modes --FILE-- <?php +error_reporting(E_ALL & ~E_DEPRECATED); + /* Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); Description: Gets line from file pointer and strip HTML tags diff --git a/ext/standard/tests/file/fgetss_variation3-win32.phpt b/ext/standard/tests/file/fgetss_variation3-win32.phpt index fc7561dff5..19699b2fb3 100644 --- a/ext/standard/tests/file/fgetss_variation3-win32.phpt +++ b/ext/standard/tests/file/fgetss_variation3-win32.phpt @@ -8,6 +8,8 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php +error_reporting(E_ALL & ~E_DEPRECATED); + /* Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); Description: Gets line from file pointer and strip HTML tags diff --git a/ext/standard/tests/file/fgetss_variation3.phpt b/ext/standard/tests/file/fgetss_variation3.phpt index 9a771aa442..c87925cb8e 100644 --- a/ext/standard/tests/file/fgetss_variation3.phpt +++ b/ext/standard/tests/file/fgetss_variation3.phpt @@ -8,6 +8,8 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php +error_reporting(E_ALL & ~E_DEPRECATED); + /* Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); Description: Gets line from file pointer and strip HTML tags diff --git a/ext/standard/tests/file/fgetss_variation4.phpt b/ext/standard/tests/file/fgetss_variation4.phpt index dd497a4d0c..60f7cdab63 100644 --- a/ext/standard/tests/file/fgetss_variation4.phpt +++ b/ext/standard/tests/file/fgetss_variation4.phpt @@ -7,6 +7,8 @@ if(substr(PHP_OS, 0, 3) == "WIN") ?> --FILE-- <?php +error_reporting(E_ALL & ~E_DEPRECATED); + /* Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); Description: Gets line from file pointer and strip HTML tags diff --git a/ext/standard/tests/file/fgetss_variation5-win32.phpt b/ext/standard/tests/file/fgetss_variation5-win32.phpt index a2d4a705e8..211c158ae2 100644 --- a/ext/standard/tests/file/fgetss_variation5-win32.phpt +++ b/ext/standard/tests/file/fgetss_variation5-win32.phpt @@ -8,6 +8,8 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { ?> --FILE-- <?php +error_reporting(E_ALL & ~E_DEPRECATED); + /* Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); Description: Gets line from file pointer and strip HTML tags diff --git a/ext/standard/tests/file/fgetss_variation5.phpt b/ext/standard/tests/file/fgetss_variation5.phpt index 76a5f16458..17e0935e84 100644 --- a/ext/standard/tests/file/fgetss_variation5.phpt +++ b/ext/standard/tests/file/fgetss_variation5.phpt @@ -8,6 +8,8 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php +error_reporting(E_ALL & ~E_DEPRECATED); + /* Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] ); Description: Gets line from file pointer and strip HTML tags diff --git a/ext/zlib/tests/gzgetss.phpt b/ext/zlib/tests/gzgetss.phpt index 58c428cbc7..58d13ab733 100644 --- a/ext/zlib/tests/gzgetss.phpt +++ b/ext/zlib/tests/gzgetss.phpt @@ -16,5 +16,17 @@ while (!gzeof($handle)){ } gzclose($handle); ?> ---EXPECT-- -<code>stringgzgetss(resource $zp, int $length [, string $allowable_tags ]);<code/> +--EXPECTF-- +Deprecated: Function gzgetss() is deprecated in %s on line %d + + +Deprecated: Function gzgetss() is deprecated in %s on line %d + + +Deprecated: Function gzgetss() is deprecated in %s on line %d + <code>stringgzgetss(resource $zp, int $length [, string $allowable_tags ]);<code/> + +Deprecated: Function gzgetss() is deprecated in %s on line %d + + +Deprecated: Function gzgetss() is deprecated in %s on line %d diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index a5028a72b0..9e9de99f25 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -1393,7 +1393,7 @@ static const zend_function_entry php_zlib_functions[] = { PHP_FALIAS(gzeof, feof, arginfo_gzpassthru) PHP_FALIAS(gzgetc, fgetc, arginfo_gzpassthru) PHP_FALIAS(gzgets, fgets, arginfo_gzgets) - PHP_FALIAS(gzgetss, fgetss, arginfo_gzgetss) + PHP_DEP_FALIAS(gzgetss, fgetss, arginfo_gzgetss) PHP_FALIAS(gzread, fread, arginfo_gzread) PHP_FE(gzopen, arginfo_gzopen) PHP_FALIAS(gzpassthru, fpassthru, arginfo_gzpassthru) |