Hi

Am 2024-11-20 20:03, schrieb Derick Rethans:
All my PHP based templates for the xdebug.org site use this style. I don't think it's atrocious, and quite a bit nicer than the "new" syntax.

This proposal would not affect that. You would just need to add a colon after the `case` statement, not a semicolon. In fact that would more closely match the corresponding `switch`, which would also need to have a colon:

    <?php $foo = "bar"; ?>

    <?php
    switch ($foo):
    case "bar":
    ?>
    BAR
    <?php break; case "baz": ?>
    BAZ
    <?php endswitch; ?>

Though using `switch` in such templates is somewhat finicky anyway, because it will need to be merged with the first `case`, because otherwise:

Parse error: syntax error, unexpected T_INLINE_HTML "", expecting "endswitch" or "case" or "default"

Best regards
Tim Düsterhus

Reply via email to