Re: Switch Table Extension for PHP
| From: | Derick Rethans | Date: | Fri, 01 Aug 2008 16:44:16 +0000 |
| Subject: | Re: Switch Table Extension for PHP | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-39545@lists.php.net to get a copy of this message | ||
On Fri, 1 Aug 2008, Dmitry Stogov wrote:
> The whole idea is great, but it'll work without problems only if
> switch-tables are constructed at compile (or optimization) time.
>
> The idea also won't work with variables and unresolved constants as
> "case" labels (I saw your extension already carries about this limitation).
>
> I think the proper way to implement the idea is introducing a new opcode
> ZEND_SWITCH which has switch table as IS_CONSTANT_ARRAY operand.
Doesn't this make more sense to do in an optimizer? I thought the
general idea was that we don't try to make the compiler do all the heavy
optimizations.. as there are many more we could do here.
regards,
Derick
--
HEAD before 5_3!: http://tinyurl.com/6d2esb
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org