Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59429 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48335 invoked from network); 7 Apr 2012 17:12:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Apr 2012 17:12:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=kalle.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kalle.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.42 as permitted sender) X-PHP-List-Original-Sender: kalle.php@gmail.com X-Host-Fingerprint: 209.85.212.42 mail-vb0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:60397] helo=mail-vb0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/EB-23111-F55708F4 for ; Sat, 07 Apr 2012 13:12:00 -0400 Received: by vbjk13 with SMTP id k13so1951585vbj.29 for ; Sat, 07 Apr 2012 10:11:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=by3Sb7EJvzA0ZT96kKkJHk0/YPDxBGwskPdYxA/qwPE=; b=OZphX6AaK/Jk9lrAjnsXPNRfT4Cz1OwQvcy/TblVIpfTp2jjtg3GbP6Q+1RZDECtZu qmjBdOad1AUjfZVD6s9uScgKF/D+jIWt93Cb9J95kfncUIfZl7/ot/hSudxK8xyM5VEf mWvNfHOpcRYFmLoMWLd/oWi6qo/jTBuRt1+0F9iYhl+aFXNzIhFjnY06/Pc+IViXOCFz Ss+UdpGQ25tTIfvcXkMfFFxAgarmAMPDq0rv8gRe+yfKaO2BqLZqvw6ywLwSB4eQhA/h K631WIFWW/benIYLV/KhDQJYqzLKmheq565Yq2jb308QWsm1kpySTc31BN6jWP0KSMZ9 V+ZQ== MIME-Version: 1.0 Received: by 10.52.98.8 with SMTP id ee8mr746800vdb.49.1333818717525; Sat, 07 Apr 2012 10:11:57 -0700 (PDT) Sender: kalle.php@gmail.com Received: by 10.220.1.136 with HTTP; Sat, 7 Apr 2012 10:11:57 -0700 (PDT) In-Reply-To: References: Date: Sat, 7 Apr 2012 19:11:57 +0200 X-Google-Sender-Auth: ozk5UpDDQOQETIG84QZzPed8I7Q Message-ID: To: Tom Boutell Cc: PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] PHP class files without : > Now that the flamewar has died down a little I'd like to try to have a > civil discussion about this idea - *without* my admittedly > inflammatory suggestion to kill > So here is what I am seriously suggesting: > > * The default behavior doesn't change. The parser starts out in HTML mode. > > * If the CLI sees a .phpc file extension, the parser starts out in PHP > mode (no opening into HTML mode after that with ?>. > > * If a require/include statement sees a .phpc file extension, the > parser starts out in PHP mode. CLI, or any other SAPI for the matter, doesn't care about the file extension, as pointed out by several posts. This makes it impossible to correctly determine the input file for a require/include statement. The only option that would make sense is a new parser mode, which could be specified by a CLI parameter, or by an INI option (absolutely least favorable option, if any even wanna call it that). A CLI argument is simple and elegant, but does require those 3 extra keystrokes or so: C:\> php -S bug42.php While it does create another issue, which is that the mode is not available to other SAPI's, and I think adding a specialized option for each SAPI for such things will be bad, but might be a better way to do at webserver level than php.ini level, but personally I don't like a dynamic language that have a dynamically changed syntax, which makes it seem inconsistent. Hope this was some constructive feedback if you decide to write an RFC about it. -- regards, Kalle Sommer Nielsen kalle@php.net