Skip to content

Commit af62d0a

Browse files
committed
Adapt to PHP 8.4.
1 parent 8761847 commit af62d0a

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The framework that allows us to write PHP extensions using pure and safe Rust wh
1818

1919
### Necessary
2020

21-
- **rust** 1.65 or later
21+
- **rust** 1.79 or later
2222
- **libclang** 9.0 or later
2323
- **php** 7.0 or later
2424

phper-sys/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fn main() {
4747
// Block the `zend_startup` because it fails checks.
4848
.blocklist_function("zend_startup")
4949
// Block the `zend_random_bytes_insecure` because it fails checks.
50-
.blocklist_function("zend_random_bytes_insecure")
50+
.blocklist_item("zend_random_bytes_insecure")
5151
.clang_args(&includes)
5252
.derive_default(true);
5353

phper/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ repository = { workspace = true }
2222
license = { workspace = true }
2323

2424
[dependencies]
25+
cfg-if = "1.0.0"
2526
derive_more = "0.99.18"
2627
indexmap = "2.3.0"
2728
once_cell = "1.19.0"

phper/src/classes.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,25 @@ unsafe extern "C" fn create_object(ce: *mut zend_class_entry) -> *mut zend_objec
890890
let object = state_object.as_mut_object().as_mut_ptr();
891891
zend_object_std_init(object, ce);
892892
object_properties_init(object, ce);
893-
rebuild_object_properties(object);
893+
894+
cfg_if::cfg_if! {
895+
if #[cfg(any(
896+
phper_major_version = "7",
897+
all(
898+
phper_major_version = "8",
899+
any(
900+
phper_minor_version = "0",
901+
phper_minor_version = "1",
902+
phper_minor_version = "2",
903+
phper_minor_version = "3",
904+
),
905+
)
906+
))] {
907+
rebuild_object_properties(object);
908+
} else {
909+
rebuild_object_properties_internal(object);
910+
}
911+
}
894912

895913
// Set handlers
896914
let mut handlers = Box::new(std_object_handlers);

phper/src/functions.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ impl FunctionEntry {
184184
arg_info: Box::into_raw(infos.into_boxed_slice()).cast(),
185185
num_args: arguments.len() as u32,
186186
flags,
187+
frameless_function_infos: null_mut(),
188+
doc_comment: null_mut(),
187189
}
188190
}
189191

0 commit comments

Comments
 (0)