Permalink
Browse files

ZVAL_COPY_VALUE is not always available, <5.4

  • Loading branch information...
colder committed Jul 25, 2012
1 parent 30b0a43 commit 0d2231f7c5b8c10892fe53a52ecd3218733d4c0b
Showing with 7 additions and 2 deletions.
  1. +7 −2 wr_weakref.c
View
@@ -121,7 +121,10 @@ static zend_object_value wr_weakref_object_new_ex(zend_class_entry *class_type,
intern->valid = other->valid;
ALLOC_INIT_ZVAL(intern->ref);
- ZVAL_COPY_VALUE(intern->ref, other->ref);
+ // ZVAL_COPY_VALUE
+ intern->ref->value = other->ref->value;
+ Z_TYPE_P(intern->ref) = Z_TYPE_P(other->ref);
+
wr_store_attach((zend_object *)intern, wr_weakref_ref_dtor, other->ref TSRMLS_CC);
for (acquired = 0; acquired < other->acquired; acquired++) {
@@ -271,7 +274,9 @@ PHP_METHOD(WeakRef, __construct)
ALLOC_INIT_ZVAL(intern->ref);
- ZVAL_COPY_VALUE(intern->ref, ref);
+ // ZVAL_COPY_VALUE
+ intern->ref->value = ref->value;
+ Z_TYPE_P(intern->ref) = Z_TYPE_P(ref);
wr_store_attach((zend_object *)intern, wr_weakref_ref_dtor, intern->ref TSRMLS_CC);

0 comments on commit 0d2231f

Please sign in to comment.