Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60032 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84484 invoked from network); 16 Apr 2012 23:09:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Apr 2012 23:09:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=tom@punkave.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tom@punkave.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain punkave.com designates 209.85.160.170 as permitted sender) X-PHP-List-Original-Sender: tom@punkave.com X-Host-Fingerprint: 209.85.160.170 mail-gy0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:40124] helo=mail-gy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3B/35-05733-5B6AC8F4 for ; Mon, 16 Apr 2012 19:09:42 -0400 Received: by ghbg2 with SMTP id g2so3162484ghb.29 for ; Mon, 16 Apr 2012 16:09:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding:x-gm-message-state; bh=/tjUihKSGpO9h4IMaHJjLdktW7vCFAs96xQQPTnS+kU=; b=HV7d3LZnNaXdVawjSTyhjtJUwcQTv91DLd9HJ0MMAT28rglCiPOe2ivGVZuQ5YjBFG a0lSlFXGlTBTem4NaAug+UH5OH2+b7OUiha5a+y4M664dlu4L2uHF/lAwo4ETFCgjsk9 elhD33g92fg1OstoaEOQJ1lIFmhBDQgYrP0IP+a9PNlYQYMIWj2prl4cKaksRCQpZLca 0PzFOUSMNBfAgL12I6BmyHGyl6Nu2LJTbpiaoA7s6yoU2ICGLyd71NoSvQTQR0nOfRvg yh7pInY6F2H1RAJ7BVr4pLK16Lw0OCC3SAN+v0kyv9rvYl3rxA9QkCeS0AEBdJLEDNNr TT9Q== MIME-Version: 1.0 Received: by 10.236.193.101 with SMTP id j65mr12879276yhn.47.1334617779366; Mon, 16 Apr 2012 16:09:39 -0700 (PDT) Received: by 10.101.57.14 with HTTP; Mon, 16 Apr 2012 16:09:39 -0700 (PDT) In-Reply-To: References: <4F8C577D.4010303@developersdesk.com> Date: Mon, 16 Apr 2012 19:09:39 -0400 Message-ID: To: PHP Internals Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmOiObYtYNH1UWH3L8MYmkR4sRCzFkk6/4Py1HyW8yThtiudSUak5kt4BnRIXzJspsb7BAD Subject: Re: [PHP-DEV] Re: Go for votes for the open tag-less PHP files From: tom@punkave.com (Tom Boutell) What happens if two of them pass? On Mon, Apr 16, 2012 at 6:55 PM, Arvids Godjuks wrote: > 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: >> >> >> >> =9Aecho include 'foo.bar', 'baz'; >> >>> >> >> >> > Probably not, =9ATry it! =9Ayou get: >> > >> > 1baz >> > >> > It actually works more like >> > >> > =9A echo (include "foo.bar"), 'baz'; >> > >> > than >> > >> > >> > =9A echo include( "foo.bar"), 'baz'; >> > >> > >> > >> > More important include doesn't currently allow multiple parms: >> > >> > =9A 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. =9AIn 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. =9ABut I do think we're making prog= ress, >> so I would ask for a little extra patience from the peanut gallery for >> now. =9A=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. =9AIf nobody speaks-up, I'll just assume that we have consens= us on >> that point and add it to the RFC. >> >> Regarding include/require, I agree that any BC break would be extremely >> minimal. =9AIn the 10+ years I've been developing PHP, I don't think I'v= e >> ever once seen somebody include multiple scripts on a single line (I was= n't >> even aware that such a thing was allowed). =9ASo if it does pose a chang= e, >> I'd be surprised if any existing scripts would be affected. =9AAnd 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? =9AFor 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) >> >> =9A - If the included file contains PHP code, parse it. >> >> >> PHP_SCRIPT_TYPE_TAGLESS (0x02) >> >> =9A - Code is assumed to be PHP throughout the script. =9AThe > =9A E_NOTICE and the ?> tag throws E_RECOVERABLE_ERROR. >> >> >> PHP_SCRIPT_TYPE_STACK (0x04) >> >> =9A - The $script_type is applied to all child scripts of the one being >> =9A included. >> =9A - Question : Would anyone see value in adding an override constant t= hat, >> =9A while not recommended, allows the developer to apply a different >> =9A $script_type somewhere deeper in the stack? =9APersonally this doesn= 't >> sound >> =9A useful to me, but I'd be willing to put it in if enough of you wante= d it. >> >> >> PHP_SCRIPT_TYPE_CODE_FILE (PHP_SCRIPT_TYPE_NORMAL & >> PHP_SCRIPT_TYPE_TAGLESS) >> >> =9A - The entire script is assumed to be PHP code and is parsed accordin= gly. >> >> >> PHP_SCRIPT_TYPE_CODE_STACK (PHP_SCRIPT_TYPE_NORMAL & >> PHP_SCRIPT_TYPE_TAGLESS & PHP_SCRIPT_TYPE_STACK) >> >> =9A - The entire script and all its child scripts (i.e. its "stack") are >> =9A 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. --=20 Tom Boutell P'unk Avenue 215 755 1330 punkave.com window.punkave.com