Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59550 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85758 invoked from network); 9 Apr 2012 20:41:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Apr 2012 20:41:46 -0000 Authentication-Results: pb1.pair.com header.from=chrisstocktonaz@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=chrisstocktonaz@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.170 as permitted sender) X-PHP-List-Original-Sender: chrisstocktonaz@gmail.com X-Host-Fingerprint: 209.85.160.170 mail-gy0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:41421] helo=mail-gy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EC/4B-34074-889438F4 for ; Mon, 09 Apr 2012 16:41:46 -0400 Received: by ghbg2 with SMTP id g2so2365802ghb.29 for ; Mon, 09 Apr 2012 13:41:40 -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:content-transfer-encoding; bh=V2yLUZkhD/6pLZrd23DDxQpl2U5qhejvfJkBXBveRZ0=; b=X0XAONsv1QV6FW4W4+otxe7sb8dXOpjdC2jLWtOlJwVSYGqK2DQ182cFRTzInVlpF5 Ns1hOnRbn8LBXtpuopV/4G9Dstz3PRj49KgRAfFwHDF27+2Ip5w5smjVhAnRG/P5OX8x 4qo+8nTY/jct47h+4qXnmXXALzP77TqkxXz4GijEXW44JdaRP0BPJAQA3abwzKfwAus2 AeIezIN2y7zB2q37tFyo1Gwy22gcdDZHI9LDizLkh2nHaSYLQnmZz+Ppip0B8wHrRmwX zYmMzw2VS4fKbydlNS5s9RFlGe7bzCJILgG8acYyO62+eBI/g/yUIjK4aIx1O2HatCnj rX2g== MIME-Version: 1.0 Received: by 10.50.184.131 with SMTP id eu3mr322737igc.13.1334004100174; Mon, 09 Apr 2012 13:41:40 -0700 (PDT) Received: by 10.42.174.9 with HTTP; Mon, 9 Apr 2012 13:41:40 -0700 (PDT) In-Reply-To: <4F8336CA.6030800@gmail.com> References: <-5877502932356715576@unknownmsgid> <-3647345967307864634@unknownmsgid> <4F831FAE.2030208@ralphschindler.com> <4F8336CA.6030800@gmail.com> Date: Mon, 9 Apr 2012 13:41:40 -0700 Message-ID: To: =?ISO-8859-1?Q?=C1ngel_Gonz=E1lez?= Cc: PHP Developers Mailing List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] RFC: source files without opening tag From: chrisstocktonaz@gmail.com (Chris Stockton) Hello, 2012/4/9 =C1ngel Gonz=E1lez : > On 09/04/12 20:23, Chris Stockton wrote: >> Hello, >> Although I am not very interested in this feature, if it is >> implemented I like the idea of flags instead of introducing new >> keywords. Maintaining backwards compatibility would be great >> considering the benefit to the feature to be completely honest (and in >> disagreement to many people, but I do understand the reasoning for >> everyone's interest in it) is extremely minor in my eyes. >> >> In addition I would suggest maybe using PHP_INCLUDE_* as a place for >> these constants to live. >> >> -Chris > That would still be a parse error. > Either > include "file.php", 5; > or > include ("file.php", 42); > > Fails with a parse error about unexpected ',' > > On the other hand, a new keyword can be written in a backwards > compatible way by making it look like a function call in a non-taken bran= ch: > > *if ( version_compare(PHP_VERSION*, '5.5', '<') ) > =A0include_once $file; > else > =A0require_code($file, array( 'once'=3D>true, 'warn' =3D> 'ignore' ) ); > I am not sure I am following you here Angel, are you confusing backwards and forward compatibility? I wouldn't expect a feature to ever work forward compatibly. I.E. Can't use traits in php 4 and can't play a blu ray disc in a dvd player. The goal here is that if you have a large code base which has a hand rolled include_code function already, your change is backwards compatible with that code base. Same to be said for any constants, which is why I recommended using the reserved PHP_* space. -Chris