Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62751 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94062 invoked from network); 3 Sep 2012 16:03:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Sep 2012 16:03:36 -0000 Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.42 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.212.42 mail-vb0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:59836] helo=mail-vb0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 05/AE-20751-6D4D4405 for ; Mon, 03 Sep 2012 12:03:35 -0400 Received: by vbbfs19 with SMTP id fs19so5946638vbb.29 for ; Mon, 03 Sep 2012 09:03:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=cRfvzy4MLjFF3XhiFmcvZ5rtkQXqVZdKNMNtb/3P3ec=; b=IsmUXoxQ+CJZbqn+4UVM/j2lmHiy7rPpnd5W4raGTRwl8fdA4iel0dH1wrpPSVTvMp q7DuuLwMNs01yLzjQTtL0SweKV54bg/SsEWaZrsOwYJAWkzyQskHzJP7s/J2Do73Zz2L kJpImi7Z/OK94ZHVsWAXOj1uvqpgCqBCQz9Fk7LitQpUB76ffgUKJYaE8Pxb3UUSpW3H 6G0sw59Hhx47aJkhHgZ9MFGtAnH1KF+eu/lDD5Qwab1qdwCiMMpVcAWO1oQVOuyC7N37 1mRDbAH9ElVpaAAQ24LJcVqjUHL7MczDY/kp0Q6Ts9HJWfKeWvNDt1uB9X4j46wnTYrW st1Q== Received: by 10.220.228.131 with SMTP id je3mr12728633vcb.73.1346688212051; Mon, 03 Sep 2012 09:03:32 -0700 (PDT) MIME-Version: 1.0 Sender: laruence@gmail.com Received: by 10.220.18.15 with HTTP; Mon, 3 Sep 2012 09:03:10 -0700 (PDT) In-Reply-To: <5044CA5C.9080208@ajf.me> References: <5044C3E6.8040202@hoa-project.net> <5044CA5C.9080208@ajf.me> Date: Tue, 4 Sep 2012 00:03:10 +0800 X-Google-Sender-Auth: 32EFbUovPPISMYalZEGrkKMjdBk Message-ID: To: Andrew Faulds Cc: ivan.enderlin@hoa-project.net, internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] $obj->attr::method() is not allowed From: laruence@php.net (Laruence) On Mon, Sep 3, 2012 at 11:18 PM, Andrew Faulds 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/