summaryrefslogtreecommitdiff
path: root/Zend/zend_constants.c
diff options
context:
space:
mode:
authorJohannes Schlüter <johannes@php.net>2006-10-18 16:35:15 +0000
committerJohannes Schlüter <johannes@php.net>2006-10-18 16:35:15 +0000
commitdcf249004c3eea72b3405b3829b7f912fb4c6492 (patch)
treea48d29b75f4fe6c5ad1d8ed2a530bd869b16ce3e /Zend/zend_constants.c
parentb99ba323d56d16c598a37d8ae89b8472e974c42b (diff)
downloadphp-git-dcf249004c3eea72b3405b3829b7f912fb4c6492.tar.gz
- MFH: Fix #38465 (ReflectionParameter fails if default value is an access to self::
Diffstat (limited to 'Zend/zend_constants.c')
-rw-r--r--Zend/zend_constants.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c
index ec3e1e587a..08de962cd6 100644
--- a/Zend/zend_constants.c
+++ b/Zend/zend_constants.c
@@ -213,7 +213,7 @@ ZEND_API void zend_register_string_constant(char *name, uint name_len, char *str
}
-ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC)
+ZEND_API int zend_get_constant_ex(char *name, uint name_len, zval *result, zend_class_entry *scope TSRMLS_DC)
{
zend_constant *c;
int retval = 1;
@@ -222,17 +222,19 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC
if ((colon = memchr(name, ':', name_len)) && colon[1] == ':') {
/* class constant */
- zend_class_entry **ce = NULL, *scope;
+ zend_class_entry **ce = NULL;
int class_name_len = colon-name;
int const_name_len = name_len - class_name_len - 2;
char *constant_name = colon+2;
zval **ret_constant;
char *class_name;
- if (EG(in_execution)) {
- scope = EG(scope);
- } else {
- scope = CG(active_class_entry);
+ if (!scope) {
+ if (EG(in_execution)) {
+ scope = EG(scope);
+ } else {
+ scope = CG(active_class_entry);
+ }
}
class_name = estrndup(name, class_name_len);
@@ -300,6 +302,10 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC
return retval;
}
+ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC)
+{
+ zend_get_constant_ex(name, name_len, result, NULL TSRMLS_CC);
+}
ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
{