Re: Deprecate alternate switch case syntax?
| From: | Derick Rethans | Date: | Wed, 20 Nov 2024 19:03:29 +0000 |
| Subject: | Re: Deprecate alternate switch case syntax? | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-126007@lists.php.net to get a copy of this message | ||
On 20 November 2024 19:26:12 CET, Theodore Brown <theodorejb@outlook.com> wrote:
>On Wed, Nov 20, 2024 at 09:23 Kamil Tekiela wrote:
>
>> Do you know why the two exist? Was there any historical reason for this?
>>
>> From what cmb69 said[1], it seems like it may exist because of the
>> implicit semicolon in ?>, and after I tested it, it seems to be true.
>> Was there ever any other reason?
>
>I hope no one writes code like that where separate <?php ?> tags are interleaved around
>each switch, case, break, and endswitch statement. That's atrocious...
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.
It's also not a decades old choice (and not even by me).
cheers
Derick