Commit 4927938cc17 for php

commit 4927938cc17580fb023957d805c9cc3bbbdfe17e
Author: lazerg <lazerg2@gmail.com>
Date:   Sat Nov 7 14:48:48 2026 +0500

    Fix GH-25266: Misaligned read in ReflectionProperty::isReadable()

    Closes GH-25271.

diff --git a/NEWS b/NEWS
index eb973ea3b2f..47fc90a5b3b 100644
--- a/NEWS
+++ b/NEWS
@@ -50,6 +50,10 @@ PHP                                                                        NEWS
   . Fixed incorrect handling of non-ASCII pending_input bytes in readline_info(),
     which could cause readline() to return false prematurely. (Weilin Du)

+- Reflection:
+  . Fixed bug GH-25266 (Misaligned read in ReflectionProperty::isReadable()).
+    (Lazizbek Ergashev)
+
 - Streams:
   . Fixed bug GH-22063 (Stream filter chain UAF on self-removal during
     callback). (Ilia Alshanetsky)
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 696828578fc..1b9dfd08a2c 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -6744,8 +6744,8 @@ ZEND_METHOD(ReflectionProperty, isReadable)
 		RETURN_FALSE;
 	}

-	if ((prop->flags & ZEND_ACC_VIRTUAL) && prop->hooks) {
-		if (!prop->hooks[ZEND_PROPERTY_HOOK_GET]) {
+	if (prop->flags & ZEND_ACC_VIRTUAL) {
+		if (prop->hooks && !prop->hooks[ZEND_PROPERTY_HOOK_GET]) {
 			RETURN_FALSE;
 		}
 	} else if (obj && (!prop->hooks || !prop->hooks[ZEND_PROPERTY_HOOK_GET])) {
diff --git a/ext/reflection/tests/gh25266.phpt b/ext/reflection/tests/gh25266.phpt
new file mode 100644
index 00000000000..544cfdd58ee
--- /dev/null
+++ b/ext/reflection/tests/gh25266.phpt
@@ -0,0 +1,15 @@
+--TEST--
+GH-25266 (Misaligned zval read in ReflectionProperty::isReadable() on internal virtual property)
+--CREDITS--
+YuanchengJiang
+--EXTENSIONS--
+dom
+--FILE--
+<?php
+
+$rp = new ReflectionProperty(DOMDocument::class, 'nodeName');
+var_dump($rp->isReadable(null, new DOMDocument));
+
+?>
+--EXPECT--
+bool(true)