Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60008 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35785 invoked from network); 16 Apr 2012 19:03:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Apr 2012 19:03:02 -0000 Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.182 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 209.85.212.182 mail-wi0-f182.google.com Received: from [209.85.212.182] ([209.85.212.182:63639] helo=mail-wi0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EF/7B-05733-5EC6C8F4 for ; Mon, 16 Apr 2012 15:03:02 -0400 Received: by wibhr14 with SMTP id hr14so4870654wib.11 for ; Mon, 16 Apr 2012 12:02:59 -0700 (PDT) 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=v3naaGtAy4uQE1jQ00CrHkP5/4PVHyZsBB13FJc03+g=; b=N/S2QAKeG4KqeMhYdCc/re9J4u22zV2AgA0qytpcLe/kPs/do4mNqqW4QguXRnJjl7 xwYBM/0JxvEFo+/157vVyzQ5++lk5+Kp6vOyQAlj0QHxSRhkYOOdqDVlDpHuEL82/72e J8MO/0LtcB4TLVRtO4TwGC96jwRp4GNCjyR7QXHQmhnFm4LDzTT5UF5xtuV9JGkuuQ1c 0/EDdKzKjI2Lq+XNVGqL5kM0JEMGwh8ZEYEEPvBU3Fw1GQpvTbeXu5Oi0KPuho9/E9HN l7eN6ZPBVLTysAnoibWHYX0AAsWj+3F/lq9ubDP17ki27LBJSr21nKrHklEmwcpdUUX8 I/DA== MIME-Version: 1.0 Received: by 10.180.95.197 with SMTP id dm5mr7423wib.20.1334602978881; Mon, 16 Apr 2012 12:02:58 -0700 (PDT) Received: by 10.223.1.82 with HTTP; Mon, 16 Apr 2012 12:02:58 -0700 (PDT) In-Reply-To: <4F8C577D.4010303@developersdesk.com> References: <4F8C577D.4010303@developersdesk.com> Date: Mon, 16 Apr 2012 12:02:58 -0700 Message-ID: To: Rick WIdmer Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=f46d04447f4778f19004bdd078d2 Subject: Re: [PHP-DEV] Re: Go for votes for the open tag-less PHP files From: kris.craig@gmail.com (Kris Craig) --f46d04447f4778f19004bdd078d2 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Apr 16, 2012 at 10:31 AM, Rick WIdmer wrote: > On 4/16/2012 3:31 AM, Arvids Godjuks wrote: > >> That's sad really, to be honest. >> I wonder if people even use this: >> >> echo include 'foo.bar', 'baz'; >>> >> > Probably not, Try it! you get: > > 1baz > > It actually works more like > > echo (include "foo.bar"), 'baz'; > > than > > > echo include( "foo.bar"), 'baz'; > > > > More important include doesn't currently allow multiple parms: > > include "foo.bar", 'baz'; > > Parse error: syntax error, unexpected ',' in bla.php on line xx > > > > > Rick > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > I'll reiterate my position that I'm not ready to bring my RFC to a vote; and even if I was, the rules wouldn't allow it. In fact, unless I'm mistaken, none of the RFCs have met the 2-week minimum requirement yet, so no vote can take place at this time. But I do think we're making progress, so I would ask for a little extra patience from the peanut gallery for now. =) To Arvids' point, I'm definitely leaning in that direction, but I'd like to hear a little bit more from anyone who believes a different approach would be better. If nobody speaks-up, I'll just assume that we have consensus on that point and add it to the RFC. Regarding include/require, I agree that any BC break would be extremely minimal. In the 10+ years I've been developing PHP, I don't think I've ever once seen somebody include multiple scripts on a single line (I wasn't even aware that such a thing was allowed). So if it does pose a change, I'd be surprised if any existing scripts would be affected. And since this is a major version increment we're talking about here, I think a small amount of allowance can be made for low-impact BC breakage IMHO. How about we just keep the parentheses optional and comma-seperate the arguments? For example, the require syntax could look like this: require[(] $script_filename, $script_type = PHP_SCRIPT_TYPE_NORMAL [)]; Possible values for $script_type: PHP_SCRIPT_TYPE_NORMAL (0x01) - If the included file contains PHP code, parse it. PHP_SCRIPT_TYPE_TAGLESS (0x02) - Code is assumed to be PHP throughout the script. The tag throws E_RECOVERABLE_ERROR. PHP_SCRIPT_TYPE_STACK (0x04) - The $script_type is applied to all child scripts of the one being included. - Question : Would anyone see value in adding an override constant that, while not recommended, allows the developer to apply a different $script_type somewhere deeper in the stack? Personally this doesn't sound useful to me, but I'd be willing to put it in if enough of you wanted it. PHP_SCRIPT_TYPE_CODE_FILE (PHP_SCRIPT_TYPE_NORMAL & PHP_SCRIPT_TYPE_TAGLESS) - The entire script is assumed to be PHP code and is parsed accordingly. PHP_SCRIPT_TYPE_CODE_STACK (PHP_SCRIPT_TYPE_NORMAL & PHP_SCRIPT_TYPE_TAGLESS & PHP_SCRIPT_TYPE_STACK) - The entire script and all its child scripts (i.e. its "stack") are assumed to be PHP code and parsed accordingly. What do you think? --Kris --f46d04447f4778f19004bdd078d2--