Skip to content

Commit a54bd80

Browse files
committed
feat: Handle case when preg_split returns false
1 parent 5949c79 commit a54bd80

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Type/Php/PregSplitDynamicReturnTypeExtension.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection,
157157
foreach ($limits as $limit) {
158158
foreach ($flags as $flag) {
159159
$result = @preg_split($patternConstantType->getValue(), $subjectConstantType->getValue(), (int) $limit, (int) $flag);
160+
if ($result === false) {
161+
return new ErrorType();
162+
}
160163
$constantArray = ConstantArrayTypeBuilder::createEmpty();
161164
foreach ($result as $key => $value) {
162165
if (is_array($value)) {

0 commit comments

Comments
 (0)