-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphp-8.5-compilation.patch
More file actions
60 lines (55 loc) · 2.09 KB
/
php-8.5-compilation.patch
File metadata and controls
60 lines (55 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
commit ba938117644cd31f5818e223e8b34ff9a30721a0
Author: Nathanael d. Noblet <nathanael@noblet.ca>
Date: Wed Mar 11 22:54:57 2026 -0600
Support PHP 8.5
diff --git a/zend/constantfuncs.cpp b/zend/constantfuncs.cpp
index 09e1be2..7400602 100644
--- a/zend/constantfuncs.cpp
+++ b/zend/constantfuncs.cpp
@@ -104,7 +104,11 @@ bool define(const char *name, size_t size, const Value &value)
#endif
// register the constant
+#if PHP_VERSION_ID >= 80500
+ return zend_register_constant(&constant) != NULL;
+#else
return zend_register_constant(&constant) == SUCCESS;
+#endif
}
/**
diff --git a/zend/value.cpp b/zend/value.cpp
index 45d6562..4f12850 100644
--- a/zend/value.cpp
+++ b/zend/value.cpp
@@ -1654,6 +1654,8 @@ Value Value::get(const char *key, int size) const
#if PHP_VERSION_ID < 70100
zend_class_entry* scope = EG(scope);
+#elif PHP_VERSION_ID >= 80500
+ const zend_class_entry* scope = EG(fake_scope) ? EG(fake_scope) : zend_get_executed_scope();
#else
zend_class_entry* scope = EG(fake_scope) ? EG(fake_scope) : zend_get_executed_scope();
#endif
@@ -1662,8 +1664,11 @@ Value Value::get(const char *key, int size) const
zval *property = zend_read_property(scope, _val, key, size, 0, &rv);
#else
zend_object *zobj = Z_OBJ_P(_val);
+#if PHP_VERSION_ID >= 80500
+ zval *property = zend_read_property((_zend_class_entry*)scope, zobj, key, size, 0, &rv);
+#else
zval *property = zend_read_property(scope, zobj, key, size, 0, &rv);
-
+#endif
#endif
// wrap in value
return Value(property);
@@ -1734,8 +1739,10 @@ void Value::setRaw(const char *key, int size, const Value &value)
// update the property
#if PHP_VERSION_ID < 70100
zend_class_entry* scope = EG(scope);
-#else
+#elif PHP_VERSION_ID < 80500
zend_class_entry* scope = EG(fake_scope) ? EG(fake_scope) : zend_get_executed_scope();
+#else
+ const zend_class_entry* scope = EG(fake_scope) ? EG(fake_scope) : zend_get_executed_scope();
#endif
#if PHP_VERSION_ID < 80000
zend_update_property(scope, _val, key, size, value._val);