Re: PHP 4.0 Bug #8428 Updated: continue doesn't pass thru a switch statement

From: Date: Mon, 08 Jan 2001 16:32:30 +0000
Subject: Re: PHP 4.0 Bug #8428 Updated: continue doesn't pass thru a switch statement
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-43396@lists.php.net to get a copy of this message
AT>> The C behaviour may be confusing, but it's been out there for 20+ years. AT>> IMHO, if PHP borrows syntax from C that looks identical, it should act AT>> identical. And, I'd claim it's particularly important /because/ many Consider this syntax borrowed from Perl, not C :) In Perl it behaves in quite different way, IIRC. AT>> people think the C spec is confusing. It's hard enough memorizing odd AT>> language behavior, you don't want to remember that C works one way and PHP AT>> the other. Well, you do. PHP is not C in many aspects. That's just one of them I guess. AT>> PHP syntax that doesn't seem proper, I'd say this is breaking AT>> compatibility with C syntax, which pre-dates the PHP. Now, PHP isn't C, PHP was never declared to have identical syntax with C, so I don't see here breaking anything. AT>> One of the most annoying things to me is that the associativity of ?: is AT>> /backwards/ when compared to C. Talk about a subtle bug waiting to slip AT>> in. Who would think to check this? The last thing one assumes is that the AT>> parser is incorrect? Why is it _incorrect_? Just because C is always correct? BTW, I would always advise against using of evaluation order of _any_ operator (except probably for logic shortcuts) because it's just not readable (and not portable, as you just saw). -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115

« previous php.dev (#43396) next »