PHP 8.2 Codex Changelog

Newly added Improvements Changed Deprecations Removals
INI Directives 3 1
Extensions 1
Constants 132 4 1
Attributes 2
Classes 9 6
Functions 12 48 122 2
Interfaces 2

Newly added

INI Directives

Global

Extensions

Global

Constants

curl

date

dba

fileinfo

filter

sockets

standard

Attributes

Core

Classes

Core

ext-random

Functions

ext-curl

ext-imap

ext-libxml

ext-mysqli

ext-oci8

ext-odbc

ext-openssl

ext-sodium

Core

Interfaces

ext-random

Removals

INI Directives

Global

Changed

Classes

Core

ext-oci8

ext-soap

  • SoapServer

    Cloning class objects is no longer allowed

Core

Functions

ext-ftp

ext-hash

ext-imap

ext-ldap

ext-mysqli

ext-oci8

ext-odbc

ext-openssl

ext-random

ext-sodium

Core

Constants

imap

pcntl

random

  • MT_RAND_MT19937

    Constant moved from standard extension to random extension

  • MT_RAND_PHP

    Constant moved from standard extension to random extension

Improvements

Functions

Core

  • restore_exception_handler

    Return type changed: bool to true

    - restore_exception_handler(): bool
    + restore_exception_handler(): true
  • restore_error_handler

    Return type changed: bool to true

    - restore_error_handler(): bool
    + restore_error_handler(): true

ext-dba

  • dba_delete

    Parameter type added for parameter #1 ($key): array|string

    - dba_delete($key, $dba): bool
    + dba_delete(array|string $key, $dba): bool
  • dba_replace

    Parameter type added for parameter #1 ($key): array|string

      dba_replace(
    -     $key,
    +     array|string $key,
          string $value,
          $dba
        ): bool
  • dba_popen
    • Optional parameter added - #5: int $map_size = 0
    • Optional parameter added - #6: ?int $flags = null
     dba_popen(
    -    $path,
    -    $mode,
    -    $handler = <default>,
    -    ...$handler_params
    +    string $path,
    +    string $mode,
    +    ?string $handler = null,
    +    int $permission = 0644,
    +    int $map_size = 0,
    +    ?int $flags = null
       )
  • dba_open
    • Optional parameter added - #5: int $map_size = 0
    • Optional parameter added - #6: ?int $flags = null
     dba_open(
    -    $path,
    -    $mode,
    -    $handler = <default>,
    -    ...$handler_params
    +    string $path,
    +    string $mode,
    +    ?string $handler = null,
    +    int $permission = 0644,
    +    int $map_size = 0,
    +    ?int $flags = null
       )
  • dba_insert

    Parameter type added for parameter #1 ($key): array|string

      dba_insert(
    -     $key,
    +     array|string $key,
          string $value,
          $dba
        ): bool
  • dba_fetch
    • Parameter type added for parameter #1 ($key): array|string
    • Parameter name of parameter #2 changed: $skip to $dba
    • Parameter name of parameter #3 changed: $dba to $skip
    • Parameter default value changed for position #3 ($skip): <default> to 0
      dba_fetch(
    -     $key,
    +     array|string $key,
    -     $skip,
    +     $dba,
    -     $dba = <default>
    +     $skip = 0
        ): string|false
  • dba_exists

    Parameter type added for parameter #1 ($key): array|string

    - dba_exists($key, $dba): bool
    + dba_exists(array|string $key, $dba): bool

ext-dom

  • dom_import_simplexml

    Return type changed: DOMElement to DOMAttr|DOMElement

    - dom_import_simplexml(object $node): DOMElement
    + dom_import_simplexml(object $node): DOMAttr|DOMElement

ext-gd

  • imagecolorset

    Return type changed: ?bool to ?false

      imagecolorset(
          GdImage $image,
          int $color,
          int $red,
          int $green,
          int $blue,
          int $alpha = 0
    -   ): ?bool
    +   ): ?false

