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 · 6 comments
Open

PHP 8.4 documentation tracker #3872

Girgias opened this issue Oct 15, 2024 · 6 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 (not yet live): 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:

  • New extension features
  • Other changes for extensions (be that general or for functions)

Important

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

Migration Guide

  • Finish TODO comments in the 8.4 migration guide

Core

  • New features:
  • Deprecated
    • Implicitly nullable parameter
    • Raising zero to the power of negative number
    • Using underscore _ as class name
    • trigger_error() with E_USER_ERROR
    • E_STRICT constant
  • BC Break:
    • exit() behavioural changes
    • Recursion during comparison
    • Indirect Modification of readonly Properties
    • Temporary Filename Length
    • Removal of E_STRICT error level
  • Changed Functions:
    • trigger_error() and user_error() have a return type of true instead of bool now
  • Other Changes:
    • Closures names
    • Fibers
      • 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:
    • Flushing headers without a body will now succeed.
    • Status page has a new field to display a memory peak.
    • The /dev/poll events.mechanism setting for Solaris/Illumos had been retired.
  • 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

  • ext/date
  • ext/intl
  • ext/pdo
  • ext/reflection
  • ext/spl
  • ext/sqlite
  • ext/xmlreader

New warnings and exceptions

  • cURL:
  • GD: ([PHP 8.4] Add errors for GD functions #3962)
    • imagejpeg(), imagepng(), imageavif(), imagewebp() now throw a ValueError if $quality is invalid
    • imageavif() now throw a ValueError if $speed is invalid
    • imagescale() now throw a ValueError if $mode is invalid
    • imagescale() now throw a ValueError if $width or $height over/underflows
    • imagefilter() now throw a ValueError with the IMG_FILTER_SCATTER filter if $sub or $plus over/underflows
  • GetText: ([PHP 8.4] Add errors for GetText functions #3964)
    • bind_textdomain_codeset(), textdomain(), d*gettext() now throw a ValueError if $domain is the empty string
  • 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:
    • round() now throws a ValueError for invalid $mode, before interpreted as PHP_ROUND_HALF_UP
    • php_uname() now throws a ValueError for invalid $mode #3968
    • ValueError and ValueError are thrown if the "allowed_classes" option of unserialize() is not an array of class names
    • str_getcsv()
      • ValueError if $separator is not one byte long
      • ValueError if $enclosure is not one byte long
      • ValueError if $escape is not one byte long or the empty string
  • XMLReader:
    • XMLReader::open() throws ValueError if $encoding is invalid
    • XMLReader::XML() throws ValueError if $encoding is invalid
    • Passing strings that contain null bytes now throws a ValueError
  • XMLWriter:
    • Passing strings that contain null bytes now throws a ValueError
  • XSL:
    • Failure to call a PHP function callback during evaluation now throws instead of emitting a warning.
    • XSLTProcessor::importStyleSheet() throws TypeError instead of ValueError if called with non XML object
    • XSLTProcessor::setParameter() parameters that contain null bytes now throws a ValueError

Resource to Object conversions

Removed extensions

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

Extensions

Note

TODO Partially done

  • cURL:

    • Deprecated:
      • CURLOPT_BINARYTRANSFER constant
    • Other Changes:
      • The minimum libcurl version required is now 7.61.0.
      • CURLOPT_DNS_USE_GLOBAL_CACHE constant has no effect
  • 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.
  • DBA:

    • Deprecated:
      • Passing null or false to dba_key_split() is now deprecated. It would always return false in those cases.
  • DOM:

    • BC Break:
    • Deprecated:
      • The DOM_PHP_ERR constant is now deprecated.
      • The DOMDocument::$actualEncoding property is now formally deprecated.
      • The DOMDocument::$config property is now formally deprecated.
      • The DOMEntity::$actualEncoding property is now formally deprecated.
      • The DOMEntity::$encoding property is now formally deprecated.
      • The DOMEntity::$version property is now formally deprecated.
  • GMP:

    • BC Break:
      • GMP is now final
    • Other Changes:
      • Now possible to cast GMP to bool, before was a E_RECOVERABLE_ERROR
  • Hash:

    • Deprecated:
      • Passing invalid options to hash functions is now deprecated.
  • 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.
  • LDAP:

    • Deprecated:
      • 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.
  • 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.
  • 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.
  • Opcache:

    • BC Break:
      • The maximum value of the opcache.interned_strings_buffer setting on 64bit architectures is now 32767. Previously it was 4095.
      • JIT Changes:
        • Default Config
        • Fatal Error on initialization failure
  • PCNTL:

    • BC Break:
      • pcntl_sigprocmask(), pcntl_sigwaitinfo(), and pcntl_sigtimedwait() now always return false on failure, in some cases they would previously return -1.
  • PCRE:

    • TODO all changes related to lib update
    • BC Break:
      • The bundled pcre2lib has been updated to version 10.44.
  • 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.
  • 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.
  • 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
  • Random:

    • Deprecated:
      • lcg_value() is deprecated in favour of \Random\Randomizer::getFloat()
  • Reflection:

    • Deprecated:
      • ReflectionMethod::__construct() with one argument is deprecated use ReflectionMethod::createFromMethodName instead
  • Session:

    • Deprecated:
      • session_set_save_handler() with more than 2 arguments is deprecated, use 2 argument signature
      • Changing the value of the session.sid_length INI setting
      • Changing the value of the session.sid_bits_per_character INI setting
      • Changing the value of the session.use_only_cookies INI setting
      • Changing the value of the session.use_trans_sid INI setting
      • Changing the value of the session.trans_sid_tags INI setting
      • Changing the value of the session.trans_sid_hosts INI setting
      • Changing the value of the session.referer_check INI setting
      • SID constant
  • 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
  • SPL:

    • Deprecated:
      • SplFixedArray::__wakeup()
      • Escape CSV arg for SplFileObject::setCsvControl(), SplFileObject::fputcsv(), and SplFileObject::fgetcsv()
  • Standard:

    • BC Break:
      • strcspn() now correctly returns the length of the string if $characters is the empty string, instead of the length until the first null byte (Add PHP 8.4 changelog entry for strcspn() #3888)
      • http_build_query() now correctly handles backed enums
      • stream_bucket_make_writeable() and stream_bucket_new() now return an instance of StreamBucket instead of stdClass
    • Deprecated:
      • stream_context_set_option() with two arguments, use stream_context_set_options() instead (notice the trailing s)
      • Escape CSV arg for fputcsv(), fgetcsv(), and str_getcsv()
      • unserialize() strings with S tag
  • Tidy:

  • XML:

    • 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

New Functions

New Classes

  • Core
  • BCMath
    • BcMath\Number
  • DBA
    • Dba\Connection
  • 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
  • Reflection
    • ReflectionConstant
  • SOAP
    • Soap\Url
    • Soap\Sdl
  • Standard
    • RoundingMode
    • StreamBucket

New Constants

Other Changes

Note

TODO

  • Changed Functions

    • TODO
  • Standard

    • TODO
@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!

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

5 participants