[php-src] master: Merge branch 'PHP-8.5'

Derick Rethans <[email protected]>
Newsgroups gmane.comp.php.cvs.general
Message-ID <[email protected]>
Author: Derick Rethans (derickr)
Date: 2026-07-10T16:52:52+01:00

Commit: https://github.com/php/php-src/commit/a71a32122b9c39b8f96ffe47be7e8d4ea913f6dd
Raw diff: https://github.com/php/php-src/commit/a71a32122b9c39b8f96ffe47be7e8d4ea913f6dd.diff

Merge branch 'PHP-8.5'

* PHP-8.5:
  Fixed __debugInfo() usage on PHP 8.5 and later for DatePeriod (#22677)

Changed paths:
  M  ext/date/php_date.c


Diff:

diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index c37230c6ca08..2b0696305d2b 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -6071,6 +6071,17 @@ static zval *date_period_get_property_ptr_ptr(zend_object *object, zend_string *
 
 static HashTable *date_period_get_properties_for(zend_object *object, zend_prop_purpose purpose)
 {
+	if (purpose == ZEND_PROP_PURPOSE_DEBUG) {
+		if (object->ce->__debugInfo) {
+			int is_temp = 0;
+			HashTable *ht = zend_std_get_debug_info(object, &is_temp);
+			if (ht && !is_temp) {
+				GC_TRY_ADDREF(ht);
+			}
+			return ht;
+		}
+	}
+
 	php_period_obj *period_obj = php_period_obj_from_obj(object);
 	HashTable *props = zend_array_dup(zend_std_get_properties(object));
 	if (!period_obj->initialized) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.