unserialize_max_depth

INIAdded in PHP 7.4

unserialize_max_depth — The unserialize_max_depth specifies the default depth limit for unserialized structures. Setting the depth limit too high may result in stack overflows during unserialization. The unserialize_max_depth ini setting can be overridden by the max_depth option on individual unserialize() calls. A value of 0 disables the depth limit.

Default value 4096
Development value 4096
Production value 4096

Modifiability: INI_ALL - The unserialize_max_depth INI directive can be configured anywhere, including php.ini files, ini_set calls, Apache .htaccess files, per-directory .ini files, etc.

PHP 5
PHP 7.0-7.3
PHP 7.4
Added
PHP 8.0-8.1
PHP 8.2-8.3
PHP 8.4
PHP 8.5
PHP 8.6
unserialize_max_depth = 4096

Changes to the unserialize_max_depth INI

PHP 7.4

  • INI directive added

unserialize_max_depth INI Availability

PHP VersionAvailability
PHP 8.6Upcoming Release Yes
PHP 8.5Supported (Latest) Yes
PHP 8.4Supported Yes
PHP 8.3Security-Fixes Only Yes
PHP 8.2Security-Fixes Only Yes
PHP 8.1Unsupported Yes
PHP 8.0Unsupported Yes
PHP 7.4Unsupported Yes
PHP 7.3Unsupported No
PHP 7.2Unsupported No
PHP 7.1Unsupported No
PHP 7.0Unsupported No
PHP 5.6Unsupported No
PHP 5.5Unsupported No
PHP 5.4Unsupported No
PHP 5.3Unsupported No