ext-mbstring

  • mb_get_info

    Return type changed: array|string|int|false to array|string|int|false|null

    - mb_get_info(string $type = "all"): array|string|int|false
    + mb_get_info(string $type = "all"): array|string|int|false|null

ext-mysqli

  • mysqli_stmt_close

    Return type changed: bool to true

    - mysqli_stmt_close(mysqli_stmt $statement): bool
    + mysqli_stmt_close(mysqli_stmt $statement): true
  • mysqli_close

    Return type changed: bool to true

    - mysqli_close(mysqli $mysql): bool
    + mysqli_close(mysqli $mysql): true
  • mysqli_debug

    Return type changed: bool to true

    - mysqli_debug(string $options): bool
    + mysqli_debug(string $options): true
  • mysqli_ssl_set

    Return type changed: bool to true

      mysqli_ssl_set(
          mysqli $mysql,
          ?string $key,
          ?string $certificate,
          ?string $ca_certificate,
          ?string $ca_path,
          ?string $cipher_algos
    -   ): bool
    +   ): true

ext-openssl

  • openssl_csr_new
    • Return type changed: OpenSSLCertificateSigningRequest|false to OpenSSLCertificateSigningRequest|bool
    • Attribute added for parameter $private_key: #[SensitiveParameter]
      openssl_csr_new(
          array $distinguished_names,
          &$private_key,
          ?array $options = null,
          ?array $extra_attributes = null
    -   ): OpenSSLCertificateSigningRequest|false
    +   ): OpenSSLCertificateSigningRequest|bool

ext-sodium

  • sodium_crypto_generichash_update

    Return type changed: bool to true

    - sodium_crypto_generichash_update(string &$state, string $message): bool
    + sodium_crypto_generichash_update(string &$state, string $message): true

ext-SPL

  • iterator_to_array

    Parameter type changed for parameter #1 ($iterator): Traversable to Traversable|array

    - iterator_to_array(Traversable $iterator, bool $preserve_keys = true): array
    + iterator_to_array(Traversable|array $iterator, bool $preserve_keys = true): array
  • iterator_count

    Parameter type changed for parameter #1 ($iterator): Traversable to Traversable|array

    - iterator_count(Traversable $iterator): int
    + iterator_count(Traversable|array $iterator): int

Core

  • ksort

    Return type changed: bool to true

    - ksort(array &$array, int $flags = SORT_REGULAR): bool
    + ksort(array &$array, int $flags = SORT_REGULAR): true
  • krsort

    Return type changed: bool to true

    - krsort(array &$array, int $flags = SORT_REGULAR): bool
    + krsort(array &$array, int $flags = SORT_REGULAR): true
  • phpinfo

    Return type changed: bool to true

    - phpinfo(int $flags = INFO_ALL): bool
    + phpinfo(int $flags = INFO_ALL): true
  • phpcredits

    Return type changed: bool to true

    - phpcredits(int $flags = CREDITS_ALL): bool
    + phpcredits(int $flags = CREDITS_ALL): true
  • passthru

    Return type changed: ?bool to ?false

    - passthru(string $command, &$result_code = null): ?bool
    + passthru(string $command, &$result_code = null): ?false
  • usort

    Return type changed: bool to true

    - usort(array &$array, callable $callback): bool
    + usort(array &$array, callable $callback): true
  • uksort

    Return type changed: bool to true

    - uksort(array &$array, callable $callback): bool
    + uksort(array &$array, callable $callback): true
  • uasort

    Return type changed: bool to true

    - uasort(array &$array, callable $callback): bool
    + uasort(array &$array, callable $callback): true
  • openlog

    Return type changed: bool to true

      openlog(
          string $prefix,
          int $flags,
          int $facility
    -   ): bool
    +   ): true
  • sort

    Return type changed: bool to true

    - sort(array &$array, int $flags = SORT_REGULAR): bool
    + sort(array &$array, int $flags = SORT_REGULAR): true
  • array_walk

    Return type changed: bool to true

      array_walk(
          object|array &$array,
          callable $callback,
          mixed $arg = <default>
    -   ): bool
    +   ): true
  • syslog

    Return type changed: bool to true

    - syslog(int $priority, string $message): bool
    + syslog(int $priority, string $message): true
  • shuffle

    Return type changed: bool to true

    - shuffle(array &$array): bool
    + shuffle(array &$array): true
  • array_walk_recursive

    Return type changed: bool to true

      array_walk_recursive(
          object|array &$array,
          callable $callback,
          mixed $arg = <default>
    -   ): bool
    +   ): true
  • register_shutdown_function

    Return type changed: ?bool to void

    - register_shutdown_function(callable $callback, mixed ...$args): ?bool
    + register_shutdown_function(callable $callback, mixed ...$args): void
  • closelog

    Return type changed: bool to true

    - closelog(): bool
    + closelog(): true
  • asort

    Return type changed: bool to true

    - asort(array &$array, int $flags = SORT_REGULAR): bool
    + asort(array &$array, int $flags = SORT_REGULAR): true
  • arsort

    Return type changed: bool to true

    - arsort(array &$array, int $flags = SORT_REGULAR): bool
    + arsort(array &$array, int $flags = SORT_REGULAR): true

