Re: Re: Go for votes for the open tag-less PHP files
| From: | Nikita Popov | Date: | Mon, 16 Apr 2012 19:51:34 +0000 |
| Subject: | Re: Re: Go for votes for the open tag-less PHP files | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-60011@lists.php.net to get a copy of this message | ||
On Mon, Apr 16, 2012 at 9:39 PM, Rick WIdmer <vchkpw@developersdesk.com> wrote:
> On 4/16/2012 1:02 PM, Kris Craig wrote:
>>
>> On Mon, Apr 16, 2012 at 10:31 AM, Rick
>> WIdmer<vchkpw@developersdesk.com>wrote:
>>>
>>>
>>> More important include doesn't currently allow multiple parms:
>>>
>>> include "foo.bar", 'baz';
>>>
>>> Parse error: syntax error, unexpected ',' in bla.php on line xx
>> Regarding include/require, I agree that any BC break would be extremely
>> minimal. In the 10+ years I've been developing PHP, I don't think I've
>> ever once seen somebody include multiple scripts on a single line (I
>> wasn't even aware that such a thing was allowed).
> See above. It is not allowed now.
I think there is a misunderstanding here. Inclusions with two
arguments are currently not allowed, yes. The point is that adding
such a second argument would make the grammar ambiguous.
E.g, consider this:
func(include 'foo', $someThing);
Currently this is interpreted as the return value of 'foo' and the
variable $someThing being passed to func.
If you add a second argument it's unclear what this does. Is this a
two-argument include? I.e. should it be interpreted as
func((include 'foo', $someThing));
Or is this a one-argument include and should be interpreted as
func((include 'foo'), $someThing);
In my eyes such an ambiguity renders any proposal to add another
argument to include completely unacceptable.
The only option is to add a dedicated syntax for it like
include 'foo' as $flags;
Nikita