Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82962 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18910 invoked from network); 17 Feb 2015 14:21:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Feb 2015 14:21:10 -0000 Authentication-Results: pb1.pair.com header.from=lisachenko.it@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=lisachenko.it@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.178 as permitted sender) X-PHP-List-Original-Sender: lisachenko.it@gmail.com X-Host-Fingerprint: 209.85.212.178 mail-wi0-f178.google.com Received: from [209.85.212.178] ([209.85.212.178:32919] helo=mail-wi0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E9/F5-19463-35E43E45 for ; Tue, 17 Feb 2015 09:21:09 -0500 Received: by mail-wi0-f178.google.com with SMTP id em10so33813996wid.5 for ; Tue, 17 Feb 2015 06:21:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=TJmp7O4l+R7TFRc9K3bNQ1ZjlDazTcTbKWCpAEayX+8=; b=GmGf0pAEitBRqGItTNFAEQBSpEi1tCqaXn/6/1uA5q5D6QxNwrsRYb5N7BO3rBPXym kpsCo4kUUNpF1VillJycRKprCGmWRuDhtEd4arWZslPQtKD1GDDmuOE9mwY7pwJYTryB gdPkeS7RhxtG++Y6ObLExATbdbf0BIhoRMRalZuEbIIE6SV6uL0qeXszY3cDrxOcD6KQ raEzO21+szZVSEsMbHTb76r6R5mkkb2HvkFZ/K9dWbpEBtrolExJT8YXWf/f/iD4AQzW IntabBSySf1AkojZdtMDhTFt9YRq/nAaIGMZgDR5UGPNQOsJJlRmcnP9C4jcnqaBM8oA Vb6w== MIME-Version: 1.0 X-Received: by 10.194.75.193 with SMTP id e1mr47844502wjw.126.1424182863889; Tue, 17 Feb 2015 06:21:03 -0800 (PST) Received: by 10.194.154.229 with HTTP; Tue, 17 Feb 2015 06:21:03 -0800 (PST) In-Reply-To: <54E3439D.30407@gmail.com> References: <54E3439D.30407@gmail.com> Date: Tue, 17 Feb 2015 17:21:03 +0300 Message-ID: To: Rowan Collins Cc: PHP internals list Content-Type: multipart/alternative; boundary=047d7bb03ea8b28b07050f496944 Subject: Re: [PHP-DEV] [RFC][Discussion] Parser extension API From: lisachenko.it@gmail.com (Alexander Lisachenko) --047d7bb03ea8b28b07050f496944 Content-Type: text/plain; charset=UTF-8 2015-02-17 16:35 GMT+03:00 Rowan Collins : > I think "should" is OK for extensions, but not for userland hooks. There > needs to be a very firm definition of the right and wrong way to implement > these hooks, which can at the very least warn the user when they are > slipping into undefined behaviour. Thanks for this point. Added this question to the list of open issues in RFC. My vision is to update a documentation with clear description, why parser extensions should be registered statically without conditions. Parsing process and limitations should be also described in the RFC. 2015-02-17 16:35 GMT+03:00 Rowan Collins : > The other alternative is to go to the other extreme, and have the > extensions scoped to a particular file, more like Perl pragmas. Dare I say > we could use the declare() syntax that everyone seems to have an irrational > hatred of? > > declare(pragma=Example\DbcParserExtension); > Ouch ) Don't like this way at all, because extensions should process all files, even if it's not marked with some hints. What I want to see is PHP analog of Java bytecode compilers, they can transform an original source code into specific tokens and provide custom extensions on top of that. So, I want to choose between php.ini option and explicit methods. Let's see another opinions. Thanks! --047d7bb03ea8b28b07050f496944--