PHP 8.6 Codex Changelog

Newly added Improvements Changed Deprecations Removals
INI Directives 1 39
Constants 47 11 2
Classes 24 1 2
Extensions 2
Functions 17 27 26 15
Enums 15
Interfaces 1

Changed

INI Directives

Global

Constants

curl

gd

pcre

Classes

ext-soap

  • SoapClient

    Cloning class objects is no longer allowed

Removals

Extensions

Global

Classes

ext-PDO_Firebird

ext-xmlrpc

Functions

Core

ext-xmlrpc

Newly added

INI Directives

Global

Constants

Core

curl

mysqli

openssl

pgsql

sockets

standard

Classes

ext-date

ext-intl

ext-openssl

Core

ext-uri

Functions

ext-gmp

ext-intl

ext-mysqli

ext-pgsql

ext-snmp

Core

ext-uri

Enums

ext-snmp

Core

ext-uri

Interfaces

Core

Improvements

Functions

ext-filter

  • filter_var_array

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

      filter_var_array(
          array $array,
          array|int $options = FILTER_DEFAULT,
          bool $add_empty = true
    -   ): array|false|null
    +   ): array|false

ext-gd

  • imageaffinematrixget

    Parameter type added for parameter #2 ($options): array|float

    - imageaffinematrixget(int $type, $options): array|false
    + imageaffinematrixget(int $type, array|float $options): array|false

ext-json

ext-ldap

  • ldap_free_result

    Return type changed: bool to true

    - ldap_free_result(LDAP\Result $result): bool
    + ldap_free_result(LDAP\Result $result): true

ext-openssl

  • openssl_encrypt

    Parameter type changed for parameter #7 ($aad): string to ?string

      openssl_encrypt(
          string $data,
          string $cipher_algo,
          string $passphrase,
          int $options = 0,
          string $iv = "",
          &$tag = null,
    -     string $aad = "",
    +     ?string $aad = "",
          int $tag_length = 16
        ): string|false
  • openssl_sign
    • Optional parameter added - #6: int $salt_length = OPENSSL_RSA_PSS_SALTLEN_AUTO
     openssl_sign(
         string $data,
         &$signature,
         $private_key,
         string|int $algorithm = OPENSSL_ALGO_SHA1,
    -    int $padding = 0
    +    int $padding = 0,
    +    int $salt_length = OPENSSL_RSA_PSS_SALTLEN_AUTO
       ): bool
  • openssl_verify
    • Optional parameter added - #6: int $salt_length = OPENSSL_RSA_PSS_SALTLEN_AUTO
     openssl_verify(
         string $data,
         string $signature,
         $public_key,
         string|int $algorithm = OPENSSL_ALGO_SHA1,
    -    int $padding = 0
    +    int $padding = 0,
    +    int $salt_length = OPENSSL_RSA_PSS_SALTLEN_AUTO
       ): int|false
  • openssl_decrypt

    Parameter type changed for parameter #7 ($aad): string to ?string

      openssl_decrypt(
          string $data,
          string $cipher_algo,
          string $passphrase,
          int $options = 0,
          string $iv = "",
          ?string $tag = null,
    -     string $aad = ""
    +     ?string $aad = ""
        ): string|false

ext-pcntl

  • pcntl_signal
    • Parameter type changed for parameter #3 ($restart_syscalls): bool to ?bool
    • Parameter default value changed for position #3 ($restart_syscalls): true to null
      pcntl_signal(
          int $signal,
          $handler,
    -     bool $restart_syscalls = true
    +     ?bool $restart_syscalls = null
        ): bool

ext-readline

  • readline_completion_function

    Return type changed: bool to true

    - readline_completion_function(callable $callback): bool
    + readline_completion_function(callable $callback): true

ext-snmp

  • snmp_set_oid_output_format

    Parameter type changed for parameter #1 ($format): int to Snmp\OidOutput|int

    - snmp_set_oid_output_format(int $format): true
    + snmp_set_oid_output_format(Snmp\OidOutput|int $format): true
  • snmp_set_oid_numeric_print

    Parameter type changed for parameter #1 ($format): int to Snmp\OidOutput|int

    - snmp_set_oid_numeric_print(int $format): true
    + snmp_set_oid_numeric_print(Snmp\OidOutput|int $format): true

ext-sockets

  • socket_addrinfo_lookup
    • Optional parameter added - #4: &$error_code = null
     socket_addrinfo_lookup(
         string $host,
         ?string $service = null,
    -    array $hints = []
    +    array $hints = [],
    +    &$error_code = null
       ): array|false
  • socket_cmsg_space

    Return type changed: ?int to int

      socket_cmsg_space(
          int $level,
          int $type,
          int $num = 0
    -   ): ?int
    +   ): int

Core

ext-zip

  • zip_entry_close

    Return type changed: bool to true

      #[\Deprecated]
    - zip_entry_close($zip_entry): bool
    + zip_entry_close($zip_entry): true

Deprecations

Functions

ext-mbstring

ext-mysqli

ext-SPL

Core

Constants

mbstring

  • MB_ONIGURUMA_VERSION

    Constant deprecated

    var_dump(MB_ONIGURUMA_VERSION);
    // 6.9.9
    Constant MB_ONIGURUMA_VERSION is deprecated since 8.6, because the underlying library is no longer maintained

standard

  • SORT_LOCALE_STRING

    Constant deprecated

    var_dump(SORT_LOCALE_STRING);
    // 5
    Constant SORT_LOCALE_STRING is deprecated since 8.6, use one of the Collator::*sort*() methods instead
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.