summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/base.cpp6
-rw-r--r--src/classbase.cpp2
2 files changed, 2 insertions, 6 deletions
diff --git a/src/base.cpp b/src/base.cpp
index b5f2f86..867fd9c 100644
--- a/src/base.cpp
+++ b/src/base.cpp
@@ -18,12 +18,8 @@ namespace Php {
*/
Value Base::value() const
{
- // because the object is stored in a MixedObject, we know that the zend_object
- // structure is right in front of the this pointer
- zend_object *object = (zend_object *)this - sizeof(zend_object);
-
// wrap the properties table, as a reference
- return Object(*object->properties_table, true);
+ return Object(*_object->properties_table, true);
}
/**
diff --git a/src/classbase.cpp b/src/classbase.cpp
index 39c8790..6a679b3 100644
--- a/src/classbase.cpp
+++ b/src/classbase.cpp
@@ -100,7 +100,7 @@ static zend_object_value create_object(zend_class_entry *type TSRMLS_DC)
result.handle = zend_objects_store_put(object, NULL, deallocate_object, clone_object TSRMLS_CC);
// finally, construct the cpp object
- object->cpp = info->construct();
+ object->cpp = info->construct(&object->php);
// done
return result;