@@ -53,77 +53,93 @@ PHP 8.4 UPGRADE NOTES
53
53
Return value checks using is_resource() should be replaced with checks
54
54
for `false`, unless specified otherwise.
55
55
. DBA:
56
- > dba_open() and dba_popen() will now return Dba\Connection
56
+ . dba_open() and dba_popen() will now return Dba\Connection
57
57
. ODBC:
58
- > odbc_connect() and odbc_pconnect() will now return Odbc\Connection
59
- > odbc_prepare(), odbc_exec(), and various other functions will now return
58
+ . odbc_connect() and odbc_pconnect() will now return Odbc\Connection
59
+ . odbc_prepare(), odbc_exec(), and various other functions will now return
60
60
Odbc\Result
61
61
. SOAP:
62
- > SoapClient::$httpurl is now a Soap\Url object rather than a resource.
62
+ . SoapClient::$httpurl is now a Soap\Url object rather than a resource.
63
63
Checks using is_resource() (i.e. is_resource($client->httpurl)) should be
64
64
replaced with checks for null (i.e. $client->httpurl !== null).
65
- > SoapClient::$sdl is now a Soap\Sdl object rather than a resource.
65
+ . SoapClient::$sdl is now a Soap\Sdl object rather than a resource.
66
66
Checks using is_resource() (i.e. is_resource($client->sdl)) should be
67
67
replaced with checks for null (i.e. $client->sdl !== null).
68
68
69
69
- New warnings and exceptions:
70
+ . Curl:
71
+ . curl_multi_select throws a ValueError if the timeout argument if it's negative
72
+ or greater than PHP_INT_MAX.
73
+ . GD:
74
+ . imagejpeg/imagewebp/imagepng/imageavif throws an exception if an invalid
75
+ quality parameter value is passed. In addition, imageavif will throw an exception
76
+ if an invalid speed parameter value is passed.
77
+ . imagescale throws an exception if the width/height argument underflows/overflows or
78
+ if the mode argument is invalid.
79
+ imagefilter with IMG_FILTER_SCATTER throws an exception if the sub/plus arguments
80
+ underflows/overflows.
81
+ . Gettext:
82
+ . bind_textdomain_codeset, textdomain and d(*)gettext functions now throw an exception
83
+ if the domain argument is empty.
70
84
. Intl:
71
- > resourcebundle_get(), ResourceBundle::get(), and accessing offsets on a
85
+ . resourcebundle_get(), ResourceBundle::get(), and accessing offsets on a
72
86
ResourceBundle object now throw:
73
87
- TypeError for invalid offset types
74
88
- ValueError for an empty string
75
89
- ValueError if the integer index does not fit in a signed 32 bit integer
90
+ . IntlDateFormatter::__construct() throws a ValueError if the locale is invalid.
91
+ . NumberFormatter::__construct() throws a ValueError if the locale is invalid.
76
92
. MBString:
77
- > mb_encode_numericentity() and mb_decode_numericentity() now check that
93
+ . mb_encode_numericentity() and mb_decode_numericentity() now check that
78
94
the $map is only composed of integers, if not a ValueError is thrown.
79
- > mb_http_input() now always throws a ValueError if the $type is invalid.
80
- > mb_http_output() now checks that the $encoding parameter does not
95
+ . mb_http_input() now always throws a ValueError if the $type is invalid.
96
+ . mb_http_output() now checks that the $encoding parameter does not
81
97
contain any null bytes. If it does, a ValueError is now thrown.
82
98
. ODBC:
83
- > odbc_fetch_row() returns false when a value less than or equal to 0 is
99
+ . odbc_fetch_row() returns false when a value less than or equal to 0 is
84
100
passed for parameter $row. Now, a warning is emitted in this case.
85
101
. PCNTL:
86
- > The functions pcntl_sigprocmask(), pcntl_sigwaitinfo() and
102
+ . The functions pcntl_sigprocmask(), pcntl_sigwaitinfo() and
87
103
pcntl_sigtimedwait() now throw:
88
104
- A ValueError if the $signals array is empty (except for
89
105
pcntl_sigprocmask() if the $mode is SIG_SETMASK).
90
106
- A TypeError if a value of the $signals array is not an integer
91
107
- A ValueError if a value of the $signals array is not a valid signal number
92
- > The function pcntl_sigprocmask() now throw:
108
+ . The function pcntl_sigprocmask() now throw:
93
109
- A ValueError if $mode is not one of SIG_BLOCK, SIG_UNBLOCK, or SIG_SETMASK
94
- > The function pcntl_sigtimedwait() now throw:
110
+ . The function pcntl_sigtimedwait() now throw:
95
111
- A ValueError if $seconds is less than 0
96
112
- A ValueError if $nanoseconds is less than 0 or greater than 1e9
97
113
- A ValueError if both $seconds and $nanoseconds are 0
98
114
. SimpleXML:
99
- > Calling simplexml_import_dom() with a non-XML object now throws a
115
+ . Calling simplexml_import_dom() with a non-XML object now throws a
100
116
TypeError instead of a ValueError.
101
117
. Standard:
102
- > round() now validates the value of the $mode parameter and throws a
118
+ . round() now validates the value of the $mode parameter and throws a
103
119
ValueError for invalid modes. Previously invalid modes would have been
104
120
interpreted as PHP_ROUND_HALF_UP.
105
- > The str_getcsv() function now throws ValueErrors when the $separator and
121
+ . The str_getcsv() function now throws ValueErrors when the $separator and
106
122
$enclosure arguments are not one byte long, or if the $escape is not one
107
123
byte long or the empty string. This aligns the behaviour to be identical
108
124
to that of fputcsv() and fgetcsv().
109
- > php_uname() now throws ValueErrors if the $move parameter is invalid.
110
- > The "allowed_classes" option for unserialize() now throws TypeErrors and
125
+ . php_uname() now throws ValueErrors if the $move parameter is invalid.
126
+ . The "allowed_classes" option for unserialize() now throws TypeErrors and
111
127
ValueErrors if it is not an array of class names.
112
128
. XMLReader:
113
- > Passing an invalid character encoding to XMLReader::open() or
129
+ . Passing an invalid character encoding to XMLReader::open() or
114
130
XMLReader::XML() now throws a ValueError.
115
- > Passing a string containing NULL bytes previously emitted a
131
+ . Passing a string containing NULL bytes previously emitted a
116
132
warning and now throws a ValueError as well.
117
133
. XMLWriter:
118
- > Passing a string containing NULL bytes previously emitted a
134
+ . Passing a string containing NULL bytes previously emitted a
119
135
warning and now throws a ValueError as well.
120
136
. XSL:
121
- > XSLTProcessor::setParameter() will now throw a ValueError when its
137
+ . XSLTProcessor::setParameter() will now throw a ValueError when its
122
138
arguments contain null bytes. This never actually worked correctly in
123
139
the first place, which is why it throws an exception nowadays.
124
- > Calling XSLTProcessor::importStyleSheet() with a non-XML object now
140
+ . Calling XSLTProcessor::importStyleSheet() with a non-XML object now
125
141
throws a TypeError instead of a ValueError.
126
- > Failure to call a PHP function callback during evaluation now throws
142
+ . Failure to call a PHP function callback during evaluation now throws
127
143
instead of emitting a warning.
128
144
RFC: https://wiki.php.net/rfc/improve_callbacks_dom_and_xsl
129
145
@@ -607,34 +623,15 @@ PHP 8.4 UPGRADE NOTES
607
623
. trigger_error() and user_error() now have a return type of true instead of
608
624
bool.
609
625
610
- - Curl:
611
- . curl_multi_select throws a ValueError if the timeout argument if it's negative
612
- or greater than PHP_INT_MAX.
613
-
614
626
- DOM:
615
627
. DOMDocument::registerNodeClass() now has a tentative return type of true.
616
628
Previously, the return type was bool but only true could be returned in practice.
617
629
618
- - GD:
619
- . imagejpeg/imagewebp/imagepng/imageavif throws an exception if an invalid
620
- quality parameter value is passed. In addition, imageavif will throw an exception
621
- if an invalid speed parameter value is passed.
622
- . imagescale throws an exception if the width/height argument underflows/overflows or
623
- if the mode argument is invalid.
624
- imagefilter with IMG_FILTER_SCATTER throws an exception if the sub/plus arguments
625
- underflows/overflows.
626
-
627
- - Gettext:
628
- . bind_textdomain_codeset, textdomain and d(*)gettext functions now throw an exception
629
- if the domain argument is empty.
630
-
631
630
- Hash:
632
631
. Changed the return type of hash_update() to true. It was already the case that only
633
632
true could be returned, but the stub was not updated yet.
634
633
635
634
- Intl:
636
- . IntlDateFormatter::__construct() throws a ValueError if the locale is invalid.
637
- . NumberFormatter::__construct() throws a ValueError if the locale is invalid.
638
635
. NumberFormatter::ROUND_TOWARD_ZERO and NumberFormatter::ROUND_AWAY_FROM_ZERO
639
636
have been added as aliases for NumberFormatter::ROUND_DOWN and
640
637
NumberFormatter::ROUND_UP to be consistent with the new PHP_ROUND_* modes.
0 commit comments