Skip to content

Commit

Permalink
Merge pull request #1870 from dzuelke/fix-phalcon-14160-0.10.x
Browse files Browse the repository at this point in the history
Port #1868 to 0.10.x
  • Loading branch information
sergeyklay committed Jun 7, 2019
2 parents 5e3e482 + 873bc50 commit 1251b87
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 1251b87

Please sign in to comment.