Skip to content

Reference to self:: constant in @implements leads "Allowed memory size of ... bytes exhausted" #8835

@arnaud-lb

Description

@arnaud-lb

Bug report

Referencing a constant from self:: in an @implements annotation leads to memory limit exhaustion.

Code snippet that reproduces the problem

<?php declare(strict_types = 1);

/** @template T */
interface I {
}

/** @implements I<self::X> */
class B implements I {
	const X = 'x';
}

(I was not able to create a playground link, because it crashes as well.)

Expected output

No error

Did PHPStan help you today? Did it make you happy in any way?

Yes!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions