Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.4 documentation tracker #3872

Open
Girgias opened this issue Oct 15, 2024 · 21 comments
Open

PHP 8.4 documentation tracker #3872

Girgias opened this issue Oct 15, 2024 · 21 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@Girgias
Copy link
Member

Girgias commented Oct 15, 2024

Pages which need to be added/modified for complete documentation of PHP 8.4:

Based of the migration guide: https://www.php.net/manual/en/migration84.php (#3822):

Related to php/doc-base#165

Note

This issue is still a Work In Progress
Missing items:

  • PCRE changes
  • Changed Functions
    • PDO

Important

Priority should be given to documenting Core language and ext/standard behavioural changes

Core

New features:

Deprecated ✅

BC Break:

  • exit() behavioural changes (PHP 8.4: exit() is now a function #4070)
  • Recursion during comparison
  • Indirect Modification of readonly Properties
  • Temporary Filename Length
  • Removal of E_STRICT error level This is an internal engine change

New Functions:

  • request_parse_body

New Classes:

New Constants: ✅

Changed Functions: ✅

Other Changes:

  • Closures names
  • Fibers (Document changes related to Fibers and destructors #4060)
    • Fiber switching during destructor execution is now allowed.
    • Destructors may now be executed in a separate Fiber
    • GC triggered in Fiber behavioural change
  • Output Handlers
    • Output handler status flags are now cleared
    • output_add_rewrite_var() now uses url_rewriter.hosts INI

SAPI

apache2handler:

  • Support for EOL Apache 2.0 and 2.2 has been removed. Minimum required Apache version is now 2.4.

FPM:

CLI:

  • The builtin server looks for an index file recursively by traversing parent directories in case the specified file cannot be located.
    This process was previously skipped if the path looked like it was referring to a file,
    i.e. if the last path component contained a period.
    In that case, a 404 error was returned.
    The behavior has been changed to look for an index file in all cases.

Class constants are now typed

New warnings and exceptions

cURL: ✅

GD: ✅

GetText: ✅

Intl:

  • resourcebundle_get(), ResourceBundle::get(), and offset access for ResourceBundle
    • TypeError for invalid offset types
    • ValueError for an empty string
    • ValueError if the integer index does not fit in a signed 32 bit integer
  • IntlDateFormatter::__construct() now throws a ValueError if $locale is invalid
  • NumberFormatter::__construct() now throws a ValueError if $locale is invalid

MBstring:

  • mb_encode_numericentity(), mb_decode_numericentity() now check that $map only has integers
  • mb_http_input() throws ValueError if $type is invalid
  • mb_http_output() throws ValueError if $encoding has null bytes

ODBC:

  • odbc_fetch_row() returns false when $row =< 0, this now warns

PCNTL:

  • pcntl_sigprocmask(), pcntl_sigwaitinfo(), and pcntl_sigtimedwait
    • ValueError if $signals array is empty
    • TypeError if $signals array value is not int
    • ValueError if $signals array value is not valid signal
  • pcntl_sigprocmask()
    • ValueError if $mode is not one of SIG_BLOCK, SIG_UNBLOCK or SIG_SETMASK
  • pcntl_sigtimedwait()
    • ValueError if $seconds is less than 0
    • ValueError if $nanoseconds is less than 0
    • ValueError if $seconds and $nanoseconds are both 0

SimpleXML: ✅

Standard:

XMLReader: ✅ (#4123)

  • XMLReader::open() throws ValueError if $encoding is invalid / has nulls
  • XMLReader::XML() throws ValueError if $encoding is invalid / has nulls

XMLWriter: ✅ (#4123)

  • Passing an encoding that contain null bytes now throws a ValueError

XSL:

Resource to Object conversions

DBA: ✅

ODBC:

  • Odbc\Connection
  • Odbc\Result

Soap:

  • Soap\Url
  • Soap\Sdl

Removed extensions ✅ (#4103)

  • ext/imap
  • ext/pspell
  • ext/oci8
  • ext/pdo_oci

Extensions

cURL: ✅

Date:

  • Deprecated:
    • The DatePeriod::__construct(string $isostr, int $options = 0) signature is now deprecated. Use DatePeriod::createFromISO8601String() instead.
    • The SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, and SUNFUNCS_RET_DOUBLE constants are now deprecated. (SUNFUNCS_* constants are deprecated as of PHP 8.4.0 #4006)

DBA: ✅

DOM:

GMP:

Hash: (#4137)

  • Deprecated:
    • Passing invalid options to hash functions is now deprecated.
  • Other changes:
    • hash_update() now has a tentative return type of true instead of bool

Intl:

  • Deprecated:
    • Calling intlcal_set() or IntlCalendar::set() with more than 2 arguments is deprecated, use IntlCalendar::setDate() or IntlCalendar::setDateTime() instead.
    • Calling intlgregcal_create_instance() or IntlGregorianCalendar::__construct() with more than 2 arguments is deprecated, use IntlGregorianCalendar::createFromDate() or IntlGregorianCalendar::createFromDateTime() instead.
  • New Features:
  • Added the NumberFormatter::ROUND_HALFODD to complement the existing NumberFormatter::ROUND_HALFEVEN functionality.
  • Added NumberFormatter::ROUND_TOWARD_ZERO and NumberFormatter::ROUND_AWAY_FROM_ZERO as aliases for NumberFormatter::ROUND_DOWN and NumberFormatter::ROUND_UP to be consistent with the new RoundingMode modes.
  • Other changes:
    • ResourceBundle::get() now has a tentative return type of ResourceBundle|array|string|int|null
    • The idn_to_ascii() and idn_to_utf8() functions now always throw ValueErrors if the domain name is empty or too long.
    • The idn_to_ascii() and idn_to_utf8() functions now always throw ValueErrors if the variant parameter is not INTL_IDNA_VARIANT_UTS46.
    • The behaviour of Intl class has been normalized to always throw Error exceptions when attempting to use a non-initialized object, or when cloning fails.

LDAP:

  • Deprecated: (PHP-8.4: LDAP changes #4066)
    • Calling ldap_connect() with more than 2 arguments is deprecated, use ldap_connect_wallet() instead.
    • Calling ldap_exop() with more than 4 arguments is deprecated, use ldap_exop_sync() instead.

libxml: ✅ (#4051)

  • Other changes:
    • The minimum libxml2 version required is now 2.9.4.
    • libxml_set_streams_context() now immediately throws a TypeError when a non-stream-context resource is passed to the function, instead of throwing later when the stream context is used.

MBString:

  • BC Break:
    • On invalid strings (those with encoding errors), mb_substr() now interprets character indices in the same manner as most other mbstring functions. This means that character indices returned by mb_strpos() can be passed to mb_substr().
    • For SJIS-Mac (MacJapanese) strings, character indices passed to mb_substr() now refer to the indices of the Unicode codepoints which are produced when the string is converted to Unicode. This is significant because around 40 SJIS-Mac characters convert to a sequence of multiple Unicode codepoints.
  • Other changes:
    • The behavior of mb_strcut() is more consistent now on invalid UTF-8 and UTF-16 strings. There is no behavioural change for valid UTF-8 and UTF-16 strings.
    • Unicode data tables have been updated to Unicode 16.0.

MySQLi: ✅

MySQLnd:

  • BC Break:
    • The error code reported for MySQL server wait timeouts has been changed from 2006 to 4031 for MySQL server versions 8.0.24 and above.
  • Other changes:
    • Support for the new VECTOR data type from MySQL 9.

ODBC

  • Other changes:
    • The row of odbc_fetch_object(), odbc_fetch_array(), and odbc_fetch_into() now have a default value of null, consistent with odbc_fetch_row(). Previously, the default values were -1, -1, and 0, respectively.

Opcache:

OpenSSL:

  • New Features:
  • Other changes:
    • The extra_attributes in openssl_csr_new() sets the CSR attributes instead of subject DN, which incorrectly done previously.
    • The dn in openssl_csr_new() allows setting an array of values for a single entry.
    • New serial_hex added to openssl_csr_sign() to allow setting serial numbers in the hexadecimal format.
    • Parsing ASN.1 UTCTime with openssl_x509_parse() fails if seconds are omitted for OpenSSL version below 3.2 (-1 is returned for such fields). OpenSSL version above 3.3 did not load such certificates already.
    • The minimum OpenSSL version required is now 1.1.1.

PCNTL:

PCRE:

  • TODO all changes related to lib update
  • BC Break:
    • The bundled pcre2lib has been updated to version 10.44.
  • New Features
    • TODO
    • Added support for the r (PCRE2_EXTRA_CASELESS_RESTRICT) modifier,
      as well as the (?r) mode modifier. When enabled along with the case-insensitive modifier (i),
      the expression locks out mixing of ASCII and non-ASCII characters.
      ([PHP 8.4] PCRE - PCRE2-v10.44 updates #4078)

PDO:

  • New Features
    • Subclasses and PDO::connect()
    • Added a custom parser supporting:
      • single and double-quoted literals, with doubling as escaping mechanism
      • two-dashes and non-nested C-style comments
  • Other changes:
    • It is now possible to fetch the value of the PDO::ATTR_STRINGIFY_FETCHES attribute with PDO::getAttribute().
    • It is now possible to fetch the value of the PDO::PGSQL_ATTR_RESULT_MEMORY_SIZE attribute with PDO::getAttribute().

PDO_DBLIB:

  • BC Break:
    • The DBLIB_ATTR_STRINGIFY_UNIQUEIDENTIFIER and DBLIB_ATTR_DATETIME_CONVERT attributes are now booleans, previously they were int.

PDO_FIREBIRD:

  • BC Break:
    • The ATTR_AUTOCOMMIT attribute is now boolean, previously was int.
    • The extension now requires a C++ compiler and fbclient 3.0 or higher

PDO_MYSQL:

  • BC Break:
    • The ATTR_AUTOCOMMIT, ATTR_EMULATE_PREPARES, and MYSQL_ATTR_DIRECT_QUERY attributes are now booleans, previously they were int.
  • New Features
    • Added a custom parser supporting:
      • single and double-quoted literals, with doubling and backslash as escaping mechanism
      • backtick literal identifiers and with doubling as escaping mechanism
      • two dashes followed by at least 1 whitespace, non-nested C-style comments, and hash-comments

PDO_PGSQL:

  • BC Break:
    • The DSN's credentials, when set, are given priority over their PDO constructor counterparts, being closer to the documentation states.
  • Deprecated:
    • Using escaped question marks (??) inside dollar-quoted strings is deprecated.
  • New Features
    • Added a custom parser supporting:
      • single and double-quoted literals, with doubling as escaping mechanism
      • C-style "escape" string literals (E'string')
      • dollar-quoted string literals
      • two-dashes and C-style comments (non-nested)
      • support for ?? as escape sequence for the ? operator
  • Other changes:
    • The minimum libpq version required is now 10.0.

PGSQL:

  • Deprecated:
    • 2 argument signature of pg_fetch_result, pg_field_prtlen, and pg_field_is_null() is now deprecated, use an explicit value of null for $row parameter
  • Other changes:
    • The conditions parameter of pg_select() is now optional and accepts an empty array.
    • The minimum libpq version required is now 10.0.

PDO_SQLITE:

  • New Features
    • Added a custom parser supporting:
      • single, double-quoted, and backtick literals, with doubling as escaping mechanism
      • square brackets quoting for identifiers
      • two-dashes and C-style comments (non-nested)

Phar: ✅ (#4050)

  • New Features
    • Added support for the Unix timestamp extension for Zip archives.
  • Other changes:
    • The Phar::setAlias(), Phar::setDefaultStub() methods now have a tentative return type of true instead of bool.

POSIX:

  • Other changes:
    • posix_isatty() now sets the error number when the file descriptor/stream argument is invalid.

Random: ✅

Readline:

  • New Features
    • Added ability to change the .php_history path through the PHP_HISTFILE environment variable.

Reflection:

Session:

SimpleXML:

  • BC Break:
    • SimpleXMLElement now doesn't implicitly rewind itself.

SOAP:

  • BC Break:
    • SoapClient::$typemap is now an array instead of a resource, checks using is_resource() should be converted to check for null
    • Optional dependency on ext/session which has issues with rtld-now
  • Deprecated:
    • Passing an int to SoapServer::addFunction()
    • SOAP_FUNCTIONS_ALL constant
  • New Features
    • Added support for clark notation for namespaces in class map
    • Session persistence now works with a shared session module
    • Instances of DateTimeInterface that are passed to xsd:datetime or similar elements are now serialized as such instead of being serialized as an empty string.
  • New Classes
    • Soap\Url
    • Soap\Sdl
  • New Methods

Sockets: ✅

Sodium:

  • Other changes:
    • The sodium_crypto_aead_aes256gcm_*() functions are now available on aarch64 CPUs with the ARM cryptographic extensions.

SPL:

Standard:

Tidy: ✅

XML: ✅ (#4067)

  • BC Break:
    • The xml_set_*() functions now check for proper callables, but see related deprecations
  • Deprecated:
    • xml_set_object()
    • Passing non-callable strings to xml_set_*() functions

XSL:

ZIP:

  • New Features
    • Added the ZipArchive::ER_TRUNCATED_ZIP constant, which was added in libzip 1.11.

Zlib: ✅

New Functions

BCMath

  • bcceil
  • bcdivmod
  • bcfloor
  • bcround

Date

  • DateTime::createFromTimestamp
  • DateTime::getMicrosecond
  • DateTime::setMicrosecond
  • DateTimeImmutable::createFromTimestamp
  • DateTimeImmutable::getMicrosecond
  • DateTimeImmutable::setMicrosecond

Hash

  • HashContext::__debugInfo

Intl

MBString ✅

Opcache

  • opcache_jit_blacklist

PDO_PGSQL

  • Pdo\Pgsql::setNoticeCallback

PGSQL

XMLReader (#4138)

  • XMLReader::fromStream
  • XMLReader::fromUri
  • XMLReader::fromString

XMLWriter (#4138)

  • XMLWriter::toStream
  • XMLWriter::toUri
  • XMLWriter::toMemory

New Classes

BCMath

  • BcMath\Number

DOM

  • Dom\HTMLDocument
  • Dom\XMLDocument
  • New Dom\Node classes?

ODBC

  • Odbc\Connection
  • Odbc\Result

PDO_DBLIB

  • Pdo\DbLib

PDO_FIREBIRD

  • Pdo\Firebird

PDO_MYSQL

  • Pdo\Mysql

PDO_ODBC

  • Pdo\Odbc

PDO_PGSQL

  • Pdo\Pgsql

PDO_SQLITE

  • Pdo\Sqlite

New Constants

cURL ✅

Intl

  • PATTERN
  • PROPERTY_IDS_UNARY_OPERATOR
  • PROPERTY_ID_COMPAT_MATH_START
  • PROPERTY_ID_COMPAT_MATH_CONTINUE

LDAP

  • LDAP_OPT_X_TLS_PROTOCOL_MAX
  • LDAP_OPT_X_TLS_PROTOCOL_TLS1_3

libxml ✅

MySQLi ✅

OpenSSL

  • X509_PURPOSE_OCSP_HELPER
  • X509_PURPOSE_TIMESTAMP_SIGN

PCNTL ✅

  • SIGCKPT (DragonFlyBSD only) (Pcntl php84 #4073)
  • SIGCKPTEXIT (DragonFlyBSD only) (Pcntl php84 #4073)
  • WEXITED
  • WSTOPPED
  • WNOWAIT
  • P_ALL
  • P_PID
  • P_PGID
  • P_PIDFD (Linux only)
  • P_UID (NetBSD/FreeBSD only)
  • P_GID (NetBSD/FreeBSD only)
  • P_SID (NetBSD/FreeBSD only)
  • P_JAILID (FreeBSD only)

PGSQL

  • PGSQL_TUPLES_CHUNK

POSIX ✅

Sockets

  • SO_EXCLUSIVEADDRUSE (Windows only)
  • SOCK_CONN_DGRAM (NetBSD only)
  • SOCK_DCCP (NetBSD only)
  • TCP_SYNCNT (Linux only)
  • SO_EXCLBIND (Solaris/Illumos only)
  • SO_NOSIGPIPE (macOS and FreeBSD)
  • SO_LINGER_SEC (macOS only)
  • IP_PORTRANGE (FreeBSD/NetBSD/OpenBSD only)
  • IP_PORTRANGE_DEFAULT (FreeBSD/NetBSD/OpenBSD only)
  • IP_PORTRANGE_HIGH (FreeBSD/NetBSD/OpenBSD only)
  • IP_PORTRANGE_LOW (FreeBSD/NetBSD/OpenBSD only)
  • SOCK_NONBLOCK
  • SOCK_CLOEXEC
  • SO_BINDTOIFINDEX

Sodium ✅

XML ✅

@Girgias Girgias added help wanted Extra attention is needed good first issue Good for newcomers labels Oct 15, 2024
@Girgias Girgias added this to the PHP 8.4 milestone Oct 15, 2024
@Girgias Girgias pinned this issue Oct 15, 2024
@nielsdos
Copy link
Member

nielsdos commented Oct 20, 2024

The TODO lists:

DOMImplementation::getFeature() has been removed

However, this function was never documented and never showed up in the PHP docs, so I guess there's nothing to do here?

@Girgias
Copy link
Member Author

Girgias commented Oct 21, 2024

The TODO lists:

DOMImplementation::getFeature() has been removed

However, this function was never documented and never showed up in the PHP docs, so I guess there's nothing to do here?

Indeed, how convenient. :D

@driade
Copy link
Contributor

driade commented Oct 27, 2024

Hi, good morning.

May I suggest updating tokens.xml and constants.xml to add T_PUBLIC_SET, T_PROTECTED_SET and T_PRIVATE_SET?

#3936

@iluuu1994
Copy link
Member

@Girgias Thank you for working on this! @Crell Do you have any capacity to help out with documentation of our features?

@Crell
Copy link
Contributor

Crell commented Oct 28, 2024

@iluuu1994 Already in progress: #3898, #3828. More to come.

@iluuu1994
Copy link
Member

Great to hear, thank you Larry!

@Girgias
Copy link
Member Author

Girgias commented Nov 12, 2024

@Ayesh could you look into the cURL docs?

@devnexen could you document the POSIX/Socket/PCNTL/Intl constants?

@bukka can you document the FPM and OpenSSL changes?

@haszi can you document the Output Buffering changes?

@KentarouTakeda (or possibly @devnexen) can you document the PGSQL/PDO_PGSQL changes?

@mbeccati can you document the PDO custom parsers?

@SakiTakamachi can you document the BCMath changes?

@kamil-tekiela can you document the new MySQLi constant, and possibly the MySQLnd changes?

@devnexen
Copy link
Member

Sure Gina, will get to it sometime this weekend :)

@Girgias
Copy link
Member Author

Girgias commented Nov 13, 2024

@derickr can you document the new DateTime methods?

@mbeccati
Copy link

mbeccati commented Nov 14, 2024 via email

@Ayesh
Copy link
Member

Ayesh commented Nov 14, 2024

Hi @Girgias, thanks for the ping :)
I created #4069 to add all of the missing Curl constants and changes. All of the changes are in separate commits, but in the same PR to prevent potential merge conflicts. I also updated this issue's description with links to the PR. Please do take a look when you get some time. Thank you.

This was referenced Nov 15, 2024
@Ayesh
Copy link
Member

Ayesh commented Nov 17, 2024

I updated the issue text to tick all Curl-related changes. I think that was all of them for Curl.

@nielsdos
Copy link
Member

@Ayesh you accidentally wiped my linking, please refresh before making changes

@Ayesh
Copy link
Member

Ayesh commented Nov 17, 2024

@nielsdos I'm so sorry, I will make sure to refresh from now on :(

@nielsdos
Copy link
Member

@Ayesh
Dw too much abt it, it's more the fault of GH not auto refreshing properly and being slow to edit a large issue.

@Crell
Copy link
Contributor

Crell commented Nov 18, 2024

Added a link to the WIP hooks doc PR.

@nielsdos
Copy link
Member

@Crell I don't know what you did but take a look at your edit history diff, looks like a lot of boxes were unticked and a lot of things were changed.

@Crell
Copy link
Contributor

Crell commented Nov 18, 2024

FFS... I reloaded the page before hitting edit to avoid that!

I don't seem to have access to the history diff. (I'm just a member here, not admin.)

@nielsdos
Copy link
Member

Looks like you had an old version cached, and GH doesn't have a "restore old edit" button ffs. See also https://superuser.com/questions/1381271/restore-previous-version-of-my-comment-on-github but I'm on my phone rn...

@Girgias
Copy link
Member Author

Girgias commented Nov 18, 2024

I had it saved in my IDE as I got bitten by this already multiple times. So should be fixed now.

@SakiTakamachi
Copy link
Member

I am currently creating documentation for the class and new functions regarding bcmath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

9 participants