Re: [PHP-DEV] semicolon terminator for switch cases

2020-03-26 Thread Christoph M. Becker
On 26.03.2020 at 23:04, Claude Pache wrote: >> Le 26 mars 2020 à 19:37, Ilija Tovilo a écrit : >> >> What's the reasoning behind this? I find it weird an inconsistent. > > This is a manifestly a leftover of an old syntax. Take a look at the PHP/FI 2 > manual: > > Language constructs: > https://w

Re: [PHP-DEV] semicolon terminator for switch cases

2020-03-26 Thread Claude Pache
> Le 26 mars 2020 à 19:37, Ilija Tovilo a écrit : > > What's the reasoning behind this? I find it weird an inconsistent. > This is a manifestly a leftover of an old syntax. Take a look at the PHP/FI 2 manual: Language constructs: https://www.php.net/manual/phpfi2.php#lang

Re: [PHP-DEV] semicolon terminator for switch cases

2020-03-26 Thread Claude Pache
> Le 26 mars 2020 à 21:49, Benoit SCHILDKNECHT a écrit : > > A semi-colon is terminal. Italways is. "You see this set of instructions? > Done.". But in this case, itis not. You see the problem? > No I don’t see the problem. Inside a switch construct, when you reach the end of an instructi

Re: [PHP-DEV] semicolon terminator for switch cases

2020-03-26 Thread Benoit SCHILDKNECHT
Le Thu, 26 Mar 2020 21:28:38 +0100, Stanislav Malyshev a écrit: Hi! On 3/26/20 1:26 PM, David Rodrigues wrote: I agree with Tovilo. It is weird and confusing. Actually I never know that it was possible. You seem to contradict yourself - if you never knew it was possible, how could you ever

Re: [PHP-DEV] semicolon terminator for switch cases

2020-03-26 Thread Stanislav Malyshev
Hi! On 3/26/20 1:26 PM, David Rodrigues wrote: > I agree with Tovilo. It is weird and confusing. Actually I never know > that it was possible. You seem to contradict yourself - if you never knew it was possible, how could you ever be confused by it? -- Stas Malyshev smalys...@gmail.com -- PH

Re: [PHP-DEV] semicolon terminator for switch cases

2020-03-26 Thread David Rodrigues
I agree with Tovilo. It is weird and confusing. Actually I never know that it was possible. And the ";" sounds like "it ends here", while ":" counds like "it does it ->". For me, "case 1;" will sounds like "skip case 1". Atenciosamente, David Rodrigues Em qui., 26 de mar. de 2020 às 17:14, Stan

Re: [PHP-DEV] semicolon terminator for switch cases

2020-03-26 Thread Stanislav Malyshev
Hi! > Maybe something to deprecate in PHP 8.0. > https://wiki.php.net/rfc/deprecations_php_8_0 Why? Whose life it'd make easier? -- Stas Malyshev smalys...@gmail.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] semicolon terminator for switch cases

2020-03-26 Thread Ilija Tovilo
Hi internals Looking through the language grammer I discovered that switch cases can also be terminated with a `;` instead of a `:`. ``` switch ($i) { case 1; return 1; default; return 2; } ``` https://3v4l.org/o7nD8 This is in fact documented: https://www.php.net/man