Re: [PHP-DEV] PHP 4.0 Bug #8428 Updated: continue doesn't pass thru a switch statement From: Stanislav Malyshev (stas <email protected>)
Date: 01/08/01

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 <email protected>  http://www.zend.com/ +972-3-6139665 ext.115

-- 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>