2019-01-28 17:34:31 +08:00
|
|
|
PHP 8.0 UPGRADE NOTES
|
2012-03-06 04:14:04 +08:00
|
|
|
|
|
|
|
1. Backward Incompatible Changes
|
|
|
|
2. New Features
|
2014-05-01 18:27:38 +08:00
|
|
|
3. Changes in SAPI modules
|
|
|
|
4. Deprecated Functionality
|
|
|
|
5. Changed Functions
|
|
|
|
6. New Functions
|
|
|
|
7. New Classes and Interfaces
|
2015-02-10 15:56:18 +08:00
|
|
|
8. Removed Extensions and SAPIs
|
2014-05-01 18:27:38 +08:00
|
|
|
9. Other Changes to Extensions
|
|
|
|
10. New Global Constants
|
|
|
|
11. Changes to INI File Handling
|
2014-08-22 19:35:07 +08:00
|
|
|
12. Windows Support
|
2019-01-28 17:34:31 +08:00
|
|
|
13. Other Changes
|
|
|
|
14. Performance Improvements
|
2010-03-25 00:23:50 +08:00
|
|
|
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2010-03-25 00:23:50 +08:00
|
|
|
========================================
|
2012-03-06 04:14:04 +08:00
|
|
|
1. Backward Incompatible Changes
|
2010-03-25 00:23:50 +08:00
|
|
|
========================================
|
2016-04-25 05:49:52 +08:00
|
|
|
|
2019-01-04 18:55:41 +08:00
|
|
|
- Core:
|
2019-01-29 19:14:54 +08:00
|
|
|
. Methods with the same name as the class are no longer interpreted as
|
|
|
|
constructors. The __construct() method should be used instead.
|
2019-01-29 23:03:24 +08:00
|
|
|
. Removed ability to call non-static methods statically.
|
2019-01-29 17:46:21 +08:00
|
|
|
. Removed (unset) cast.
|
2019-01-28 23:05:02 +08:00
|
|
|
. Removed track_errors ini directive. This means that $php_errormsg is no
|
|
|
|
longer available. The error_get_last() function may be used instead.
|
2019-01-29 20:36:26 +08:00
|
|
|
. Removed the ability to define case-insensitive constants. The third
|
|
|
|
argument to define() may no longer be true.
|
2019-01-31 19:25:51 +08:00
|
|
|
. Access to undefined constants now always results in an Error exception.
|
|
|
|
Previously, unqualified constant accesses resulted in a warning and were
|
|
|
|
interpreted as strings.
|
2019-01-30 20:35:36 +08:00
|
|
|
. Removed ability to specify an autoloader using an __autoload() function.
|
|
|
|
spl_autoload_register() should be used instead.
|
2019-01-28 23:05:02 +08:00
|
|
|
. Removed create_function(). Anonymous functions may be used instead.
|
2019-01-29 00:12:32 +08:00
|
|
|
. Removed each(). foreach or ArrayIterator should be used instead.
|
2019-01-29 22:16:51 +08:00
|
|
|
. Removed ability to unbind $this from closures that were created from a
|
|
|
|
method, using Closure::fromCallable() or ReflectionMethod::getClosure().
|
2019-01-23 01:07:46 +08:00
|
|
|
|
2019-01-30 19:53:08 +08:00
|
|
|
- Date:
|
|
|
|
. mktime() and gmmktime() now require at least one argument. time() can be
|
|
|
|
used to get the current timestamp.
|
|
|
|
|
2019-01-30 19:58:26 +08:00
|
|
|
- Exif:
|
|
|
|
. Removed read_exif_data(). exif_read_data() should be used instead.
|
|
|
|
|
2019-01-29 18:01:03 +08:00
|
|
|
- Filter:
|
|
|
|
. The FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED flags for the
|
|
|
|
FILTER_VALIDATE_URL filter have been removed. The scheme and host are (and
|
|
|
|
have been) always required.
|
|
|
|
|
2019-01-28 21:29:06 +08:00
|
|
|
- GD:
|
|
|
|
. The deprecated function image2wbmp() has been removed.
|
|
|
|
RFC: https://wiki.php.net/rfc/image2wbmp
|
2019-01-28 21:50:52 +08:00
|
|
|
. The deprecated functions png2wbmp() and jpeg2wbmp() have been removed.
|
|
|
|
RFC: https://wiki.php.net/rfc/deprecate-png-jpeg-2wbmp
|
2019-01-30 23:46:36 +08:00
|
|
|
. The default $mode parameter of imagecropauto() no longer accepts -1.
|
|
|
|
IMG_CROP_DEFAULT should be used instead.
|
2019-01-28 21:29:06 +08:00
|
|
|
|
2019-01-28 23:05:02 +08:00
|
|
|
- GMP:
|
|
|
|
. gmp_random() has been removed. One of gmp_random_range() or
|
|
|
|
gmp_random_bits() should be used instead.
|
|
|
|
|
2019-01-28 22:18:01 +08:00
|
|
|
- Intl:
|
|
|
|
. The deprecated constant INTL_IDNA_VARIANT_2003 has been removed.
|
|
|
|
RFC: https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003
|
2019-01-30 23:33:59 +08:00
|
|
|
. The deprecated Normalizer::NONE constant has been removed.
|
2019-01-28 22:18:01 +08:00
|
|
|
|
2019-01-28 23:05:02 +08:00
|
|
|
- Mbstring:
|
|
|
|
. The mbstring.func_overload directive has been removed. The related
|
|
|
|
MB_OVERLOAD_MAIL, MB_OVERLOAD_STRING, and MB_OVERLOAD_REGEX constants have
|
|
|
|
also been removed. Finally, the "func_overload" and "func_overload_list"
|
|
|
|
entries in mb_get_info() have been removed.
|
|
|
|
. mb_parse_str() can no longer be used without specifying a result array.
|
2019-01-29 00:19:05 +08:00
|
|
|
. A number of deprecated mbregex aliases have been removed. See the following
|
|
|
|
list for which functions should be used instead:
|
|
|
|
|
|
|
|
* mbregex_encoding() -> mb_regex_encoding()
|
|
|
|
* mbereg() -> mb_ereg()
|
|
|
|
* mberegi() -> mb_eregi()
|
|
|
|
* mbereg_replace() -> mb_ereg_replace()
|
|
|
|
* mberegi_replace() -> mb_eregi_replace()
|
|
|
|
* mbsplit() -> mb_split()
|
|
|
|
* mbereg_match() -> mb_ereg_match()
|
|
|
|
* mbereg_search() -> mb_ereg_search()
|
|
|
|
* mbereg_search_pos() -> mb_ereg_search_pos()
|
|
|
|
* mbereg_search_regs() -> mb_ereg_search_regs()
|
|
|
|
* mbereg_search_init() -> mb_ereg_search_init()
|
|
|
|
* mbereg_search_getregs() -> mb_ereg_search_getregs()
|
|
|
|
* mbereg_search_getpos() -> mb_ereg_search_getpos()
|
|
|
|
* mbereg_search_setpos() -> mb_ereg_search_setpos()
|
2019-01-28 23:05:02 +08:00
|
|
|
|
2019-01-29 19:40:01 +08:00
|
|
|
. The 'e' modifier for mb_ereg_replace() has been removed.
|
|
|
|
mb_ereg_replace_callback() should be used instead.
|
2019-02-01 22:18:28 +08:00
|
|
|
. A non-string pattern argument to mb_ereg_replace() will now be interpreted
|
|
|
|
as a string instead of an ASCII codepoint. The previous behavior may be
|
|
|
|
restored with an explicit call to chr().
|
2019-01-29 19:40:01 +08:00
|
|
|
|
2019-01-29 00:40:39 +08:00
|
|
|
- SPL:
|
|
|
|
. SplFileObject::fgetss() has been removed.
|
|
|
|
|
2019-01-28 23:05:02 +08:00
|
|
|
- Standard:
|
2019-01-28 23:35:04 +08:00
|
|
|
. assert() will no longer evaluate string arguments, instead they will be
|
|
|
|
treated like any other argument. assert($a == $b) should be used instead of
|
|
|
|
assert('$a == $b'). The assert.quiet_eval ini directive and
|
|
|
|
ASSERT_QUIET_EVAL constants have also been removed, as they would no longer
|
|
|
|
have any effect.
|
2019-01-28 23:05:02 +08:00
|
|
|
. parse_str() can no longer be used without specifying a result array.
|
2019-01-29 00:40:39 +08:00
|
|
|
. fgetss() has been removed.
|
|
|
|
. The string.strip_tags filter has been removed.
|
2019-01-29 17:02:03 +08:00
|
|
|
. The needle argument of strpos(), strrpos(), stripos(), strripos(), strstr(),
|
|
|
|
strchr(), strrchr(), and stristr() will now always be interpreted as a
|
|
|
|
string. Previously non-string needles were interpreted as an ASCII code
|
|
|
|
point. An explicit call to chr() can be used to restore the previous
|
|
|
|
behavior.
|
2019-01-30 19:20:25 +08:00
|
|
|
. The 'salt' option of password_hash() is no longer supported. If the 'salt'
|
|
|
|
option is used a warning is generated, the provided salt is ignored, and a
|
|
|
|
generated salt is used instead.
|
2019-01-29 00:40:39 +08:00
|
|
|
|
|
|
|
- Zlib:
|
|
|
|
. gzgetss() has been removed.
|
2019-01-28 23:05:02 +08:00
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
|
|
|
2. New Features
|
|
|
|
========================================
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
3. Changes in SAPI modules
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
4. Deprecated Functionality
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
5. Changed Functions
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2009-06-24 03:40:31 +08:00
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
6. New Functions
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2015-04-24 23:19:58 +08:00
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
7. New Classes and Interfaces
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2015-02-10 15:56:18 +08:00
|
|
|
8. Removed Extensions and SAPIs
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
9. Other Changes to Extensions
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2016-07-03 18:43:30 +08:00
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
10. New Global Constants
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2010-03-25 00:23:50 +08:00
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
11. Changes to INI File Handling
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2010-08-30 17:38:47 +08:00
|
|
|
|
2014-08-22 19:35:07 +08:00
|
|
|
========================================
|
|
|
|
12. Windows Support
|
|
|
|
========================================
|
|
|
|
|
2019-01-15 17:13:39 +08:00
|
|
|
========================================
|
2019-01-28 17:34:31 +08:00
|
|
|
13. Other Changes
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2018-12-27 05:26:01 +08:00
|
|
|
|
|
|
|
========================================
|
2019-01-28 17:34:31 +08:00
|
|
|
14. Performance Improvements
|
2018-12-27 05:26:01 +08:00
|
|
|
========================================
|
|
|
|
|