Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60031 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83206 invoked from network); 16 Apr 2012 23:08:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Apr 2012 23:08:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.170 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 74.125.82.170 mail-we0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:34248] helo=mail-we0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7E/E4-05733-766AC8F4 for ; Mon, 16 Apr 2012 19:08:24 -0400 Received: by werh12 with SMTP id h12so4304171wer.29 for ; Mon, 16 Apr 2012 16:08:20 -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=zGXCbzrveP8wGDYYrsWxFdm4+yUK/f+uprC0adwH9LA=; b=x1cEHRUToJczbR8R8evXXj2E/9gLI1PM2tGiaODrjUGRHZC741W/LNqj09QK0/Wkyr bW8BRia1NpqPXAtn1sSdsAXmqBw1HjmdaYrEYWZLI+Zdt1T+Tv6JLtjzzXPDkFnp1wVJ aPAZFR3yCEpED6oO46o0f/RwT9tn4LE9VmM7a2CodhAIuRB9HUkg+bYWYuL6Xa7w7sEh TnJ2ppn268/rkr0kqMI1dUgVnuwlaJSWO5cPlL9oxEUkaherpfJh5Kzzc9aN3Ryk50b/ YM7Gmy5SrmcXKslHsMumG+0G4vwGzAk66Y/t8JXCK7b0vC9WtwHavDK0iMJ8s6LCtY4N YO/g== MIME-Version: 1.0 Received: by 10.180.91.168 with SMTP id cf8mr15289492wib.0.1334617700684; Mon, 16 Apr 2012 16:08:20 -0700 (PDT) Received: by 10.223.1.82 with HTTP; Mon, 16 Apr 2012 16:08:20 -0700 (PDT) In-Reply-To: References: <4F8C577D.4010303@developersdesk.com> Date: Mon, 16 Apr 2012 16:08:20 -0700 Message-ID: To: Arvids Godjuks Cc: Rick WIdmer , internals@lists.php.net Content-Type: multipart/alternative; boundary=f46d04389347f5d44404bdd3e503 Subject: Re: [PHP-DEV] Re: Go for votes for the open tag-less PHP files From: kris.craig@gmail.com (Kris Craig) --f46d04389347f5d44404bdd3e503 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On Mon, Apr 16, 2012 at 3:55 PM, Arvids Godjuks w= rote: > 16 =C1=D0=D2=C5=CC=D1 2012 =C7. 22:02 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC= =D8 Kris Craig =CE=C1=D0=C9=D3=C1=CC: > >> 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. =3D) >> >> 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 wou= ld >> 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 =3D 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 > >> E_NOTICE and 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 tha= t, >> >> 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 accordingl= y. >> >> >> >> 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 >> > > I think there is no need for that many constants and types of inclusion. > Just a PHP_SCRIPT_TYPE_NORMAL and PHP_SCRIPT_TYPE_CODE will suffice (the > later just expects the header, and no other ?> or principle still applies, and it should be kept that way. Too many options > and you end up with people abusing that on purpose with reasoning "Becaus= e > I can, f**k everybody else!" (it's a "pleasure" to work with such people)= . > I don't like the idea of removing the mess up the syntax highlighting everywhere and annoy people that copy the > plain code without the code. > Restricting it to just those two is a non-starter, period. It would unravel the compromise solution that has been worked out where three types exist. And I think a bitwise constant is the most logical approach. Keep in mind that scalability is a potential factor as well. It's possible that, at some point in the future, new ideas may emerge that add even more options to script inclusion, in which case having a flexible bit constant would allow this to scale without having to add additional arguments or other needless complexities. In this case, more constants means more flexibility for the developer IMHO. --Kris --f46d04389347f5d44404bdd3e503--