Re: RFC: source files without opening tag

From: Date: Mon, 09 Apr 2012 20:06:12 +0000
Subject: Re: RFC: source files without opening tag
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Apr 9, 2012, at 12:16 PM, "Ángel González" <[email protected]> wrote:

> 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 branch:

The keyword "abstract" would cause a parse error for older versions of
PHP. Backwards compatibility is having existing code work with the
current versions.

To make new code compatible with older versions of PHP you simply
don't use the keyword/constant.

>
> *if ( version_compare(PHP_VERSION*, '5.5', '<') )
>  include_once $file;
> else
>  require_code($file, array( 'once'=>true, 'warn' =>
> 'ignore' ) );

I'm fairly certain that wouldn't work either. Require and friends are
constructs, not functions.

Luke

>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>


Thread (109 messages)

« previous php.internals (#59541) next »