Skip to content

memory error in StrRepeatFunctionReturnTypeExtension.php #6866

@mathroc

Description

@mathroc

Bug report

Code snippet that reproduces the problem

<?php declare(strict_types = 1);

str_repeat('abcdefghij', 1_000_000_000);

(can't share a link with this snippet on phpstan.org, it errors with An error occured. Please try again later.)

Expected output

No output expected. Got this instead:

Child process error (exit code 255): Fatal error: Allowed memory size of 4294967296 bytes exhausted (tried to allocate  
10000000032 bytes) in phar:///var/www/bin/phpstan/src/Type/Php/StrRepeatFunctionReturnTypeExtension.php on line 42      
                                                                                                                        
PHPStan process crashed because it reached configured PHP memory limit: 4096M                                           
Increase your memory limit in php.ini or run PHPStan with --memory-limit CLI option. 

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

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