Date: 01/08/01
- Next message: cynic <email protected>: "[PHP-DEV] PHP 4.0 Bug #8596: PHP fails to set $HTTP_SESSION_VARS"
- Previous message: Richard Heyes: "[PHP-DEV] RE: [PHP-PEAR] CVS ACL's have been activated"
- In reply to: Stanislav Malyshev: "Re: [PHP-DEV] PHP 4.0 Bug #8428 Updated: continue doesn't pass thru a switch statement"
- Next in thread: Stanislav Malyshev: "Re: [PHP-DEV] PHP 4.0 Bug #8428 Updated: continue doesn't pass thru a switch statement"
- Reply: Stanislav Malyshev: "Re: [PHP-DEV] PHP 4.0 Bug #8428 Updated: continue doesn't pass thru a switch statement"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, 8 Jan 2001, Stanislav Malyshev wrote:
> SV>> And in C it doesn't, that is, it continues the loop enclosing the switch.
> SV>> I think we should have behavior similar to C here, anything else would be
> SV>> confusing. The C behavior is more useful too I think.
>
> I think C behaviour is most confusing (which is no wonder given how many
> confusing behaviours C has). Why "break" works on switch and its brother
> "continue" works on enclosing loop? Oh, just because C makers were short
> on words and constantly used same keywords to represent different
> things? Not good enough.
The C behaviour may be confusing, but it's been out there for 20+ years.
IMHO, if PHP borrows syntax from C that looks identical, it should act
identical. And, I'd claim it's particularly important /because/ many
people think the C spec is confusing. It's hard enough memorizing odd
language behavior, you don't want to remember that C works one way and PHP
the other.
Just as PHP tries very hard not to break backwards compatibility with old
PHP syntax that doesn't seem proper, I'd say this is breaking
compatibility with C syntax, which pre-dates the PHP. Now, PHP isn't C,
but if you're going to borrow from C, it should be done cleanly and
exactly, or completely differently; otherwise, they'll just be confusion.
One of the most annoying things to me is that the associativity of ?: is
/backwards/ when compared to C. Talk about a subtle bug waiting to slip
in. Who would think to check this? The last thing one assumes is that the
parser is incorrect?
Unfortunately, it was agreed not to make this change due to legacy
reasons. Maybe we'll make the same evaluation here, but I'd prefer that
it's admitted as a "bug" not as a "feature." :)
-adam
-- / adam maccabee trachtenberg | visit college life online \ \ adam <email protected> | http://www.student.com /-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: cynic <email protected>: "[PHP-DEV] PHP 4.0 Bug #8596: PHP fails to set $HTTP_SESSION_VARS"
- Previous message: Richard Heyes: "[PHP-DEV] RE: [PHP-PEAR] CVS ACL's have been activated"
- In reply to: Stanislav Malyshev: "Re: [PHP-DEV] PHP 4.0 Bug #8428 Updated: continue doesn't pass thru a switch statement"
- Next in thread: Stanislav Malyshev: "Re: [PHP-DEV] PHP 4.0 Bug #8428 Updated: continue doesn't pass thru a switch statement"
- Reply: Stanislav Malyshev: "Re: [PHP-DEV] PHP 4.0 Bug #8428 Updated: continue doesn't pass thru a switch statement"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

