Re: RFC: source files without opening tag

From: Date: Mon, 09 Apr 2012 19:21:46 +0000
Subject: Re: RFC: source files without opening tag
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
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:

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



Thread (109 messages)

« previous php.internals (#59531) next »