Skip to content

Unsupport break 2 statement #4346

@tomaj

Description

@tomaj

Bug report

Code snippet that reproduces the problem

https://phpstan.org/r/0765246a-0405-472f-9976-45d78cebc7b0

<?php 

while (true) {
	while (true) {		
	    break 2;
	}
}
echo 2;

Expected output

Expected no errors to output as break 2 should break parent while

Actual output

Line Error
8. Unreachable statement - code above always terminates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions