When using PHP 7.3, the main scald.module causes this warning:

"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? scald.module:807

This is in scald_search() and is caused by having a continue in a switch within a foreach (or any kind of loop for that matter).

This is similar to #3025014: PHP 7.3 Bug: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2", caused by https://github.com/php/php-src/pull/3364/files

CommentFileSizeAuthor
#3 3032429-1-php73-continue.patch346 bytesDeFr

Comments

fgm created an issue. See original summary.

fgm’s picture

Issue tags: +PHP 7.3

Tagging.

DeFr’s picture

Status: Active » Needs review
StatusFileSize
new346 bytes

Easy fix ; the whole default: continue; in that function is a leftover from prehistoric time where there was a trigger_error call when something was passed to scald_search that wasn't recognized. Now that it's silently dropped, we may as well remove the default completly…

fgm’s picture

I tend to always leave a default in switches, if only to log an error if the value is unexpected. Don't you think it would be careful ?

niklp’s picture

Agree, but I'd always used default: break; - is that weird?

  • nagy.balint committed aeaeeb7 on 7.x-1.x authored by DeFr
    Issue #3032429 by DeFr, fgm, NikLP: continue vs break 2 warning with PHP...
nagy.balint’s picture

Status: Needs review » Fixed

Committed the patch to solve the php 7.3 issue. Follow up patch can be made if it seems necessary.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.