mirror of
https://github.com/danog/ext-php-rs.git
synced 2024-11-30 04:39:04 +01:00
Fix class construction
This commit is contained in:
parent
eda544ceaf
commit
ab2af4581d
@ -10,7 +10,7 @@ use crate::{
|
||||
error::{Error, Result},
|
||||
ffi::{
|
||||
ext_php_rs_zend_object_release, zend_call_known_function, zend_object, zend_objects_new,
|
||||
HashTable, ZEND_ISEMPTY, ZEND_PROPERTY_EXISTS, ZEND_PROPERTY_ISSET, zend_hash_str_find_ptr_lc, zend_function,
|
||||
HashTable, ZEND_ISEMPTY, ZEND_PROPERTY_EXISTS, ZEND_PROPERTY_ISSET, zend_hash_str_find_ptr_lc, zend_function, object_properties_init,
|
||||
},
|
||||
flags::DataType,
|
||||
rc::PhpRc,
|
||||
@ -42,6 +42,7 @@ impl ZendObject {
|
||||
// `*mut` is valid as the function will not mutate `ce`.
|
||||
unsafe {
|
||||
let ptr = zend_objects_new(ce as *const _ as *mut _);
|
||||
object_properties_init(ptr, ce as *const _ as *mut _);
|
||||
ZBox::from_raw(
|
||||
ptr.as_mut()
|
||||
.expect("Failed to allocate memory for Zend object"),
|
||||
|
Loading…
Reference in New Issue
Block a user