Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59425 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40193 invoked from network); 7 Apr 2012 16:20:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Apr 2012 16:20:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=luke@cywh.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=luke@cywh.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cywh.com from 209.85.212.42 cause and error) X-PHP-List-Original-Sender: luke@cywh.com X-Host-Fingerprint: 209.85.212.42 mail-vb0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:36267] helo=mail-vb0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 74/6A-23111-759608F4 for ; Sat, 07 Apr 2012 12:20:39 -0400 Received: by vbjk13 with SMTP id k13so1937470vbj.29 for ; Sat, 07 Apr 2012 09:20:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=references:from:in-reply-to:mime-version:date:message-id:subject:to :cc:content-type:content-transfer-encoding:x-gm-message-state; bh=EUZf4DFU1d9gVgRXzGHcZKRB8PZQed9K0w6brnYiBdU=; b=hQ68PEXrik3QlCSANMy4EBBRVTT+d4J5GyEWOvayi1uzFXOtUZ73TcSQN+jITBoO4u 3ylmolY9APDYOsts7Xl1wLfcHPXaljf5OkdNS1PAPVCrCq2x7og7tKbeo5VrGheZB5Fz vhGtP8sN4NyAjaE7R+4lHBiq2qBImKP34+I4TPDe3+H05HMgPqkSFsUbUNAzu/lBtk13 YN5cBFiExhgibywanx2pXYoGSNXA9EmnvyF4bMCEvDVauCni5p2oPCVWs5/euH4WV7P1 I5Fg0avhWjFbR6nj05fX1+/6cE6tRPeymfuHQz8hkXQyxS+1TIxm08PTev8k5Baf947A 1HQA== Received: by 10.52.65.134 with SMTP id x6mr696215vds.60.1333815636034; Sat, 07 Apr 2012 09:20:36 -0700 (PDT) References: <03FFDCA3-90B2-48CA-B102-7562E0E9CA45@zort.net> <7019423255875772333@unknownmsgid> <93A21C4E-C811-4D2A-9304-6DDF1E8994FB@punkave.com> In-Reply-To: <93A21C4E-C811-4D2A-9304-6DDF1E8994FB@punkave.com> Mime-Version: 1.0 (1.0) Date: Sat, 7 Apr 2012 09:20:34 -0700 Message-ID: <-1019802484564133356@unknownmsgid> To: Tom Boutell Cc: PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQnpktpwNDhD33AOfj41F7T4aY18M4+GJ7gBWBWRHobVTBTmhXoWouugcfbW/cPRpY3bNT2Z Subject: Re: [PHP-DEV] PHP class files without wrote: > A thoughtful suggestion. But the trouble with a php.ini setting is that y= ou can't tell if it is enabled when writing your class file. That makes it = impossible to write portable libraries. The keywords would always be availa= ble. And no one has to type them outside of an auto loader (: > > Sent from my iPhone Why would you need to? With it on or off ends php code and prints text between it and the next is explicitly forbidden. If classes start with this should be fine. Most classes written with PHP 5+ comparability do this anyway. The only way I see this not working is for PHP short tags where PHP is used as a template language. A lot of people decide to use other template engines though, like Twig. I personally avoid short tags on large projects and use them only on small quick and dirty projects. Luke (Sorry, I keep forgetting to hit reply all) > > On Apr 7, 2012, at 11:46 AM, Luke Scott wrote: > >> On Apr 7, 2012, at 7:00 AM, Tom Boutell wrote: >> >>> That's a good point too. >>> >>> I think this is a better proposal: >>> >>> include_code, require_code, and require_code_once would work just like >>> include, require and require_once, except that the parser would start >>> out in PHP mode. >>> >>> .phpc is then just a convention for naming PHP files that start out >>> with code - a convention that autoloaders should respect, just as they >>> now respect the .php convention. "The user asked for the Monkey class, >>> and I see Monkey.phpc is out there; I'll grab that with >>> require_code_once." >>> >>> Putting this decision on the autoloader makes more sense because >>> autoloaders already contain assumptions about file extensions. They >>> have to in order to do their job of translating a class name to a >>> particular path somewhere. >>> >>> Folks who did not care for this functionality could then choose to >>> entirely ignore it. Class library developers who liked it would make >>> autoloaders available that honored it, freeing end-user developers >>> from thinking about it. It becomes self-contained, and people who are >>> writing old-school .php standalone scripts or pages are entirely >>> unaffected. >> >> Tony I think your idea has some merit. If it were up to me I'd remove >> > >> But I feel that adding new keywords is not the way to do it. >> Personally I'd like to see a php.ini setting to disallow the ending ?> >> tag and assume .php files just have PHP code. The starting > would be optional. White space would be ignored and non-white space >> characters before > >> Doing it this way would disallow bad practices but still make existing >> PHP scripts compatible. >> >> I think that doing that would be quite reasonable. Those who complain >> about it likely ignore industry best practices anyway. This option >> could be turned off by default at first, made default later, and then >> ?> be deprecated all together. >> >> So with this option enabled ?> is forbidden, > the text before > text before throws an error (unless it's a shebang line in cli mode). >> >> Hopefully that made sense. Does this sound good to you? >> >> I'm sorry you had to endure such a nasty troll. I am so sick of self >> righteous bullies who think they know it all. >> >> Luke >> >>> >>> On Sat, Apr 7, 2012 at 9:50 AM, John Bafford wrote: >>>> >>>> On Apr 7, 2012, at 09:39, Tom Boutell wrote: >>>> >>>>>> From the viewpoint of someone writing reusable classes, the need to >>>>> start with >>>> above it is a silly annoyance they don't experience with other tools. >>>>> >>>>> That said, you are making valid points, I'm not convinced myself that >>>>> "file extensions" necessarily should or could be determined in every >>>>> context. But it seems the most viable way of addressing the issue - i= f >>>>> a viable way even exists. Partly I want to convince myself that this >>>>> either can or can't ever be improved, and move on either way (: >>>> >>>> That "silly annoyance" doesn't seem to bother anyone who writes comman= d line tools, which require the #! line specifying the command interpreter = to be the first bytes in the file, with no leading white space whatsoever. = Especially on unix systems (but also on the Mac), the file extension does n= ot affirmatively indicate the file type or whether or not it can be execute= d. >>>> >>>> Also, from a CLI perspective, you don't want extensions in the names o= f your scripts, because then it causes problems/confusion/extra work if you= later decide to change the language the script is written in. >>>> >>>> -John >>>> >>>> -- >>>> John Bafford >>>> http://bafford.com/ >>>> >>>> >>>> -- >>>> PHP Internals - PHP Runtime Development Mailing List >>>> To unsubscribe, visit: http://www.php.net/unsub.php >>>> >>> >>> >>> >>> -- >>> Tom Boutell >>> P'unk Avenue >>> 215 755 1330 >>> punkave.com >>> window.punkave.com >>> >>> -- >>> PHP Internals - PHP Runtime Development Mailing List >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >