On Mon, Sep 3, 2012 at 11:18 PM, Andrew Faulds <a...@ajf.me> wrote: > On 03/09/12 15:51, Ivan Enderlin @ Hoa wrote: >> >> >> I would like to know why? Is it a compiler related issue or just an >> omission? Would it be interesting to fix it? >> > There are plenty of examples of this. One from my code: > > Can't do this: > > self::$views[$path](); > > But I *can* do this: > > $x = self::$views[$path]; $x(); > > This is because PHP has a very unusual (and IMO bad) system of type-checking > at parse-time, by only allowing some specific (although quite varied) types > of variable access, and combinations of these.
It is great parser(simple and fast) which make php works well for years.. > > If nikic's idea to rewrite the parser to use an AST is done, I imagine this > could be fixed. We could also add extra rules, but I think fixing the > general issue is more important, since it's like plugging two holes in a > barrel full of water that's just had a machine gun fired at it. rewrite the parser for what? for more academism? we will rewrite it soon or later, but it's not because current one is bad, it will because a better parser tool shows up... thanks > > -- > Andrew Faulds > http://ajf.me/ > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- Laruence Xinchen Hui http://www.laruence.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php