-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[5.4] Support numeric arguments in break and continue (#17603)
* Support numeric arguments in break and continue As per the [PHP documentation](http://php.net/manual/en/control-structures.break.php) >break accepts an optional numeric argument which tells it how many nested enclosing structures are to be broken out of. The default value is 1, only the immediate enclosing structure is broken out of. * Set maximum value to be used Minimum count of structures to break out of is 1 * Regex update Allow for values greater than 9 * Formatting fixes * Update CompilesLoops.php * Update CompilesLoops.php * Adding tests for optional numeric argument Testing for a proper argument passed as well as white-spaced and a faulty (less than 1) ones * Support negative arguments Arguments that are less than zero are now caught by the regexp * Adding tests for optional numeric argument Testing for a proper argument passed as well as white-spaced and a faulty (less than 1) ones
- Loading branch information
1 parent
dc3fa7c
commit b375161
Showing
3 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters