mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Support class+mask union for internal argument
This commit is contained in:
parent
e96e4ac726
commit
1f8a93abaa
@ -122,6 +122,8 @@ typedef struct _zend_fcall_info_cache {
|
|||||||
/* Arginfo structures with complex type information */
|
/* Arginfo structures with complex type information */
|
||||||
#define ZEND_ARG_TYPE_MASK(pass_by_ref, name, type_mask, default_value) \
|
#define ZEND_ARG_TYPE_MASK(pass_by_ref, name, type_mask, default_value) \
|
||||||
{ #name, ZEND_TYPE_INIT_MASK(type_mask | _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), default_value },
|
{ #name, ZEND_TYPE_INIT_MASK(type_mask | _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), default_value },
|
||||||
|
#define ZEND_ARG_OBJ_TYPE_MASK(pass_by_ref, name, class_name, type_mask, default_value) \
|
||||||
|
{ #name, ZEND_TYPE_INIT_CLASS_CONST_MASK(#class_name, type_mask | _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), default_value },
|
||||||
/* Arginfo structures with object type information */
|
/* Arginfo structures with object type information */
|
||||||
#define ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) \
|
#define ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) \
|
||||||
{ #name, ZEND_TYPE_INIT_CLASS_CONST(#classname, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), NULL },
|
{ #name, ZEND_TYPE_INIT_CLASS_CONST(#classname, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), NULL },
|
||||||
|
@ -905,14 +905,21 @@ function funcInfoToCode(FuncInfo $funcInfo): string {
|
|||||||
}
|
}
|
||||||
} else if (null !== $representableType = $argType->tryToRepresentableType()) {
|
} else if (null !== $representableType = $argType->tryToRepresentableType()) {
|
||||||
if ($representableType->classType !== null) {
|
if ($representableType->classType !== null) {
|
||||||
throw new Exception('Unimplemented');
|
$code .= sprintf(
|
||||||
|
"\tZEND_%s_OBJ_TYPE_MASK(%s, %s, %s, %s, %s)\n",
|
||||||
|
$argKind, $argInfo->getSendByString(), $argInfo->name,
|
||||||
|
$representableType->classType->toEscapedName(),
|
||||||
|
$representableType->toTypeMask(),
|
||||||
|
$argInfo->getDefaultValueString()
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$code .= sprintf(
|
||||||
|
"\tZEND_%s_TYPE_MASK(%s, %s, %s, %s)\n",
|
||||||
|
$argKind, $argInfo->getSendByString(), $argInfo->name,
|
||||||
|
$representableType->toTypeMask(),
|
||||||
|
$argInfo->getDefaultValueString()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
$code .= sprintf(
|
|
||||||
"\tZEND_%s_TYPE_MASK(%s, %s, %s, %s)\n",
|
|
||||||
$argKind, $argInfo->getSendByString(), $argInfo->name,
|
|
||||||
$representableType->toTypeMask(),
|
|
||||||
$argInfo->getDefaultValueString()
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
throw new Exception('Unimplemented');
|
throw new Exception('Unimplemented');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user