From 2039664e47dcafdd620af22512bd0ea3d1cb4f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 15 Jul 2025 13:36:56 +0200 Subject: [PATCH 1/7] ext/xml: Suppress libxml deprecation for `_xmlParserCtxt.inState` (#19131) The FreeBSD build fails due to the deprecation and -Werror: 2025-07-15T00:37:20.8390774Z /home/runner/work/php-src/php-src/ext/xml/compat.c:358:38: error: 'instate' is deprecated [-Werror,-Wdeprecated-declarations] 2025-07-15T00:37:20.8392577Z 358 | if (ret == NULL || parser->parser->instate == XML_PARSER_CONTENT) { 2025-07-15T00:37:20.8393184Z | ^ 2025-07-15T00:37:20.8394006Z /usr/local/include/libxml2/libxml/parser.h:309:33: note: 'instate' has been explicitly marked deprecated here 2025-07-15T00:37:20.8394903Z 309 | xmlParserInputState instate XML_DEPRECATED_MEMBER; 2025-07-15T00:37:20.8395413Z | ^ 2025-07-15T00:37:20.8396166Z /usr/local/include/libxml2/libxml/xmlexports.h:74:50: note: expanded from macro 'XML_DEPRECATED_MEMBER' 2025-07-15T00:37:20.8397058Z 74 | #define XML_DEPRECATED_MEMBER __attribute__((deprecated)) 2025-07-15T00:37:20.8397581Z | ^ 2025-07-15T00:37:20.8425542Z 1 error generated. --- ext/xml/compat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/xml/compat.c b/ext/xml/compat.c index cafb19c2c1edd..ea72a958006e2 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -355,7 +355,9 @@ get_entity(void *user, const xmlChar *name) if (ret == NULL) ret = xmlGetDocEntity(parser->parser->myDoc, name); + ZEND_DIAGNOSTIC_IGNORED_START("-Wdeprecated-declarations") if (ret == NULL || parser->parser->instate == XML_PARSER_CONTENT) { + ZEND_DIAGNOSTIC_IGNORED_END if (ret == NULL || ret->etype == XML_INTERNAL_GENERAL_ENTITY || ret->etype == XML_INTERNAL_PARAMETER_ENTITY || ret->etype == XML_INTERNAL_PREDEFINED_ENTITY) { /* Predefined entities will expand unless no cdata handler is present */ if (parser->h_default && ! (ret && ret->etype == XML_INTERNAL_PREDEFINED_ENTITY && parser->h_cdata)) { From 64852b44b592f830825d50cf39b42643cd8de5f5 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 13 Jul 2025 07:01:44 +0100 Subject: [PATCH 2/7] ext/sockets: multicast on unsupported socket type error change. From a mere warning to an exception. close GH-19114 --- NEWS | 4 +++ UPGRADING | 2 ++ ext/sockets/sockaddr_conv.c | 3 +- ext/sockets/tests/mcast_sockettype_error.phpt | 30 +++++++++++++++++++ 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 ext/sockets/tests/mcast_sockettype_error.phpt diff --git a/NEWS b/NEWS index d35d34b84e96b..336de62b6a32a 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,10 @@ PHP NEWS . Fetch larger block sizes and better handle SQL_NO_TOTAL when calling SQLGetData. (Calvin Buckley, Saki Takamachi) +- Sockets: + . socket_set_option for multicast context throws a ValueError + when the socket family is not of AF_INET/AF_INET6 family. (David Carlier) + - Standard: . Optimized pack(). (nielsdos, divinity76) . Fixed bug GH-19070 (setlocale($type, NULL) should not be deprecated). diff --git a/UPGRADING b/UPGRADING index 0847ad009e781..87d08e1260150 100644 --- a/UPGRADING +++ b/UPGRADING @@ -371,6 +371,8 @@ PHP 8.5 UPGRADE NOTES . socket_create/socket_bind can create AF_PACKET family sockets. . socket_getsockname gets the interface index and its string representation with AF_PACKET socket. + . socket_set_option with multicast context throws a ValueError + when the created socket is not of AF_INET/AF_INET6 family. - Tidy: . tidy::__construct/parseFile/parseString now throws a ValueError diff --git a/ext/sockets/sockaddr_conv.c b/ext/sockets/sockaddr_conv.c index 9840a98dbcb72..333ef2533a11b 100644 --- a/ext/sockets/sockaddr_conv.c +++ b/ext/sockets/sockaddr_conv.c @@ -137,8 +137,7 @@ int php_set_inet46_addr(php_sockaddr_storage *ss, socklen_t *ss_len, zend_string } #endif else { - php_error_docref(NULL, E_WARNING, - "IP address used in the context of an unexpected type of socket"); + zend_value_error("IP address used in the context of an unexpected type of socket"); } return 0; } diff --git a/ext/sockets/tests/mcast_sockettype_error.phpt b/ext/sockets/tests/mcast_sockettype_error.phpt new file mode 100644 index 0000000000000..56308534ebc4d --- /dev/null +++ b/ext/sockets/tests/mcast_sockettype_error.phpt @@ -0,0 +1,30 @@ +--TEST-- +Multicast attempt on unsupported socket type +--EXTENSIONS-- +sockets +--SKIPIF-- + +--FILE-- + '127.0.0.1', + "interface" => "lo", + )); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} +?> +--EXPECT-- +IP address used in the context of an unexpected type of socket From fec641d27a2b86e75b644a5020b363e3511d7ff2 Mon Sep 17 00:00:00 2001 From: Volker Dusch Date: Tue, 15 Jul 2025 14:21:15 +0200 Subject: [PATCH 3/7] Update NEWS for PHP 8.5.0 alpha2 --- NEWS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 336de62b6a32a..c62ce5021d652 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 8.5.0alpha2 +?? ??? ????, PHP 8.5.0alpha3 + + +17 Jul 2025, PHP 8.5.0alpha2 - Core: . Fix OSS-Fuzz #427814452 (pipe compilation fails with assert). From b08753eef0bbb636859d506b907de18f35a3c8a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 15 Jul 2025 14:28:57 +0200 Subject: [PATCH 4/7] [skip ci] Fix NEWS for GH-19114 This did not make the cut for Alpha 2. --- NEWS | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index c62ce5021d652..a06ac7f852587 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.5.0alpha3 +- Sockets: + . socket_set_option for multicast context throws a ValueError + when the socket family is not of AF_INET/AF_INET6 family. (David Carlier) 17 Jul 2025, PHP 8.5.0alpha2 @@ -17,10 +20,6 @@ PHP NEWS . Fetch larger block sizes and better handle SQL_NO_TOTAL when calling SQLGetData. (Calvin Buckley, Saki Takamachi) -- Sockets: - . socket_set_option for multicast context throws a ValueError - when the socket family is not of AF_INET/AF_INET6 family. (David Carlier) - - Standard: . Optimized pack(). (nielsdos, divinity76) . Fixed bug GH-19070 (setlocale($type, NULL) should not be deprecated). From ea9a7b2523c26173ba28a9163ba297f3920f8c8a Mon Sep 17 00:00:00 2001 From: Dmitrii Derepko Date: Tue, 15 Jul 2025 18:38:00 +0400 Subject: [PATCH 5/7] refactor: Drop unused op_array param from zend_get_brk_cont_target() (GH-19117) --- Zend/zend_opcode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 6e7d31e15a40f..01f6d924d28f6 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -709,7 +709,7 @@ static void zend_check_finally_breakout(zend_op_array *op_array, uint32_t op_num } } -static uint32_t zend_get_brk_cont_target(const zend_op_array *op_array, const zend_op *opline) { +static uint32_t zend_get_brk_cont_target(const zend_op *opline) { int nest_levels = opline->op2.num; int array_offset = opline->op1.num; zend_brk_cont_element *jmp_to; @@ -1120,7 +1120,7 @@ ZEND_API void pass_two(zend_op_array *op_array) case ZEND_BRK: case ZEND_CONT: { - uint32_t jmp_target = zend_get_brk_cont_target(op_array, opline); + uint32_t jmp_target = zend_get_brk_cont_target(opline); if (op_array->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK) { zend_check_finally_breakout(op_array, opline - op_array->opcodes, jmp_target); From 3d468a181a73a83535114b6cf82343ca0b0f45e8 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Tue, 15 Jul 2025 13:46:17 -0300 Subject: [PATCH 6/7] PHP-8.4 is now for PHP 8.4.12-dev --- NEWS | 6 +++++- Zend/zend.h | 2 +- configure.ac | 2 +- main/php_version.h | 6 +++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 5190b9b563a8e..e0b23bddcc5d9 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 8.4.11 +?? ??? ????, PHP 8.4.12 + + + +31 Jul 2025, PHP 8.4.11 - Calendar: . Fixed jewishtojd overflow on year argument. (David Carlier) diff --git a/Zend/zend.h b/Zend/zend.h index 682dc813b5a6f..0e34aeef9f9e4 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -20,7 +20,7 @@ #ifndef ZEND_H #define ZEND_H -#define ZEND_VERSION "4.4.11-dev" +#define ZEND_VERSION "4.4.12-dev" #define ZEND_ENGINE_3 diff --git a/configure.ac b/configure.ac index 53481b10c056a..dd13a9278dec0 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ dnl Basic autoconf initialization, generation of config.nice. dnl ---------------------------------------------------------------------------- AC_PREREQ([2.68]) -AC_INIT([PHP],[8.4.11-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) +AC_INIT([PHP],[8.4.12-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) AC_CONFIG_SRCDIR([main/php_version.h]) AC_CONFIG_AUX_DIR([build]) AC_PRESERVE_HELP_ORDER diff --git a/main/php_version.h b/main/php_version.h index e518de26b2f04..0758d83aed3d3 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.ac to change version number */ #define PHP_MAJOR_VERSION 8 #define PHP_MINOR_VERSION 4 -#define PHP_RELEASE_VERSION 11 +#define PHP_RELEASE_VERSION 12 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "8.4.11-dev" -#define PHP_VERSION_ID 80411 +#define PHP_VERSION "8.4.12-dev" +#define PHP_VERSION_ID 80412 From a8086be81c088db439dda157d330dfd69e38bcc7 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 2 Jul 2025 22:04:09 +0200 Subject: [PATCH 7/7] Fix GH-18986: OpenSSL backend: incorrect RAND_{load,write}_file() return value check As noted by the LibreSSL maintainer, these functions return -1 on error. This is further confirmed by my static analyzer that inferred the same thing for OpenSSL. Closes GH-19013. --- NEWS | 2 ++ ext/openssl/openssl.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index c395d0dcd3b59..42de159acbaab 100644 --- a/NEWS +++ b/NEWS @@ -37,6 +37,8 @@ PHP NEWS - OpenSSL: . Fixed bug #80770 (It is not possible to get client peer certificate with stream_socket_server). (Jakub Zelenka) + . Fixed bug GH-18986 (OpenSSL backend: incorrect RAND_{load,write}_file() + return value check). (nielsdos, botovq) - PCNTL: . Fixed bug GH-18958 (Fatal error during shutdown after pcntl_rfork() or diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 718f946ad176d..e44bc90bbd7f8 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1095,7 +1095,7 @@ static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *se return SUCCESS; #endif } - if (file == NULL || !RAND_load_file(file, -1)) { + if (file == NULL || RAND_load_file(file, -1) < 0) { if (RAND_status() == 0) { php_openssl_store_errors(); php_error_docref(NULL, E_WARNING, "Unable to load random state; not enough random data!"); @@ -1122,7 +1122,7 @@ static int php_openssl_write_rand_file(const char * file, int egdsocket, int see file = RAND_file_name(buffer, sizeof(buffer)); } PHP_OPENSSL_RAND_ADD_TIME(); - if (file == NULL || !RAND_write_file(file)) { + if (file == NULL || RAND_write_file(file) < 0) { php_openssl_store_errors(); php_error_docref(NULL, E_WARNING, "Unable to write random state"); return FAILURE;