@@ -44,8 +44,8 @@ PHP 8.0 UPGRADE NOTES
44
44
. Removed ability to use array_key_exists() with objects. Use one of isset()
45
45
or property_exists() instead.
46
46
. Made the behavior of array_key_exists() regarding the type of the key
47
- parameter consistent with isset() and normal array access. All key types now use
48
- the usual coercions and array/object keys throw a TypeError.
47
+ parameter consistent with isset() and normal array access. All key types now
48
+ use the usual coercions and array/object keys throw a TypeError.
49
49
. Any array that has a number n as its first numeric key will use n+1 for
50
50
its next implicit key. Even if n is negative.
51
51
RFC: https://wiki.php.net/rfc/negative_array_index
@@ -119,17 +119,18 @@ PHP 8.0 UPGRADE NOTES
119
119
* Attempting to assign an empty string to a string offset.
120
120
121
121
RFC: https://wiki.php.net/rfc/engine_warnings
122
- . Attempting to assign multiple bytes to a string offset will now emit a warning.
122
+ . Attempting to assign multiple bytes to a string offset will now emit a
123
+ warning.
123
124
. Unexpected characters in source files (such as null bytes outside of
124
125
strings) will now result in a ParseError exception instead of a compile
125
126
warning.
126
127
. Uncaught exceptions now go through "clean shutdown", which means that
127
128
destructors will be called after an uncaught exception.
128
- . Compile time fatal error "Only variables can be passed by reference" has been
129
- delayed until run-time and converted to "Cannot pass parameter by reference"
130
- exception.
131
- . Some "Only variables should be passed by reference" notices have been converted
132
- to "Cannot pass parameter by reference" exception.
129
+ . Compile time fatal error "Only variables can be passed by reference" has
130
+ been delayed until run-time and converted to "Cannot pass parameter by
131
+ reference" exception.
132
+ . Some "Only variables should be passed by reference" notices have been
133
+ converted to "Cannot pass parameter by reference" exception.
133
134
. The generated name for anonymous classes has changed. It will now include
134
135
the name of the first parent or interface:
135
136
@@ -226,8 +227,8 @@ PHP 8.0 UPGRADE NOTES
226
227
a resource. Return value checks using is_resource() should be replaced with
227
228
checks for `false`.
228
229
. enchant_broker_request_dict() and enchant_broker_request_pwl_dict() will now
229
- return an EnchantDictionary object rather than a resource. Return value checks
230
- using is_resource() should be replaced with checks for `false`.
230
+ return an EnchantDictionary object rather than a resource. Return value
231
+ checks using is_resource() should be replaced with checks for `false`.
231
232
232
233
- Exif:
233
234
. Removed read_exif_data(). exif_read_data() should be used instead.
@@ -264,8 +265,8 @@ PHP 8.0 UPGRADE NOTES
264
265
RFC: https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003
265
266
. The deprecated Normalizer::NONE constant has been removed.
266
267
. The IntlDateFormatter::RELATIVE_FULL, IntlDateFormatter::RELATIVE_LONG,
267
- IntlDateFormatter::RELATIVE_MEDIUM, and IntlDateFormatter::RELATIVE_SHORT constants
268
- have been added.
268
+ IntlDateFormatter::RELATIVE_MEDIUM, and IntlDateFormatter::RELATIVE_SHORT
269
+ constants have been added.
269
270
270
271
- LDAP:
271
272
. The deprecated function ldap_sort has been removed.
@@ -299,12 +300,14 @@ PHP 8.0 UPGRADE NOTES
299
300
. A non-string pattern argument to mb_ereg_replace() will now be interpreted
300
301
as a string instead of an ASCII codepoint. The previous behavior may be
301
302
restored with an explicit call to chr().
302
- . The needle argument for mb_strpos(), mb_strrpos(), mb_stripos(), mb_strripos(),
303
- mb_strstr(), mb_stristr(), mb_strrchr() and mb_strrichr() can now be empty.
303
+ . The needle argument for mb_strpos(), mb_strrpos(), mb_stripos(),
304
+ mb_strripos(), mb_strstr(), mb_stristr(), mb_strrchr() and mb_strrichr() can
305
+ now be empty.
304
306
. The $is_hex parameter, which was not used internally, has been removed from
305
307
mb_decode_numericentity().
306
- . The legacy behaviour of passing the encoding as the third argument instead of an offset for the mb_strrpos
307
- function has been removed, provide an explicit 0 offset with the encoding as the fourth argument.
308
+ . The legacy behaviour of passing the encoding as the third argument instead
309
+ of an offset for the mb_strrpos() function has been removed, provide an
310
+ explicit 0 offset with the encoding as the fourth argument instead.
308
311
309
312
- PCRE:
310
313
. When passing invalid escape sequences they are no longer interpreted as
@@ -313,7 +316,7 @@ PHP 8.0 UPGRADE NOTES
313
316
314
317
- PDO:
315
318
. The default error handling mode has been changed from "silent" to
316
- "exceptions". See https://www.php.net/manual/en/pdo.error-handling.php
319
+ "exceptions". See https://www.php.net/manual/en/pdo.error-handling.php
317
320
for details of behavior changes and how to explicitly set this attribute.
318
321
RFC: https://wiki.php.net/rfc/pdo_default_errmode
319
322
. The method PDOStatement::setFetchMode() now accepts the following signature:
@@ -355,8 +358,8 @@ PHP 8.0 UPGRADE NOTES
355
358
ReflectionParameter::isDefaultValueConstant()
356
359
ReflectionParameter::getDefaultValueConstantName()
357
360
. ReflectionMethod::isConstructor() and ReflectionMethod::isDestructor() now
358
- also return true for `__construct` and `__destruct` in methods of interfaces.
359
- Previously, this would only be true in methods of classes and traits.
361
+ also return true for `__construct` and `__destruct` methods of interfaces.
362
+ Previously, this would only be true for methods of classes and traits.
360
363
361
364
- Socket:
362
365
. The deprecated AI_IDN_ALLOW_UNASSIGNED and AI_IDN_USE_STD3_ASCII_RULES
@@ -388,8 +391,8 @@ PHP 8.0 UPGRADE NOTES
388
391
string. Previously non-string needles were interpreted as an ASCII code
389
392
point. An explicit call to chr() can be used to restore the previous
390
393
behavior.
391
- . The needle argument for strpos(), strrpos(), stripos(), strripos(), strstr(),
392
- stristr() and strrchr() can now be empty.
394
+ . The needle argument for strpos(), strrpos(), stripos(), strripos(),
395
+ strstr(), stristr() and strrchr() can now be empty.
393
396
. The length argument for substr(), substr_count(), substr_compare(), and
394
397
iconv_substr() can now be null. Null values will behave as if no length
395
398
argument was provided and will therefore return the remainder of the string
@@ -436,9 +439,9 @@ PHP 8.0 UPGRADE NOTES
436
439
locale component from the default.
437
440
438
441
- Sysvmsg:
439
- . msg_get_queue() will now return an SysvMessageQueue object rather than a resource.
440
- Return value checks using is_resource() should be replaced with checks
441
- for `false`.
442
+ . msg_get_queue() will now return an SysvMessageQueue object rather than a
443
+ resource. Return value checks using is_resource() should be replaced with
444
+ checks for `false`.
442
445
443
446
- Sysvsem:
444
447
. sem_get() will now return an SysvSemaphore object rather than a resource.
@@ -457,10 +460,10 @@ PHP 8.0 UPGRADE NOTES
457
460
referenced.
458
461
459
462
- XML-RPC:
460
- . xmlrpc_server_create() will now return an XmlRpcServer object rather than a resource.
461
- The xmlrpc_server_destroy() function no longer has an effect,
462
- instead the XmlRpcServer instance is automatically destroyed if it is no longer
463
- referenced.
463
+ . xmlrpc_server_create() will now return an XmlRpcServer object rather than a
464
+ resource. The xmlrpc_server_destroy() function no longer has an effect,
465
+ instead the XmlRpcServer instance is automatically destroyed if it is no
466
+ longer referenced.
464
467
465
468
- XMLWriter:
466
469
. The XMLWriter functions now accept and return, respectively, XMLWriter
@@ -759,6 +762,6 @@ PHP 8.0 UPGRADE NOTES
759
762
14. Performance Improvements
760
763
========================================
761
764
762
- - array_slice() on an array without gaps will no longer scan the whole array to find
763
- the start offset. This may significantly reduce the runtime of the function
764
- with large offsets and small lengths.
765
+ - array_slice() on an array without gaps will no longer scan the whole array to
766
+ find the start offset. This may significantly reduce the runtime of the
767
+ function with large offsets and small lengths.
0 commit comments