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