ext-xml

  • xml_set_end_namespace_decl_handler

    Return type changed: bool to true

    - xml_set_end_namespace_decl_handler(XMLParser $parser, $handler): bool
    + xml_set_end_namespace_decl_handler(XMLParser $parser, $handler): true
  • xml_set_character_data_handler

    Return type changed: bool to true

    - xml_set_character_data_handler(XMLParser $parser, $handler): bool
    + xml_set_character_data_handler(XMLParser $parser, $handler): true
  • xml_set_default_handler

    Return type changed: bool to true

    - xml_set_default_handler(XMLParser $parser, $handler): bool
    + xml_set_default_handler(XMLParser $parser, $handler): true
  • xml_set_element_handler

    Return type changed: bool to true

      xml_set_element_handler(
          XMLParser $parser,
          $start_handler,
          $end_handler
    -   ): bool
    +   ): true
  • xml_set_object

    Return type changed: bool to true

    - xml_set_object(XMLParser $parser, object $object): bool
    + xml_set_object(XMLParser $parser, object $object): true
  • xml_set_processing_instruction_handler

    Return type changed: bool to true

    - xml_set_processing_instruction_handler(XMLParser $parser, $handler): bool
    + xml_set_processing_instruction_handler(XMLParser $parser, $handler): true
  • xml_set_notation_decl_handler

    Return type changed: bool to true

    - xml_set_notation_decl_handler(XMLParser $parser, $handler): bool
    + xml_set_notation_decl_handler(XMLParser $parser, $handler): true
  • xml_set_unparsed_entity_decl_handler

    Return type changed: bool to true

    - xml_set_unparsed_entity_decl_handler(XMLParser $parser, $handler): bool
    + xml_set_unparsed_entity_decl_handler(XMLParser $parser, $handler): true
  • xml_set_start_namespace_decl_handler

    Return type changed: bool to true

    - xml_set_start_namespace_decl_handler(XMLParser $parser, $handler): bool
    + xml_set_start_namespace_decl_handler(XMLParser $parser, $handler): true
  • xml_set_external_entity_ref_handler

    Return type changed: bool to true

    - xml_set_external_entity_ref_handler(XMLParser $parser, $handler): bool
    + xml_set_external_entity_ref_handler(XMLParser $parser, $handler): true

Deprecations

Functions

Core

Constants

mysqli

  • MYSQLI_IS_MARIADB

    Constant deprecated

    var_dump(MYSQLI_IS_MARIADB);
    // 
    Constant MYSQLI_IS_MARIADB is deprecated
Subscribe to PHP.Watch newsletter for monthly updates

You will receive an email on last Wednesday of every month and on major PHP releases with new articles related to PHP, upcoming changes, new features and what's changing in the language. No marketing emails, no selling of your contacts, no click-tracking, and one-click instant unsubscribe from any email you receive.