-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
phpstan/phpstan-src
#4140Description
Bug report
phpstan 2.1.18 crashes with an out-of-memory or with --xdebug (and a sufficiently high memory limit) this error:
Internal error: Maximum call stack size of 8339456 bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached.
The callstack is from the phar-version, so I assume the line numbers don't exactly match the source code (it seems ConstantArrayType::spliceArray has an endless recursion, but the line numbers don't match 2.1.18 version on github).
callstack.txt
Code snippet that reproduces the problem
I can't create a reproducer-link on the playground, because that also crashes. But I managed to simplify the code to just this small snippet:
class ReproduceMe
{
public function crashIt(string $addMe = ''): string
{
$arg = [];
if ($addMe !== '') {
$arg[] = $addMe;
}
array_splice($arg, 'extra', 1);
return implode(' ', $arg);
}
}Expected output
It should not crash
Did PHPStan help you today? Did it make you happy in any way?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels