Permalink
Browse files

Allow compilation with newer PHP versions (patch by Bob Vincent)

  • Loading branch information...
1 parent 45aa53f commit df9fc6360eaad4c368e04dc720e5d37edb78c771 @iliaal iliaal committed Jun 22, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 php_memcached.c
View
@@ -2457,7 +2457,11 @@ zend_object_value php_memc_new(zend_class_entry *ce TSRMLS_DC)
i_obj = ecalloc(1, sizeof(*i_obj));
zend_object_std_init( &i_obj->zo, ce TSRMLS_CC );
+#ifdef ZEND_ENGINE_2_4
+ object_properties_init( (zend_object *) i_obj, ce);
+#else
zend_hash_copy(i_obj->zo.properties, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
+#endif
retval.handle = zend_objects_store_put(i_obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)php_memc_free_storage, NULL TSRMLS_CC);
retval.handlers = &memcached_object_handlers;

0 comments on commit df9fc63

Please sign in to comment.