mirror of
https://github.com/php/php-src.git
synced 2026-04-27 10:16:41 +02:00
Fix bug in zend_test assuming null not being the first type
(I agree that null should come last, but then it should rather throw with a proper message than emit an undefined key warning.) Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
This commit is contained in:
+7
-5
@@ -650,11 +650,13 @@ class Type {
|
||||
|
||||
public function getWithoutNull(): Type {
|
||||
return new Type(
|
||||
array_filter(
|
||||
$this->types,
|
||||
function(SimpleType $type) {
|
||||
return !$type->isNull();
|
||||
}
|
||||
array_values(
|
||||
array_filter(
|
||||
$this->types,
|
||||
function(SimpleType $type) {
|
||||
return !$type->isNull();
|
||||
}
|
||||
)
|
||||
),
|
||||
false
|
||||
);
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace {
|
||||
|
||||
function zend_test_array_return(): array {}
|
||||
|
||||
function zend_test_nullable_array_return(): ?array {}
|
||||
function zend_test_nullable_array_return(): null|array {}
|
||||
|
||||
function zend_test_void_return(): void {}
|
||||
|
||||
|
||||
Generated
+1
-1
@@ -1,5 +1,5 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 8a5914eead09c2a85fd7d53d63c9597dfb3d0c30 */
|
||||
* Stub hash: 3e2308593cea5289709dcfb1c9ee598de945d2e2 */
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_test_array_return, 0, 0, IS_ARRAY, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
Reference in New Issue
Block a user