Closed
Description
Pages which need to be added/modified for complete documentation of PHP 8.3:
Based of the migration guide: https://www.php.net/manual/en/migration83.php (#2780):
Note
This issue is still a Work In Progress
Core
- New features:
- Readonly Amendments
- Anonymous classes can be marked as readonly ([PHP 8.3] Add an example for readonly anonymous class #4171)
- Readonly Properties can be reinitialized during cloning ([PHP 8.3] Mention readonly props reset in
__clone()
#4172)
- Override attribute (Add Override Attribute stub #2996)
- Typed Class constants (Part Update type system documentation #2798)
- Closures created from magic functions accept named arg #4193
- final methods on trait ([PHP 8.3] Mention
final
modifier for methods coming from traits #4167) - Fetch class constant syntax ([PHP 8.3] Add class constants dynamic fetch syntax #4168)
- Static Variable Initializer ([PHP 8.3] Emphasize arbitrary expressions in static initializer #4169)
- Fallback value syntax for ini variables #4191
- Readonly Amendments
- Deprecated
- Saner Increment/Decrement operators (PHP 8.3: Describe increment/decrement operator changes #2841)
- Using the increment operator (++) on empty, non-numeric, or non-alphanumeric strings is now deprecated. Moreover, incrementing non-numeric strings is soft deprecated and the new str_increment() function should be used instead.
- Using the decrement operator (--) on empty or non-numeric strings is now deprecated.
- get_class()/get_parent_class() call without arguments ([PHP 8.3] Update
get_class
andget_parent_class
#3186)
- Saner Increment/Decrement operators (PHP 8.3: Describe increment/decrement operator changes #2841)
- Windows Support:
- BC Break:
- proc_get_status() (Document PHP 8.3 proc_get_status() change #4112)
- Uses of traits with static properties ([PHP 8.3] New behavior of static properties in traits #4182)
- Assigning a negative index to an empty array ([PHP 8.3] Assigning a negative index to an empty array #4173)
- Class constant visibility variance check ([PHP 8.3] Check variance of class constants #4183)
SAPI
- CLI:
- It is now possible to lint multiple files. ([PHP 8.3] It is now possible to lint multiple files. #2917)
Extensions
-
DateTime:
- New methods:
- DatePeriod::createFromISO8601String() (7d81260)
- New error classes
- New methods:
-
DBA:
- Deprecated:
- Calling dba_fetch() with $dba as the 3rd argument is now deprecated. ([PHP 8.3] Calling dba_fetch() with $dba as the 3rd argument is now deprecated. #2911)
- Deprecated:
-
DOM:
- New properties:
-
DOMElement::$className
-
DOMElement::$id
-
DOMNode::$isConnected
-
DOMNameSpaceNode::$isConnected
-
DOMNode::$parentElement
-
DOMNameSpaceNode::$parentElement
-
- New methods:
- DOMElement::getAttributeNames() ([PHP 8.3] New DOM methods #2922)
- DOMElement::insertAdjacentElement() ([PHP 8.3] New DOM methods #2922)
- DOMElement::insertAdjacentText() ([PHP 8.3] New DOM methods #2922)
- DOMElement::toggleAttribute() ([PHP 8.3] New DOM methods #2922)
- DOMNode::contains() ([PHP 8.3] New DOM methods #2922)
- DOMNode::getRootNode() ([PHP 8.3] New DOM methods #2922)
- DOMNode::isEqualNode() ([PHP 8.3] New DOM methods #2922)
-
DOMNameSpaceNode::contains() - DOMParentNode::replaceChildren() ([PHP 8.3] New DOM methods #2922)
- Changed methods:
- Changed DOMCharacterData::appendData() tentative return type to true.
- DOMDocument::loadHTML(), DOMDocument::loadHTMLFile(), DOMDocument::loadXML(), and DOMDocument::loadXMLFile() now have a tentative return type of bool.
- BC Break: (Document DOM BC breaks in 8.3 #2984)
- Calling DOMChildNode::after(), DOMChildNode::before(), DOMChildNode::replaceWith() on a node that has no parent is now a no-op instead of a hierarchy exception, which is the behaviour demanded by the DOM specification.
- Using the DOMParentNode and DOMChildNode methods without a document now works instead of throwing a DOM_HIERARCHY_REQUEST_ERR DOMException. This is in line with the behaviour demanded by the DOM specification.
- Calling DOMDocument::createAttributeNS() without specifying a prefix would incorrectly create a default namespace, placing the element inside the namespace instead of the attribute. This bug is now fixed.
- DOMDocument::createAttributeNS() would previously incorrectly throw a DOM_NAMESPACE_ERRNAMESPACE_ERR DOMException when the prefix was already used for a different URI. It now correctly chooses a different prefix when there's a prefix name conflict.
- New properties:
-
FFI:
- It is now possible to assign FFI\CData to other FFI\CData. Meaning CData can now be assigned to structs and fields. ([PHP 8.3] Update FFI #3188)
- Deprecated:
- Calling FFI::cast(), FFI::new(), and FFI::type() statically is now deprecated. ([PHP 8.3] Update FFI #3188)
- BC Break:
-
Intl:
- New methods:
- IntlCalendar::setDate() ([PHP 8.3] IntlCalendar setDate / setDateTime #2919)
- IntlCalendar::setDateTime() ([PHP 8.3] IntlCalendar setDate / setDateTime #2919)
- IntlGregorianCalendar::createFromDate() ([PHP 8.3] New IntlGregorianCalendar methods #2943)
- IntlGregorianCalendar::createFromDateTime() ([PHP 8.3] New IntlGregorianCalendar methods #2943)
- Deprecated:
-
The U_MULTIPLE_DECIMAL_SEPERATORS constant had been deprecated, using the U_MULTIPLE_DECIMAL_SEPARATORS constant instead is recommended.
(U_MULTIPLE_DECIMAL_* constants are not documented at this time) - The NumberFormatter::TYPE_CURRENCY constant has been deprecated. ([PHP 8.3] The NumberFormatter::TYPE_CURRENCY constant has been deprecated. #2914)
-
- Changed methods:
- datefmt_set_timezone() (and its alias IntlDateformatter::setTimeZone()) now returns true on success ([PHP 8.3] Update Intl functions return values #3093)
- IntlBreakiterator::setText() now returns false on failure ([PHP 8.3] Update Intl functions return values #3093)
- IntlChar::enumCharNames() is now returning a boolean. ([PHP 8.3] Update Intl functions return values #3093)
- New methods:
-
JSON:
- New functions:
- json_validate() ([PHP 8.3] Added json_validate function description. #2906)
- New functions:
-
LDAP:
- New functions:
- ldap_connect_wallet() ([PHP 8.3] New LDAP functions #2944)
- ldap_exop_sync() ([PHP 8.3] New LDAP functions #2944)
- Deprecated:
- Calling ldap_connect() with separate hostname and port is deprecated ([PHP 8.3] Calling ldap_connect() with separate $hostname and $port is deprecated #2912)
- New functions:
-
MBString:
- New functions:
- mb_str_pad() (Copy and modify mb_str_pad from str_pad #2750)
- Deprecated:
- Passing a negative $width to mb_strimwidth() is now deprecated. ([PHP 8.3] Passing a negative $width to mb_strimwidth() is now deprecated. #2913)
- Document changes to mbstring functions in 8.3.0 #3811
- mb_strtolower() and mb_convert_case() implement conditional casing rules for the Greek letter sigma.
- mb_decode_mimeheader() interprets underscores in QPrint-encoded MIME encoded words as required by RFC 2047
- mb_encode_mimeheader() no longer drops NUL (zero) bytes when QPrint-encoding the input string.
- mb_detect_encoding()'s "non-strict" mode now behaves as described in the documentation.
- New functions:
-
OpCache:
-
opcache_get_status()['scripts'][n]['revalidate']
now contains a Unix timestamp of when the next revalidation of the scripts timestamp is due, dictated by the opcache.revalidate_freq INI directive. ([PHP 8.3] Addopcache_get_status()
example and changelog #4240) - BC Break:
- Removed
opcache.consistency_checks
INI directive ([PHP 8.3] Removed opcache.consistency_checks INI directive #2915)
- Removed
-
-
Phar:
- Deprecated:
- Calling Phar::setStub() with a $resource and a $length is now deprecated. Such calls should be replaced by: $phar->setStub(stream_get_contents($resource)); ([PHP 8.3] Calling Phar::setStub() with a resource and a $length is now deprecated. #2916)
- BC Break:
- Deprecated:
-
POSIX: ([PHP 8.3] posix documentation updates #2928)
- Modified functions:
- posix_getrlimit() now takes an optional $res parameter to allow fetching a single resource limit.
- posix_isatty() now raises type warnings for integers following the usual ZPP semantics.
- posix_ttyname() now raises type warnings for integers following the usual ZPP semantics and value warnings for invalid file descriptor integers.
- New functions:
- posix_sysconf()
- posix_pathconf()
- posix_fpathconf()
- posix_eaccess()
- Modified functions:
-
PGSQL:
- Modified functions:
- pg_fetch_object() now raises a ValueError instead of an Exception when the $constructor_args argument is non empty with the class not having constructor. ([PHP 8.3] Update PGSQL #3187)
- pg_insert() now raises a ValueError instead of a E_WARNING when the table specified is invalid. ([PHP 8.3] Update PGSQL #3187)
- pg_insert() and pg_convert() raises a ValueError or a TypeError instead of a E_WARNING when the value/type of a field does not match properly with a PostgreSQL's type. ([PHP 8.3] Update PGSQL #3187)
- The $row parameter of pg_fetch_result(), pg_field_prtlen(), and pg_field_is_null() is now nullable. ([PHP 8.3] Update PGSQL #3187)
- New functions: (Pgsql 83 upd #2934)
- pg_set_error_context_visibility() (libpq >= 9.6)
- pg_enter_pipeline_mode()
- pg_exit_pipeline_mode()
- pg_pipeline_sync()
- pg_pipeline_status()
- Modified functions:
-
Random:
- New methods: (random: Add stubs generated from php-src stubs #2815, random: Add initial contents for the PHP 8.3 methods #2818)
- Random\Randomizer::getBytesFromString() (Randomizer::getBytesFromString(): Write documentation #2824)
- Random\Randomizer::nextFloat() (Randomizer::nextFloat(): Add caution note #2825)
- Random\Randomizer::getFloat()
- Deprecated:
- The MT_RAND_PHP Mt19937 variant is deprecated. (MT_RAND_PHP: Indicate deprecation #2829)
- Changed functions:
- Changed mt_srand() and srand() to not check the number of arguments to determine whether a random seed should be used. ([PHP 8.3] Update
mt-srand
andsrand
functions #3095)
- Changed mt_srand() and srand() to not check the number of arguments to determine whether a random seed should be used. ([PHP 8.3] Update
- New methods: (random: Add stubs generated from php-src stubs #2815, random: Add initial contents for the PHP 8.3 methods #2818)
-
Reflection:
- New methods:
- ReflectionMethod::createFromMethodName() ([PHP 8.3] ReflectionMethod::createFromMethodName #2927)
- Deprecated:
- Calling ReflectionProperty::setValue() with only one parameter is deprecated. To set static properties, pass null as the first parameter. (Document ReflectionProperty::setValue PHP 8.3 deprecation #2594)
- Changed methods:
- Return type of ReflectionClass::getStaticProperties() is no longer nullable. ([PHP 8.3] Return type of ReflectionClass::getStaticProperties() is no longer nullable. #2920)
- New methods:
-
SNMP:
- BC Break:
- The type of SNMP class constants are now declared. (Add missing class constants with empty description - part 4 #2160)
- BC Break:
-
Sockets:
- New functions:
- socket_atmark() ([PHP 8.3] Adding new socket_atmark call. #2946)
- New functions:
-
Standard:
- New functions:
- str_increment() (Document str_increment() and str_decrement() #2797)
- str_decrement() (Document str_increment() and str_decrement() #2797)
- Deprecated:
- assertions: (PHP 8.3: legacy assertion have been deprecated #2840)
- The assert_options() function is now deprecated.
- The ASSERT_ACTIVE, ASSERT_BAIL, ASSERT_CALLBACK, ASSERT_EXCEPTION, and ASSERT_WARNING constants have been deprecated.
- The assert.* INI settings have been deprecated.
- assertions: (PHP 8.3: legacy assertion have been deprecated #2840)
- BC Break:
- Changed functions:
- E_NOTICEs emitted by unserialize() have been promoted to E_WARNING. ([PHP 8.3] Update functions #3106)
- unserialize() now emits a new E_WARNING if the input contains unconsumed bytes. ([PHP 8.3] Mention
E_WARNING
on unconsumed input data #4174) - array_pad() is now only limited by the maximum number of elements an array can have. (Update array_pad docs for 8.3 #3174)
- strtok() raises an E_WARNING in the case token is not provided when starting tokenization. ([PHP 8.3] Update functions #3106)
- array_sum() and array_product() now warn when values in the array cannot be converted to int/float. ([PHP 8.3] Update functions #3106)
- The $decimal of number_format() now properly handles negative integers. #4200
- A new $before_needle argument has been added to strrchr().
- str_getcsv() and fgetcsv() now return an empty string instead of a string with a single null byte for the last field #4197
- New functions:
-
Streams:
- Streams can now emit the STREAM_NOTIFY_COMPLETED notification. This was previously not implemented. #3813
- New functions:
- stream_context_set_options() ([PHP 8.3] New stream_context_set_options function #2947)
-
SQLite3:
- Deprecated:
- Using exceptions is now preferred, warnings will be removed in the future. Calling SQLite3::enableExceptions(false) will trigger a deprecation warning in this version. ([PHP 8.3] Update SQLite3 #3189)
- Deprecated:
-
Zip:
- New methods:
- Deprecated:
- The ZipArchive::FL_RECOMPRESS constant is deprecated and will be removed in a future version of libzip.
Classes
- Random\IntervalBoundary (See Random\IntervalBoundary enum is not documented #3074)
New Constants
-
cURL
- CURLINFO_CAPATH (libcurl >= 7.84.0) ([PHP 8.3] New cURL constants #3089)
- CURLINFO_CAINFO (libcurl >= 7.84.0) ([PHP 8.3] New cURL constants #3089)
- CURLOPT_MIME_OPTIONS (libcurl >= 7.81.0) ([PHP 8.3] New cURL constants #3089)
- CURLMIMEOPT_FORMESCAPE (libcurl >= 7.81.0) ([PHP 8.3] New cURL constants #3089)
- CURLOPT_WS_OPTIONS (libcurl >= 7.86.0) ([PHP 8.3] New cURL constants #3089)
- CURLWS_RAW_MODE (libcurl >= 7.86.0) ([PHP 8.3] New cURL constants #3089)
- CURLOPT_SSH_HOSTKEYFUNCTION (libcurl >= 7.84.0) ([PHP 8.3] New cURL constants #3089)
- CURLOPT_PROTOCOLS_STR (libcurl >= 7.85.0) ([PHP 8.3] New cURL constants #3089)
- CURLOPT_REDIR_PROTOCOLS_STR (libcurl >= 7.85.0) ([PHP 8.3] New cURL constants #3089)
- CURLOPT_CA_CACHE_TIMEOUT (libcurl >= 7.87.0) ([PHP 8.3] New cURL constants #3089)
- CURLOPT_QUICK_EXIT (libcurl >= 7.87.0) ([PHP 8.3] New cURL constants #3089)
- CURLKHMATCH_OK (libcurl >= 7.19.6) ([PHP 8.3] New cURL constants #3089)
- CURLKHMATCH_MISMATCH (libcurl >= 7.19.6) ([PHP 8.3] New cURL constants #3089)
- CURLKHMATCH_MISSING (libcurl >= 7.19.6) ([PHP 8.3] New cURL constants #3089)
- CURLKHMATCH_LAST (libcurl >= 7.19.6) ([PHP 8.3] New cURL constants #3089)
-
Intl (1cf6bca)
- MIXED_NUMBERS (Spoofchecker)
- HIDDEN_OVERLAY (Spoofchecker)
-
OpenSSL
- OPENSSL_CMS_OLDMIMETYPE
- PKCS7_NOOLDMIMETYPE
-
PCNTL
- SIGINFO ([PHP 8.3] New pcntl constants #3092)
-
PDO_ODBC
- PDO_ODBC_TYPE ([PHP 8.3] PDO_ODBC_TYPE #3185)
-
PGSQL ([PHP 8.3] pgsql constants update #2941)
- TODO, Update migration guide?
-
POSIX ([PHP 8.3] posix constants addition. #2931)
- POSIX_SC_ARG_MAX ([PHP 8.3] posix constants addition. #2931)
- POSIX_SC_PAGESIZE ([PHP 8.3] posix constants addition. #2931)
- POSIX_SC_NPROCESSORS_CONF ([PHP 8.3] posix constants addition. #2931)
- POSIX_SC_NPROCESSORS_ONLN ([PHP 8.3] posix constants addition. #2931)
- POSIX_PC_LINK_MAX ([PHP 8.3] posix constants addition. #2931)
- POSIX_PC_MAX_CANON ([PHP 8.3] posix constants addition. #2931)
- POSIX_PC_MAX_INPUT ([PHP 8.3] posix constants addition. #2931)
- POSIX_PC_NAME_MAX ([PHP 8.3] posix constants addition. #2931)
- POSIX_PC_PATH_MAX ([PHP 8.3] posix constants addition. #2931)
- POSIX_PC_PIPE_BUF ([PHP 8.3] posix constants addition. #2931)
- POSIX_PC_CHOWN_RESTRICTED ([PHP 8.3] posix constants addition. #2931)
- POSIX_PC_NO_TRUNC ([PHP 8.3] posix constants addition. #2931)
- POSIX_PC_ALLOC_SIZE_MIN ([PHP 8.3] posix constants addition. #2931)
- POSIX_PC_SYMLINK_MAX ([PHP 8.3] posix constants addition. #2931)
-
Sockets ([PHP 8.3] socket constants update. #2948)
- SO_ATTACH_REUSEPORT_CBPF (Linux) ([PHP 8.3] socket constants update. #2948)
- SO_DETACH_BPF (Linux) ([PHP 8.3] socket constants update. #2948)
- SO_DETACH_FILTER (Linux) ([PHP 8.3] socket constants update. #2948)
- TCP_QUICKACK (Linux) ([PHP 8.3] socket constants update. #2948)
- IP_DONTFRAG (FreeBSD) ([PHP 8.3] socket constants update. #2948)
- IP_MTU_DISCOVER (Linux) ([PHP 8.3] socket constants update. #2948)
- IP_PMTUDISC_DO (Linux) ([PHP 8.3] socket constants update. #2948)
- IP_PMTUDISC_DONT (Linux) ([PHP 8.3] socket constants update. #2948)
- IP_PMTUDISC_WANT (Linux) ([PHP 8.3] socket constants update. #2948)
- IP_PMTUDISC_PROBE (Linux) ([PHP 8.3] socket constants update. #2948)
- IP_PMTUDISC_INTERFACE (Linux) ([PHP 8.3] socket constants update. #2948)
- IP_PMTUDISC_OMIT (Linux) ([PHP 8.3] socket constants update. #2948)
- AF_DIVERT (FreeBSD) ([PHP 8.3] socket constants update. #2948)
- SOL_UDPLITE ([PHP 8.3] socket constants update. #2948)
- UDPLITE_RECV_CSCOV ([PHP 8.3] socket constants update. #2948)
- UDPLITE_SEND_CSCOV ([PHP 8.3] socket constants update. #2948)
- SO_RERROR (NetBSD) ([PHP 8.3] socket constants update. #2948)
- SO_ZEROIZE (OpenBSD) ([PHP 8.3] socket constants update. #2948)
- SO_SPLICE (OpenBSD) ([PHP 8.3] socket constants update. #2948)
- TCP_REPAIR (Linux) ([PHP 8.3] socket constants update. #2948)
- SO_REUSEPORT_LB (FreeBSD) ([PHP 8.3] socket constants update. #2948)
- IP_BIND_ADDRESS_NO_PORT (Linux) ([PHP 8.3] socket constants update. #2948)
-
Zip
- ZipArchive::ER_DATA_LENGTH (libzip >= 1.10)
- ZipArchive::ER_NOT_ALLOWED (libzip >= 1.10)
- ZipArchive::AFL_RDONLY (libzip >= 1.10)
- ZipArchive::AFL_IS_TORRENTZIP (libzip >= 1.10)
- ZipArchive::AFL_WANT_TORRENTZIP (libzip >= 1.10)
- ZipArchive::AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE (libzip >= 1.10)
- ZipArchive::FL_OPEN_FILE_NOW
- ZipArchive::LENGTH_TO_END as default value for ZipArchive::addFile() and ZipArchive::replaceFile()
- ZipArchive::LENGTH_UNCHECKED (libzip >= 1.10)
Other Changes
-
Core changes
- FFI::load() is now allowed during preloading when opcache.preload_user is the current system user. ([PHP 8.3]
FFI::load
in preload scripts #4232) - In the CLI and phpdbg SAPIs, preloading does not require the opcache.preload_user directive to be set anymore when running as root. ([PHP 8.3]
opcache.preload_user
is not required when run as root #4231)
- FFI::load() is now allowed during preloading when opcache.preload_user is the current system user. ([PHP 8.3]
-
Changed Functions
- gc_status() has added 8 fields ([PHP 8.3] Update
gc_status
function #3096) - class_alias() now supports creating an alias of an internal class. (class-alias.xml: added note and change log for an internal classes #3285)
- Setting open_basedir at runtime using ini_set('open_basedir', ...); no longer accepts paths containing the parent directory (..). ([PHP 8.3] Parent dir with
open_basedir
andini_set
at runtime #4234) - The resultant HTML of highlight_string() and highlight_file() has changed. ([PHP 8.3] Update functions #3106)
- gc_status() has added 8 fields ([PHP 8.3] Update
-
Calendar
- easter_date() now supports years from 1970 to 2,000,000,000 on 64-bit systems,
-
Curl
- curl_getinfo() now supports two new constants: CURLINFO_CAPATH and CURLINFO_CAINFO. ([PHP 8.3] Update
curl_getinfo
function #3090)
- curl_getinfo() now supports two new constants: CURLINFO_CAPATH and CURLINFO_CAINFO. ([PHP 8.3] Update
-
Gd
- The signature of imagerotate() has changed.
-
mysqli
- mysqli_fetch_object() now raises a ValueError instead of an Exception ([PHP 8.3] Update mysqli #3184)
- mysqli_poll() now raises a ValueError when neither the $read nor the $error arguments are passed. ([PHP 8.3] Update mysqli #3184)
- mysqli_field_seek() and mysqli_result::field_seek() now specify the return type as true instead of bool. ([PHP 8.3] Update mysqli #3184)
-
ODBC
- odbc_autocommit() now accepts null for the $enable parameter. ([PHP 8.3] odbc_autocommit $enable parameter is now nullable. #2921)
-
Standard
- password_hash() will now chain the underlying Random\RandomException as the ValueError's $previous Exception when salt generation fails. ([PHP 8.3]
ValueError
's previous exception is now set inpassword_hash()
#4235) - If using an array as the $command for proc_open(), it must now have at least one non empty element. Otherwise a ValueError is thrown. #4204
- password_hash() will now chain the underlying Random\RandomException as the ValueError's $previous Exception when salt generation fails. ([PHP 8.3]