var_dump(get_class_vars('A'));
var_dump(get_class_vars('B'));
+try {
+ get_class_vars("Unknown");
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
+
?>
--EXPECT--
array(1) {
["aa"]=>
int(4)
}
+get_class_vars(): Argument #1 ($class) must be a valid class name, Unknown given
/* {{{ Returns an array of default properties of the class. */
ZEND_FUNCTION(get_class_vars)
{
- zend_string *class_name;
- zend_class_entry *ce, *scope;
+ zend_class_entry *ce = NULL, *scope;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &class_name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "C", &ce) == FAILURE) {
RETURN_THROWS();
}
- ce = zend_lookup_class(class_name);
- if (!ce) {
- RETURN_FALSE;
- } else {
- array_init(return_value);
- if (UNEXPECTED(!(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED))) {
- if (UNEXPECTED(zend_update_class_constants(ce) != SUCCESS)) {
- return;
- }
+ array_init(return_value);
+ if (UNEXPECTED(!(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED))) {
+ if (UNEXPECTED(zend_update_class_constants(ce) != SUCCESS)) {
+ return;
}
- scope = zend_get_executed_scope();
- add_class_vars(scope, ce, 0, return_value);
- add_class_vars(scope, ce, 1, return_value);
}
+
+ scope = zend_get_executed_scope();
+ add_class_vars(scope, ce, 0, return_value);
+ add_class_vars(scope, ce, 1, return_value);
}
/* }}} */
/** @param object|string $object_or_class */
function is_a(mixed $object_or_class, string $class, bool $allow_string = false): bool {}
-function get_class_vars(string $class): array|false {}
+function get_class_vars(string $class): array {}
function get_object_vars(object $object): array {}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 1f644f72600eddbbb01a4c3912a2c9c5fe12188e */
+ * Stub hash: fed3b572fbcae7bda87efc377b56e027da12b511 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_version, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, allow_string, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_get_class_vars, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_class_vars, 0, 1, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, class, IS_STRING, 0)
ZEND_END_ARG_INFO()
F1("zend_version", MAY_BE_STRING),
FN("func_get_arg", UNKNOWN_INFO),
FN("func_get_args", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ANY),
- F1("get_class_vars", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
+ F1("get_class_vars", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
F1("get_class_methods", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("get_included_files", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
FN("set_error_handler", MAY_BE_NULL | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_OBJECT | MAY_BE_OBJECT),