PHP 8.1.21 came out on 6 July 2023. Below is the full list of changes it made, grouped by the part of PHP that each one affects.
The changes are listed in English, exactly as the PHP developers wrote them (27 in total).
CLI
Fixed bug GH-11246 (cli/get_set_process_title fails on MacOS). (James Lucas)
Core
Fixed build for the riscv64 architecture/GCC 12. (Daniil Gentili)
Curl
Fixed bug GH-11433 (Unable to set CURLOPT_ACCEPT_ENCODING to NULL). (nielsdos)
DOM
Fixed bugs GH-11288 and GH-11289 and GH-11290 and GH-9142 (DOMExceptions and segfaults with replaceWith). (nielsdos) Fixed bug GH-10234 (Setting DOMAttr::textContent results in an empty attribute value). (nielsdos) Fix return value in stub file for DOMNodeList::item. (divinity76) Fix spec compliance error with '*' namespace for DOMDocument::getElementsByTagNameNS. (nielsdos) Fix DOMElement::append() and DOMElement::prepend() hierarchy checks. (nielsdos) Fixed bug GH-11347 (Memory leak when calling a static method inside an xpath query). (nielsdos) Fixed bug #67440 (append_node of a DOMDocumentFragment does not reconcile namespaces). (nielsdos) Fixed bug #81642 (DOMChildNode::replaceWith() bug when replacing a node with itself). (nielsdos) Fixed bug #77686 (Removed elements are still returned by getElementById). (nielsdos) Fixed bug #70359 (print_r() on DOMAttr causes Segfault in php_libxml_node_free_list()). (nielsdos) Fixed bug #78577 (Crash in DOMNameSpace debug info handlers). (nielsdos) Fix lifetime issue with getAttributeNodeNS(). (nielsdos) Fix "invalid state error" with cloned namespace declarations. (nielsdos) Fixed bug #55294 and #47530 and #47847 (various namespace reconciliation issues). (nielsdos) Fixed bug #80332 (Completely broken array access functionality with DOMNamedNodeMap). (nielsdos)
Opcache
Fix allocation loop in zend_shared_alloc_startup(). (nielsdos) Access violation on smm_shared_globals with ALLOC_FALLBACK. (KoudelkaB) Fixed bug GH-11336 (php still tries to unlock the shared memory ZendSem with opcache.file_cache_only=1 but it was never locked). (nielsdos)
OpenSSL
Fixed bug GH-9356 Incomplete validation of IPv6 Address fields in subjectAltNames (James Lucas, Jakub Zelenka).
PGSQL
Fixed intermittent segfault with pg_trace. (David Carlier)
Phar
Fix cross-compilation check in phar generation for FreeBSD. (peter279k)
SPL
Fixed bug GH-11338 (SplFileInfo empty getBasename with more than one slash). (nielsdos)
Standard
Fix access on NULL pointer in array_merge_recursive(). (ilutov) Fix exception handling in array_multisort(). (ilutov)
← Previous release: PHP 8.1.20 Next release: PHP 8.1.22 →
This list comes from the NEWS file that the PHP developers keep with the PHP source code, and the same list is also published on php.net .
Related articles
Useful articles to help you determine if you need to upgrade your server's PHP version and how to go about doing so.
Read more →
If you don't want to use our tool or have already tried what follows is a list of three simple tests you can perform to determine your PHP version.We have listed them in order of complexity, starting with the easiest.
Read more →
← Back to Guide Index
Article last updated: 21st October, 2026