Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Php56][Php70] Handle infinite loop on AddDefaultValueForUndefinedVariableRector+IfToSpaceshipRector #3394

Merged
merged 7 commits into from
Feb 20, 2023

Conversation

samsonasik
Copy link
Member

Given th following code

class Fixture
{
    public function sortRank($a, $b)
    {
        if ($a == $b) {
            return 0;
        }

        return ($a > $b) ? -1 : 1;
    }
}

It cause crash:

Runtime:       PHP 8.1.13
Configuration: /Users/samsonasik/www/rector-src/phpunit.xml

[1]    14431 segmentation fault  vendor/bin/phpunit tests/Issues/DefaultValueSpaceShip

Ref https://getrector.com/demo/b0b4b1b4-dfd3-4034-a2c7-402b618f56d2
Fixes rectorphp/rector#7788

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @Freespacer

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@samsonasik
Copy link
Member Author

@TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit 38372f2 into main Feb 20, 2023
@samsonasik samsonasik deleted the infinite-loop-default-value-spaceship branch February 20, 2023 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant