summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorkrakjoe <joe.watkins@live.co.uk>2015-04-26 15:02:57 +0200
committerNikita Popov <nikic@php.net>2015-04-26 15:04:22 +0200
commit49608e0608857638fdc978333764cf52ba270913 (patch)
tree1897a7c45de79780b15dbc547f5f1e4d1436f435 /ext/reflection/php_reflection.c
parent1a4d3e4855619538eb1902b8513473e2cda76804 (diff)
downloadphp-git-49608e0608857638fdc978333764cf52ba270913.tar.gz
Rebase Joe's anon classes implementation
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index bec69b2bbd..76159479f2 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -3590,6 +3590,21 @@ ZEND_METHOD(reflection_class, isUserDefined)
}
/* }}} */
+/* {{{ proto public bool ReflectionClass::isAnonymous()
+ Returns whether this class is anonymous */
+ZEND_METHOD(reflection_class, isAnonymous)
+{
+ reflection_object *intern;
+ zend_class_entry *ce;
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+ GET_REFLECTION_OBJECT_PTR(ce);
+ RETURN_BOOL(ce->ce_flags & ZEND_ACC_ANON_CLASS);
+}
+/* }}} */
+
/* {{{ proto public string ReflectionClass::getFileName()
Returns the filename of the file this class was declared in */
ZEND_METHOD(reflection_class, getFileName)
@@ -5943,6 +5958,7 @@ static const zend_function_entry reflection_class_functions[] = {
ZEND_ME(reflection_class, getName, arginfo_reflection__void, 0)
ZEND_ME(reflection_class, isInternal, arginfo_reflection__void, 0)
ZEND_ME(reflection_class, isUserDefined, arginfo_reflection__void, 0)
+ ZEND_ME(reflection_class, isAnonymous, arginfo_reflection__void, 0)
ZEND_ME(reflection_class, isInstantiable, arginfo_reflection__void, 0)
ZEND_ME(reflection_class, isCloneable, arginfo_reflection__void, 0)
ZEND_ME(reflection_class, getFileName, arginfo_reflection__void, 0)