Skip to content

Commit

Permalink
Merge 873bc50 into 5e3e482
Browse files Browse the repository at this point in the history
  • Loading branch information
dzuelke committed Jun 7, 2019
2 parents 5e3e482 + 873bc50 commit 30102a6
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion kernels/ZendEngine3/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,24 @@ zend_class_entry* zephir_get_internal_ce(const char *class_name, unsigned int cl
/* Declare constants */
int zephir_declare_class_constant(zend_class_entry *ce, const char *name, size_t name_length, zval *value)
{
#if PHP_VERSION_ID >= 70100
#if PHP_VERSION_ID >= 70200
int ret;
zend_string *key;

if (ce->type == ZEND_INTERNAL_CLASS) {
key = zend_string_init_interned(name, name_length, 1);
} else {
key = zend_string_init(name, name_length, 0);
}

zend_declare_class_constant_ex(ce, key, value, ZEND_ACC_PUBLIC, NULL);

if (ce->type != ZEND_INTERNAL_CLASS) {
zend_string_release(key);
}

return ret;
#elif PHP_VERSION_ID >= 70100
int ret;

zend_string *key = zend_string_init(name, name_length, ce->type & ZEND_INTERNAL_CLASS);
Expand Down

0 comments on commit 30102a6

Please sign in to comment.