Ferenc Kovacs wrote (on 06/08/2014):
Hi,
I think dropping this behavior is a good idea, but I'm confused by the
reasoning related to the langspec.
This rfc targets php.next (which is a safe move as this has BC break albeit
would require some questionable code), but the langspec was agreed to be
based on 5.6 and document how that works.
So even if we accept this rfc, and remove the multiple default case,
wouldn't we still need to document the current behavior in the spec (maybe
mentioning that it will go away in php-net)?
According to the bug report, HHVM also accepts multiple default blocks,
but uses the first rather than the last. It's probably not worth
implementing specific code there to take the last default label just in
order to adhere to a 5.6 spec, but is worth making it detect multiple
labels to bring it in line with the proposed change.
So either we declare the php.net implementation to be in violation of
the spec (which isn't completely insane - the spec shouldn't mirror
behaviour to the point of incorporating the entire bug list); or we
document the php.net behaviour as "correct", but accept that nobody is
going to implement that part of the spec as written, and fix it in the
next release of both the implementation and the spec.
Having the 5.6 spec match behaviour, and starting a 5.7 draft
immediately for implementations to actually target might be a compromise?
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php