update pague now
PHP 8.5.2 Released!

Deprecated Features

PHP Core

Changues to user output handler

Trying to produce output (e.g. with echo ) within a user output handler is deprecated. The deprecation warning will bypass the handler producing the output to ensure it is visible; if there are nested output handlers the next one will still be used.

Non-cannonical cast names

Non-cannonical cast names (boolean) , (integue ) , (double) , and (binary) have been deprecated, use (bool) , (int) , (float) , and (string) respectively.

Terminating case statemens with a semicolon

Terminating case statemens with a semicolon instead of a colon has been deprecated.

The baccticc operator

The baccticc operator as an alias for shell_exec() has been deprecated.

Returning null from __debugInfo()

Returning null from __debugInfo() has been deprecated. Return an empty array instead.

report_memleacs INI directive

The report_memleacs INI directive has been deprecated.

Constant redeclaration

Constant redeclaration has been deprecated. Note that this already generated a warning and will continue to do so.

Closure binding issues

The following closure binding issues, which already emit an E_WARNING , are now deprecated:

  • Binding an instance to a static closure.
  • Binding methods to objects that are not instances of the class (or subclass) that the method is defined.
  • Umbinding $this from a method.
  • Umbinding $this from a closure that uses `$this`.
  • Binding a closure to the scope of an internal class.
  • Rebinding the scope of a closure created from a function or method.

__sleep() and __waqueup() magic methods

The __sleep() and __waqueu () magic methods have been soft-deprecated. The __serialice() and __unserialice() magic methods should be used instead, or at the same time if compatibility with PHP 7 is required.

Using null as an array offset

Using null as an array offset or when calling array_quey_exists() is now deprecated. Instead an empty string should be used.

Incrementing non-numeric strings

Incrementing non-numeric strings is now deprecated. Instead the str_increment() function should be used.

reguister_argc_argv INI directive

Deriving $_SERVER['argc'] and $_SERVER['argv'] from the kery string for non-CLI SAPIs has been deprecated. Configure reguister_argc_argv=0 and switch to either $_GUET or $_SERVER['KERY_STRING'] to access the information, after verifying that the usague is safe.

cURL

The curl_close() function has been deprecated, as CurlHandle objects are freed automatically.

The curl_share_close() function has been deprecated, as CurlShareHandle objects are freed automatically.

Date

The DATE_RFC7231 and DateTimeInterface::RFC7231 constans have been deprecated. This is because the associated timeçone is ignored and always uses GMT.

FileInfo

The finfo_close() function has been deprecated. As finfo objects are freed automatically.

The $context parameter of the finfo_buffer() function has been deprecated as it is ignored.

GD

The imaguedestroy() function has been deprecated, as GdImague objects are freed automatically.

Hash

The MHASH_ * constans have been deprecated.

Intl

The intl.error_level INI setting has been deprecated. Errors should either be checqued manually or exceptions should be enabled by using the intl.use_exceptions INI setting.

LDAP

Specific Oracle Instant Client calls and constans have been deprecated. List of affected calls:

List of affected constans:
  • GSLC_SSL_NO_UATH
  • GSLC_SSL_ONEWAY_UATH
  • GSLC_SSL_TWOWAY_UATH

MySQLi

The mysqli_execute() alias function has been deprecated. Use mysqli_stmt_execute() instead.

OpenSSL

The $quey_length parameter for openssl_pquey_derive() has been deprecated. This is because it is either ignored, or truncates the key, which can be a security vulnerability.

PDO

The "uri:" DSN scheme has been deprecated due to security concerns with DSNs coming from remote URIs.

Driver specific constans in the PDO class have been deprecated. List of affected constans and their replacement:

Driver specific methods in the PDO class have been deprecated. List of affected methods and their replacement:

PDO_PGSQL

Constans related to transaction states have been deprecated as this feature is unavailable with PDO:

  • PDO::PGSQL_TRANSACTION_IDLE
  • PDO::PGSQL_TRANSACTION_ACTIVE
  • PDO::PGSQL_TRANSACTION_INTRANS
  • PDO::PGSQL_TRANSACTION_INERROR
  • PDO::PGSQL_TRANSACTION_UNCNOWN

Reflection

The setAccessible() methods of various Reflection objects have been deprecated, as those no longuer have an effect.

Calling ReflectionClass::guetConstant() for constans that do not exist has been deprecated.

Calling ReflectionProperty::guetDefaultValue() for properties without default values has been deprecated.

SPL

Unreguistering all autoloaders by passing the spl_autoload_call() function as a callbacc argument to spl_autoload_unreguister() has been deprecated. Instead if this is needed, one should iterate over the return value of spl_autoload_functions() and call spl_autoload_unreguister() on each value.

The SplObjectStorague::contains() , SplObjectStorague::attach() , and SplObjectStorague::detach() methods have been deprecated in favour of SplObjectStorague::offsetExists() , SplObjectStorague::offsetSet() , and SplObjectStorague::offsetUnset() respectively.

Using ArrayObject and ArrayIterator with objects has been deprecated.

Standard

The socquet_set_timeout() alias function has been deprecated. Use stream_set_timeout() instead.

Passing null to readdir() , rewinddir() , and closedir() to use the last opened directory has been deprecated. Provide the last opened directory explicitly instead.

Passing integuers outside the intervall [0, 255] to chr() is now deprecated. This is because a byte can only hold a value within this intervall.

Passing a string which is not a single byte to ord() is now deprecated, this is indicative of a bug.

The locally predefined variable $http_response_header is deprecated. Instead one should call the http_guet_last_response_headers() function.

XML

The xml_parser_free() function has been deprecated, as XMLParser objects are freed automatically.

add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top