1
- PHP 7.2 UPGRADE NOTES
1
+ PHP 7.3 UPGRADE NOTES
2
2
3
3
1. Backward Incompatible Changes
4
4
2. New Features
@@ -19,136 +19,10 @@ PHP 7.2 UPGRADE NOTES
19
19
1. Backward Incompatible Changes
20
20
========================================
21
21
22
- - Core:
23
- . gettype() will now return "resource (closed)" instead of "unknown type" for
24
- closed resources.
25
- . is_object() will now return true for objects of class
26
- __PHP_Incomplete_Class.
27
- . Support for Netware operating systems have been removed.
28
- . Casting arrays to objects (with (object) or settype()) will now covert
29
- integer keys to string property names. This fixes the behaviour of previous
30
- versions, where integer keys would become inaccessible properties with
31
- integer names.
32
- . Casting objects to arrays (with (array) or settype()), and retrieving
33
- object properties in an array with get_object_vars(), will now convert
34
- numeric string property names (that is, property names of the format
35
- /^(0|(-?[1-9][0-9]*))$/ where PHP_INT_MIN <= n <= PHP_INT_MAX) to integer
36
- keys. This fixes the behaviour of previous versions, where numeric string
37
- property names would become inaccessible string keys.
38
- . Unqualified references to undefined constants now generate a Warning instead
39
- of a notice. They will generate an Error in a future version of PHP.
40
- (https://wiki.php.net/rfc/deprecate-bareword-strings)
41
- . Minimum supported Windows versions are Windows 7/Server 2008 R2.
42
- . Initial trait property value compatibility check will no longer perform
43
- any casts. (Bug #74269)
44
- . "object" (in any case) can no longer be used as a class name.
45
-
46
- - BCMath:
47
- . The bcmod() function no longer truncates fractional numbers to integers. As
48
- such, its behavior now follows fmod() rather than the `%` operator. For
49
- example `bcmod('4', '3.5')` now returns '0.5' instead of '1'.
50
-
51
- - Hash:
52
- . The hash_hmac(), hash_hmac_file(), hash_pbkdf2() and hash_init() (with
53
- HASH_HMAC) functions no longer accept non-cryptographic hashes.
54
-
55
- - JSON
56
- . The json_decode() option JSON_OBJECT_AS_ARRAY is used if the second
57
- parameter (assoc) is null. Previously JSON_OBJECT_AS_ARRAY was always
58
- ignored.
59
-
60
- - Session:
61
- . Removed register_globals related code and "!" can be used as $_SESSION key name.
62
- . Session is made to manage session status correctly and prevents invalid operations.
63
- Only inappropriate codes are affected by this change. If you have problems with this,
64
- it means you have problem in your code.
65
- . Functions are made to set or return correct session status.
66
- session_start(), session_status(), session_regenerate_id()
67
- . Functions are made to return bool from null. These functions have void parameter
68
- and void parameter is checked.
69
- session_unset(), session_write_close()/session_commit(), session_abort(),
70
- session_reset()
71
- . Functions prohibit invalid operations with regard to session status and
72
- HTTP header status, returns correct bool return value.
73
- session_start(), session_set_cookie_params(), session_name(), session_module_name(),
74
- session_set_save_handler(), session_regenerate_id(), session_cache_limiter(),
75
- session_cache_expire(), session_unset(), session_destroy(),
76
- session_write_close()/session_commit(), session_reset()
77
- . INI value change by ini_set() returns update status correctly. Invalid INI modifications
78
- are checked and made to fail.
79
- session.name, session.save_path, session.cookie_lifetime, session.cookie_path,
80
- session.cookie_domain, session.cookie_httponly, session.cookie_secure,
81
- session.use_cookies, session.use_only_cookies, session.use_strict_mode,
82
- session.referer_check, session.cache_limiter, session.cache_expire,
83
- session.lazy_write, session.save_handler, session.serialize_handler,
84
- session.gc_probability, session.gc_divior, session.gc_maxlifetime,
85
- . Some E_ERRORs are changed to E_WARNING since session status is managed correctly.
86
- session_start()
87
- . Session no longer initialize $_SESSION for invalid and useless session.
88
- session_start()
89
- . When headers are already sent and try to set new INI values, session_name(),
90
- session_module_name(), session_save_path(), session_cache_limiter() and
91
- session_cache_expire() are no longer works. Older PHPs accepts new values even
92
- if new values will not be effective.
93
- This new corrected behavior may affect command line mode CLI scripts that manage
94
- sessions. Use output buffer just like web applications to resolve problems on
95
- CLI scripts.
96
-
97
-
98
22
========================================
99
23
2. New Features
100
24
========================================
101
25
102
- - Core:
103
- . It is now possible to remove argument type annotations when overriding an
104
- inherited method. This complies with contravariance of method argument types
105
- under the Liskov Substitution Principle.
106
- (https://wiki.php.net/rfc/parameter-no-type-variance)
107
- . It is now allowed to override an abstract method with another abstract
108
- method in a child class.
109
- (https://wiki.php.net/rfc/allow-abstract-function-override)
110
- . A trailing comma in group use statements is now allowed.
111
- (https://wiki.php.net/rfc/list-syntax-trailing-commas)
112
- . The "object" type annotation is now supported.
113
- (https://wiki.php.net/rfc/object-typehint)
114
-
115
- - DBA:
116
- . Implemented support for the LMDB backend.
117
-
118
- - OCI8:
119
- . Added Oracle Database Transparent Application Failover (TAF) callback support.
120
-
121
- - PCRE:
122
- . Added `J` modifier for setting PCRE_DUPNAMES.
123
- . Added `PREG_UNMATCHED_AS_NULL` flag to allow distinguish between unmatched
124
- subpatterns and empty matches by reporting NULL and "" (empty string),
125
- respectively.
126
-
127
- - Sodium
128
- . New cryptographic extension
129
-
130
- - SQLite3:
131
- . Implemented writing to BLOBs.
132
-
133
- - Standard:
134
- . Simplified password hashing API updated to support Argon2i hashes when PHP is compiled with libargon2
135
- (https://wiki.php.net/rfc/argon2_password_hash).
136
- . proc_nice() is now supported on Windows platforms.
137
-
138
- - Zip:
139
- . read/write encrypted archive, relying on libzip 1.2.0,
140
- using new methods:
141
- ZipArchive::setEncryptionName($name, $method [, $password]);
142
- ZipArchive::setEncryptionIndex($index, $method [, $password]);
143
- and new constants:
144
- ZipArchive::EM_NONE
145
- ZipArchive::EM_AES_128
146
- ZipArchive::EM_AES_192
147
- ZipArchive::EM_AES_256
148
- . accept 'password' from zip stream context
149
- . ZipArchive implements countable, added ZipArchive::count() method.
150
-
151
-
152
26
========================================
153
27
3. Changes in SAPI modules
154
28
========================================
@@ -157,100 +31,14 @@ PHP 7.2 UPGRADE NOTES
157
31
4. Deprecated Functionality
158
32
========================================
159
33
160
- All the deprecated functionality listed in the following will be removed in
161
- PHP 8.0.
162
-
163
- - Core:
164
- . The trace_errors ini directive has been deprecated.
165
- . The __autoload() mechanism has been deprecated, use spl_autoload_register()
166
- instead.
167
- . The (unset) cast has been deprecated. This does not affect the unset($var)
168
- language construct.
169
- . The create_function() function has been deprecated, use anonymous functions
170
- instead.
171
- . The each() function has been deprecated, use a foreach loop instead.
172
-
173
- - EXIF:
174
- . The read_exif_data() alias have been deprecated, use exif_read_data() instead.
175
-
176
- - GD:
177
- . png2wbmp() and jpeg2wbmp() have been deprecated.
178
-
179
- - GMP:
180
- . The gmp_random() function has been deprecated, use gmp_random_bits() or
181
- gmp_random_range() instead.
182
-
183
- - Intl:
184
- . INTL_IDNA_VARIANT_2003 has been deprecated; use INTL_IDNA_VARIANT_UTS46
185
- instead.
186
-
187
- - Mbstring:
188
- . The mbstring.func_overload ini directive has been deprecated.
189
-
190
- - Standard:
191
- . Calling parse_str() without the result argument has been deprecated.
192
- . Calling assert() with a string argument has been deprecated, use an ordinary
193
- expression instead.
194
-
195
- See also: https://wiki.php.net/rfc/deprecations_php_7_2
196
-
197
34
========================================
198
35
5. Changed Functions
199
36
========================================
200
37
201
- - Standard:
202
- . password_hash() can generate Argon2i hashes when the algorithm is set to PASSWORD_ARGON2I.
203
- When using PASSWORD_ARGON2I, the following cost factors may be set: 'memory_cost', 'time_cost',
204
- and 'threads'. These cost factors will default to 'PASSWORD_ARGON2_DEFAULT_MEMORY_COST',
205
- 'PASSWORD_ARGON2_DEFAULT_TIME_COST', and 'PASSWORD_ARGON2_DEFAULT_THREADS' respectively if not set.
206
- . password_verify() can verify Argon2i hashes.
207
- . password_get_info() and password_needs_rehash() can accept Argon2i hashes.
208
- . mail()/mb_send_mail() accept array $extra_header. Array parameter is checked against RFC 2822.
209
- Array format is
210
- $extra_headers = [
211
- 'Header-Name' => 'Header value',
212
- 'Multiple' => ['One header', 'Another header'],
213
- 'Multiline' = "FirstLine\r\n SecondLine",
214
- ];
215
- . count() now raises a warning when an invalid parameter is passed.
216
- Only arrays and objects implementing the Countable interface should be passed.
217
- . pack() and unpack() now support float and double in both little and big endian.
218
- . number_format() ensures zero values never contain a negative sign.
219
-
220
- - XML:
221
- . utf8_encode() and utf8_decode() have been moved to the Standard extension
222
- as string functions.
223
-
224
38
========================================
225
39
6. New Functions
226
40
========================================
227
41
228
- - Core:
229
- . Added stream_isatty().
230
- . Added sapi_windows_vt100_support().
231
-
232
- - DOM:
233
- . DomNodeList implements Countable, added DomNodeList::count().
234
- . DOMNamedNodeMap implements Countable, added DOMNamedNodeMap::count().
235
-
236
- - GD:
237
- . Added imagesetclip() and imagegetclip().
238
- . Added imageopenpolygon().
239
- . Added imageresolution().
240
- . Added imagecreatefrombmp() and imagebmp().
241
-
242
- - Mbstring:
243
- . Added mb_chr() and mb_ord().
244
- . Added mb_scurb() that scrub broken multibyte strings.
245
-
246
- - OCI8:
247
- . Added oci_register_taf_callback() and oci_disable_taf_callback() for
248
- Oracle Database TAF callback support.
249
-
250
- - Sockets:
251
- . Added socket_addrinfo_lookup(), socket_addrinfo_connect(),
252
- socket_addrinfo_bind() and socket_addrinfo_explain().
253
-
254
42
========================================
255
43
7. New Classes and Interfaces
256
44
========================================
@@ -259,94 +47,28 @@ See also: https://wiki.php.net/rfc/deprecations_php_7_2
259
47
8. Removed Extensions and SAPIs
260
48
========================================
261
49
262
- - Mcrypt:
263
- . The deprecated mcrypt extension has been moved to PECL.
264
- . libmcrypt has not been maintained since 2007 and the continued use of this
265
- extension is strongly discouraged.
266
- . Users are advised to use alternatives such as OpenSSL or libsodium.
267
-
268
50
========================================
269
51
9. Other Changes to Extensions
270
52
========================================
271
53
272
- - EXIF:
273
- . Added extended exif tag support for the following formats:
274
- Samsung, DJI, Panasonic, Sony, Pentax, Minolta, Sigma/Foveon,
275
- AGFA, Kyocera, Ricoh & Epson.
276
- . exif_read_data() and exif_thumbnail() now supports a passed streams as their
277
- first parameter.
278
-
279
- - GD:
280
- . Removed --enable-gd-native-ttf configuration option which was unused as
281
- of PHP 5.5.0 anyway.
282
- . imagegd() stores truecolor images as real truecolor images. Formerly, they
283
- have been converted to palette.
284
- . imageantialias() is now also available if compiled with a system libgd.
285
-
286
- - Mbstring
287
- . mb_check_encoding() accepts array parameter. Both key and value
288
- encodings are checked recursively.
289
- . mb_convert_encoding() accepts array parameter. Only value encodings
290
- are converted recursively.
291
-
292
- - PDO_OCI:
293
- . The '--with-pdo-oci' configure syntax no longer needs the vesion number of the
294
- Oracle Instant Client.
295
-
296
- - pdo_sqlite
297
- . Use sqlite3_prepare_v2() and sqlite3_close_v2() functions instead of their
298
- legacy counterparts.
54
+ ODBC:
55
+ . Support for Birdstep has been removed.
299
56
300
57
========================================
301
58
10. New Global Constants
302
59
========================================
303
60
304
- - Core:
305
- . PHP_FLOAT_DIG number of decimal digits, that can be rounded into a
306
- float and back without precision loss
307
- . PHP_FLOAT_EPSILON smallest representable positive number x, so then
308
- x + 1.0 != 1.0
309
- . PHP_FLOAT_MIN min representable float number
310
- . PHP_FLOAT_MAX max representable float number
311
- . PHP_OS_FAMILY current operating system family
312
-
313
- - Fileinfo:
314
- . FILEINFO_EXTENSION include list of possible file extensions
315
-
316
- - GD:
317
- . IMG_EFFECT_MULTIPLY
318
- . IMG_BMP
319
-
320
- - PCRE
321
- . PREG_UNMATCHED_AS_NULL
322
-
323
- - Standard:
324
- . PASSWORD_ARGON2_DEFAULT_MEMORY_COST
325
- . PASSWORD_ARGON2_DEFAULT_TIME_COST
326
- . PASSWORD_ARGON2_DEFAULT_THREADS
327
- . PASSWORD_ARGON2I
328
-
329
61
========================================
330
62
11. Changes to INI File Handling
331
63
========================================
332
64
333
- - sql.safe_mode
65
+ - birdstep.max_links
334
66
. This INI directive have been removed.
335
67
336
- - realpath_cache_size
337
- . Set to 4096k by default
338
-
339
68
========================================
340
69
12. Windows Support
341
70
========================================
342
71
343
- - Support for VT100 console mode
344
-
345
- On systems starting with 10.0.10586, cmd.exe supports ANSI escape sequences.
346
- The corresponding console mode is enabled by default on CLI on suitable
347
- systems. As well, the function sapi_windows_vt100_support() is provided,
348
- to control and query the corresponding information in the scripts.
349
-
350
72
========================================
351
73
13. Other Changes
352
74
========================================
0 commit comments