1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

phpdbg: Call enums “Enum” and traits “Trait” in info classes (#17191)

* phpdbg: Call enums “Enum” in `info classes`

* phpdbg: Call traits “Trait” in `info classes`
This commit is contained in:
Tim Düsterhus
2024-12-17 19:32:47 +01:00
committed by GitHub
parent 97f44b7c39
commit 3fea6468fe

View File

@@ -374,7 +374,11 @@ PHPDBG_INFO(memory) /* {{{ */
static inline void phpdbg_print_class_name(zend_class_entry *ce) /* {{{ */
{
const char *visibility = ce->type == ZEND_USER_CLASS ? "User" : "Internal";
const char *type = (ce->ce_flags & ZEND_ACC_INTERFACE) ? "Interface" : (ce->ce_flags & ZEND_ACC_ABSTRACT) ? "Abstract Class" : "Class";
const char *type = (ce->ce_flags & ZEND_ACC_INTERFACE) ? "Interface"
: (ce->ce_flags & ZEND_ACC_ABSTRACT) ? "Abstract Class"
: (ce->ce_flags & ZEND_ACC_ENUM) ? "Enum"
: (ce->ce_flags & ZEND_ACC_TRAIT) ? "Trait"
: "Class";
phpdbg_writeln("%s %s %.*s (%d)", visibility, type, (int) ZSTR_LEN(ce->name), ZSTR_VAL(ce->name), zend_hash_num_elements(&ce->function_table));
} /* }}} */