Skip to content

Commit 09d4ce9

Browse files
Fixed registering of parameters of unspecified type for PHP 8 and up
1 parent 413eed1 commit 09d4ce9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zend/callable.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ class Callable
205205
case Type::Callable: info->type_hint = IS_CALLABLE; break; // anything that can be invoked
206206
default: info->type_hint = IS_UNDEF; break; // if not specified we allow anything
207207
#elif PHP_VERSION_ID >= 80000
208-
case Type::Undefined: info->type = (zend_type) ZEND_TYPE_INIT_CODE(IS_UNDEF, arg.allowNull(), _ZEND_ARG_INFO_FLAGS(arg.byReference(), 0, 0)); break; // undefined means we'll accept any type
209-
case Type::Null: info->type = (zend_type) ZEND_TYPE_INIT_CODE(IS_UNDEF, arg.allowNull(), _ZEND_ARG_INFO_FLAGS(arg.byReference(), 0, 0)); break; // this is likely an error, what good would accepting NULL be? accept anything
208+
case Type::Undefined: info->type = (zend_type) ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS((unsigned int)arg.byReference(), 0, 0)); break; // undefined means we'll accept any type
209+
case Type::Null: info->type = (zend_type) ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS((unsigned int)arg.byReference(), 0, 0)); break; // this is likely an error, what good would accepting NULL be? accept anything
210210
case Type::False: info->type = (zend_type) ZEND_TYPE_INIT_CODE(_IS_BOOL, arg.allowNull(), _ZEND_ARG_INFO_FLAGS(arg.byReference(), 0, 0)); break; // accept true as well ;)
211211
case Type::True: info->type = (zend_type) ZEND_TYPE_INIT_CODE(_IS_BOOL, arg.allowNull(), _ZEND_ARG_INFO_FLAGS(arg.byReference(), 0, 0)); break; // accept false as well
212212
case Type::Bool: info->type = (zend_type) ZEND_TYPE_INIT_CODE(_IS_BOOL, arg.allowNull(), _ZEND_ARG_INFO_FLAGS(arg.byReference(), 0, 0)); break; // any bool will do, true, false, the options are limitless

0 commit comments

Comments
 (0)