Skip to content

Conversation

@brainfoolong
Copy link
Contributor

This a bugfix for php 7.3 (or even 7.2?) related errors where using continue inside a switch raises a php warning. Either use continue 2 or break. Previously continue behaves like break but the intended usage is to continue the for loop instead, i guess.

@PowerKiKi
Copy link
Member

I cannot find anything related to that in http://php.net/manual/en/control-structures.switch.php. Do you another reference ?

@brainfoolong
Copy link
Contributor Author

Yep, 7.3 change -> see https://github.com/php/php-src/blob/php-7.3.0RC2/UPGRADING Point 1 -> Backward Incompatible Changes ->

"continue" statements targeting "switch" control flow structures will now
generate a warning. In PHP such "continue" statements are equivalent to
"break", while they behave as "continue 2" in other languages.

@PowerKiKi PowerKiKi merged commit 9022c39 into PHPOffice:develop Sep 29, 2018
@PowerKiKi
Copy link
Member

This demonstrate the error: https://3v4l.org/la8dg

Thanks for the PR !

Dfred pushed a commit to Dfred/PhpSpreadsheet that referenced this pull request Nov 20, 2018
This a bugfix for php 7.3 related errors where using continue inside a switch raises a PHP warning. Either use continue 2 or break. Previously continue behaves like break but the intended usage is to continue the for loop instead.
@funtaps
Copy link

funtaps commented Aug 6, 2019

Are you sure that it is a proper fix?
When I look at _readPpsWks
It seems like, if first $type go to default - there will be error (since $pps wouldn't be defined).
If it is not first iteration, that goes to default - previous $pps will be modified.

BlackyTay pushed a commit to BlackyTay/PhpSpreadsheet that referenced this pull request Aug 8, 2025
This a bugfix for php 7.3 related errors where using continue inside a switch raises a PHP warning. Either use continue 2 or break. Previously continue behaves like break but the intended usage is to continue the for loop instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants