-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
phpstan/phpstan-src
#1137Labels
Description
Bug report
Encountering an OOM when parsing the following snippet:
Code snippet that reproduces the problem
(phpstan.org also OOMs and the share link button won't work)
<?php declare(strict_types = 1);
use IteratorIterator;
use LimitIterator;
use Traversable;
use ArrayObject;
/**
* @template TKey as array-key
* @template TValue
*
* @implements ArrayObject<TKey, TValue>
*
* Basic generic iterator, with additional helper functions.
*/
abstract class XIterator extends ArrayObject {
}
final class RandHelper {
/**
* @template TRandKey as array-key
* @template TRandVal
* @template TRandList as array<TRandKey, TRandVal>|XIterator<TRandKey, TRandVal>|Traversable<TRandKey, TRandVal>
*
* @param TRandList $list
*
* @return (
* TRandList is array ? array<TRandKey, TRandVal> : (
* TRandList is XIterator ? XIterator<TRandKey, TRandVal> :
* IteratorIterator<TRandKey, TRandVal>|LimitIterator<TRandKey, TRandVal>
* ))
*/
public static function getPseudoRandomWithUrl(
array|XIterator|Traversable $list,
): array|XIterator|IteratorIterator|LimitIterator {
return $list;
}
}Expected output
No OOM
Did PHPStan help you today? Did it make you happy in any way?
Thank you for your work on phpstan <3