--- zend_builtin_functions.c 2003-11-12 02:41:43.000000000 +0100 +++ zend_builtin_functions_ok.c 2003-11-12 02:41:37.000000000 +0100 @@ -63,6 +63,7 @@ static ZEND_FUNCTION(set_exception_handler); static ZEND_FUNCTION(restore_exception_handler); static ZEND_FUNCTION(get_declared_classes); +static ZEND_FUNCTION(get_declared_interfaces); static ZEND_FUNCTION(get_defined_functions); static ZEND_FUNCTION(get_defined_vars); static ZEND_FUNCTION(create_function); @@ -122,6 +123,7 @@ ZEND_FE(set_exception_handler, NULL) ZEND_FE(restore_exception_handler, NULL) ZEND_FE(get_declared_classes, NULL) + ZEND_FE(get_declared_interfaces, NULL) ZEND_FE(get_defined_functions, NULL) ZEND_FE(get_defined_vars, NULL) ZEND_FE(create_function, NULL) @@ -1067,7 +1069,8 @@ zval *array = va_arg(args, zval *); zend_class_entry *ce = *pce; - if (hash_key->nKeyLength==0 || hash_key->arKey[0]!=0) { + if (hash_key->nKeyLength==0 || hash_key->arKey[0]!=0 + && (0 == (ce->ce_flags & ZEND_ACC_INTERFACE))) { add_next_index_stringl(array, ce->name, ce->name_length, 1); } return 0; @@ -1087,6 +1090,31 @@ /* }}} */ +static int copy_interface_name(zend_class_entry **pce, int num_args, va_list args, zend_hash_key *hash_key) +{ + zval *array = va_arg(args, zval *); + zend_class_entry *ce = *pce; + + if (hash_key->nKeyLength==0 || hash_key->arKey[0]!=0 + && (0 != (ce->ce_flags & ZEND_ACC_INTERFACE))) { + add_next_index_stringl(array, ce->name, ce->name_length, 1); + } + return 0; +} + +/* {{{ proto array get_declared_classes() + Returns an array of all declared classes. */ +ZEND_FUNCTION(get_declared_interfaces) +{ + if (ZEND_NUM_ARGS() != 0) { + ZEND_WRONG_PARAM_COUNT(); + } + array_init(return_value); + zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) copy_interface_name, 1, return_value); +} +/* }}} */ + + static int copy_function_name(zend_function *func, int num_args, va_list args, zend_hash_key *hash_key) { zval *internal_ar = va_arg(args, zval *),