On 17/10/2019 21:54, Mike Schinkel wrote:
Additionally it could be added in 8.0 and then in 8.1 flagged with a warning 
when a CASE does not have one for the two, but only if people don't object to 
this. While I know some on this list feel strongly that warnings must come with 
to future plans to generate errors I would personally be 100% okay if it 
indefinitely generated only a warning.

Would you put this at switch level, or case level?

Unless your plan is to redefine how switch works by default, which would be quite ambitious, I'm not sure it makes a great deal of sense to add a token that would effectively no-op in all circumstances.

It sounds like a job for a static analysis comment:

/** @DisableSwitchStatementFallthroughWarning */
switch ($x) {
  case 1:
    $x = doSomething();

  case 2:
    doLaLaLaLa();
    break;

  default:
    doTralala();
}

--
Mark Randall

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to