Skip to content

Commit

Permalink
Fixed PHP 5.4 in here too.
Browse files Browse the repository at this point in the history
  • Loading branch information
derickr committed Nov 21, 2011
1 parent 7d37d66 commit d39fe8d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ext/twig/twig.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,11 @@ zval *TWIG_GET_STATIC_PROPERTY(zval *class, char *prop_name TSRMLS_DC)
}

ce = zend_get_class_entry(class TSRMLS_CC);
#if PHP_VERSION_ID >= 50400
tmp_zval = zend_std_get_static_property(ce, prop_name, strlen(prop_name), 0, NULL TSRMLS_CC);
#else
tmp_zval = zend_std_get_static_property(ce, prop_name, strlen(prop_name), 0 TSRMLS_CC);
#endif
return *tmp_zval;
}

Expand Down Expand Up @@ -348,7 +352,11 @@ zval *TWIG_PROPERTY(zval *object, zval *propname TSRMLS_DC)
}

if (Z_OBJ_HT_P(object)->read_property) {
#if PHP_VERSION_ID >= 50400
tmp = Z_OBJ_HT_P(object)->read_property(object, propname, BP_VAR_IS, NULL TSRMLS_CC);
#else
tmp = Z_OBJ_HT_P(object)->read_property(object, propname, BP_VAR_IS TSRMLS_CC);
#endif
if (tmp != EG(uninitialized_zval_ptr)) {
return tmp;
} else {
Expand All @@ -361,7 +369,11 @@ zval *TWIG_PROPERTY(zval *object, zval *propname TSRMLS_DC)
int TWIG_HAS_PROPERTY(zval *object, zval *propname TSRMLS_DC)
{
if (Z_OBJ_HT_P(object)->has_property) {
#if PHP_VERSION_ID >= 50400
return Z_OBJ_HT_P(object)->has_property(object, propname, 0, NULL TSRMLS_CC);
#else
return Z_OBJ_HT_P(object)->has_property(object, propname, 0 TSRMLS_CC);
#endif
}
return 0;
}
Expand Down

0 comments on commit d39fe8d

Please sign in to comment.