Skip to content

Commit 145602f

Browse files
committed
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>
1 parent fbaa2eb commit 145602f

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

build/gen_stub.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -650,11 +650,13 @@ public function isNullable(): bool {
650650

651651
public function getWithoutNull(): Type {
652652
return new Type(
653-
array_filter(
654-
$this->types,
655-
function(SimpleType $type) {
656-
return !$type->isNull();
657-
}
653+
array_values(
654+
array_filter(
655+
$this->types,
656+
function(SimpleType $type) {
657+
return !$type->isNull();
658+
}
659+
)
658660
),
659661
false
660662
);

ext/zend_test/test.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ enum ZendTestIntEnum: int {
119119

120120
function zend_test_array_return(): array {}
121121

122-
function zend_test_nullable_array_return(): ?array {}
122+
function zend_test_nullable_array_return(): null|array {}
123123

124124
function zend_test_void_return(): void {}
125125

ext/zend_test/test_arginfo.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)