Reputation: 57
Hy guys.
Thank you for your help. The answers in this forum are great!
In my site, i want to see the content from a xls Excel Spreadsheet. After long searching i found this Project: https://github.com/PHPOffice/PHPExcel/
I get the classes and tried it. Works great!
It works so good, that i can't believe, that it is free. Is it free to use?
at the top of my site, i got this error massage: Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in test/Classes/PHPExcel/Shared/OLE.php on line 288
Upvotes: 2
Views: 8949
Reputation: 127
As mentioned in the error, I replaced continue by continue 2 and it resolved the error
Upvotes: 3
Reputation: 3492
Think this:
For break
and continue
, a switch
is like a loop, that runs only once. break
leaves every loop, and switch-loop too.
continue
starts the next iteration of a loop. Because switch
runs only once, it terminate the switch-loop.
To restart or leave outer loops (this includes outer switch
too) use a positive integer behind break
and continue
.
Upvotes: 1
Reputation: 316
about the first question (if it's free).
Since the author of repository it's under of GNU (in the repo has the link, but if you didn't read it or see it here's -> https://github.com/PHPOffice/PHPExcel/blob/master/license.md).
Second, about your continue 2
error, you need check first which version of PHP you're running, those continues
issues are very frequently in some old libraries (mainly this one the last significant update was 6 years ago).
If you check the issues of Github you'll see there's an exact bug issue opened about what you're asking here https://github.com/PHPOffice/PHPExcel/issues/436.
Ok, but what's the solution?!
Well, you have 2 simples solutions:
1 - Use another library or create yours. 2 - Try to fix the issue.
Particularly if I was you I chose the first, and now when you get some new library/plugin I strongly suggest you before download it check the issues in the repository to avoid has those weird bugs in your system.
If you anyway choose for some reason keep going with this one, try to fix it and open a PR.
As per documentation, you can fix easily https://php.net/manual/en/control-structures.continue.php and just compile again the library and it's done.
Upvotes: 3
Reputation: 524
It looks that you are using old PHP version. Try updating it to 7.3+
And go look here - https://wordpress.org/support/topic/warning-continue-targeting-switch-is-equivalent-to-break/
They have the same problem as you.
Alsoo, on github there is information that repo is deprecated. Maybe use this ? - https://github.com/PHPOffice/PhpSpreadsheet
Upvotes: 0