Skip to content

Commit 8594092

Browse files
committed
Fix format and dtor.
1 parent c4952e9 commit 8594092

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

phper/src/arrays.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,17 @@ impl Array {
3636
pub fn new() -> Self {
3737
unsafe {
3838
let mut array = zeroed::<Array>();
39-
_zend_hash_init(array.as_mut_ptr(), 0, Some(_zval_ptr_dtor), false.into());
39+
let dtor = {
40+
#[cfg(phper_major_version = "8")]
41+
{
42+
zval_ptr_dtor
43+
}
44+
#[cfg(phper_major_version = "7")]
45+
{
46+
_zval_ptr_dtor
47+
}
48+
};
49+
_zend_hash_init(array.as_mut_ptr(), 0, Some(dtor), false.into());
4050
array
4151
}
4252
}

phper/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! The errors for crate and php.
22
3-
use crate::{classes::ClassEntry, Error::Other, sys::*};
3+
use crate::{classes::ClassEntry, sys::*, Error::Other};
44
use anyhow::anyhow;
55
use std::{error, ffi::FromBytesWithNulError, io, str::Utf8Error};
66

0 commit comments

Comments
 (0)