oyejorge / less.php

less.js ported to PHP.
http://lessphp.typesettercms.com
Apache License 2.0
657 stars 2 forks source link

Fix continue statement within switch/case keeping original behavior #367

Closed stronk7 closed 3 years ago

stronk7 commented 5 years ago

continue statements within switch/case statements always have behaved like break (ending the switch). Only exception is when they are within a loop and we may want to use 'continue 2;' instead (to jump to next iteration).

PHP7.3 has added a PHPWarning for all this switch/case/continue uses (https://wiki.php.net/rfc/continue_on_switch_deprecation) so this just changes is to the BC equivalent break. As far as there isn't remaining code in the loop after the switch, it is 100% the same than a continue 2.

Krinkle commented 5 years ago

@Asenar @oyejorge Would be great if this patch could be fast-tracked to keep less.php happy under PHP 7.3 without warnings.

This issue is is currently on a short-list of issues preventing MediaWiki's CI from passing under PHP 7.3. We might be able to suppress the warning from all call sites, but I'd be great to put that effort toward helping upstreams instead. Let me know if there's anything I can do to help.

kylekatarnls commented 5 years ago

Hi, no PR has been merged since March 2017. Not sure it will be maintained again. But you can user this fork instead: https://github.com/kylekatarnls/less.php (composer require kylekatarnls/less.php) or this wrapper of the node package: https://github.com/kylekatarnls/less