Skip to content

Array key strings force to autoload classes #3193

@damnedest

Description

@damnedest

Bug report

Code snippet that reproduces the problem

https://phpstan.org/r/192fbbc0-dff6-4fa1-ac5a-eab363cc3d23

And class Image/Url should exist (in my environment class is in lib/Image/Url.php).

Expected output

No errors.

Current output

$ phpstan analyse -l 5 --memory-limit=3G --debug lib/Controller/SomeFile.php --debug
Note: Using configuration file /path/phpstan.neon.

To avoid this issue, allow to use more memory with the --memory-limit option.
/path/lib/Controller/SomeFile.php
PHP Fatal error:  Cannot declare class Image\Url, because the name is already in use in /path/lib/image/url.php on line 7

Fatal error: Cannot declare class Image\Url, because the name is already in use in /path/lib/image/url.php on line 7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions