16 апреля 2012 г. 11:24 пользователь Ferenc Kovacs <tyr...@gmail.com>написал:

>
>
> On Mon, Apr 16, 2012 at 9:46 AM, Arvids Godjuks 
> <arvids.godj...@gmail.com>wrote:
>
>> What happened with the proposal/RFC for expanding include/require with
>> additional optional second param to allow for developers to define in
>> place
>> if he want's a pure PHP file to be included or a template file with direct
>> HTML output?
>> I like that proposal and take it over any other, because it gives
>> developer
>> a choice.
>
>
> there is a valid issue which was discussed on irc yesterday:
> because include/require is a language construct, not a method,  one is
> allowed, even advised to write the include/require calls without putting
> out the parentheses.
> if we introduce additional arguments for include/require, the following
> code will break:
> echo include 'foo.bar', 'baz';
> as currently it was interpreted as
> echo include('foo.bar'), 'baz';
> ofc. we could make that the additional params to include, require would
> only used, if the parentheses are uses, but that would make require/include
> inconsistent with every other language construct, where the parentheses is
> optional.
> so we either accept this BC, or not pursue this option, but go with the
> new functions/opcodes like include_code/require_code or similar.
>
> --
> Ferenc Kovács
> @Tyr43l - http://tyrael.hu
>

That's sad really, to be honest.
I wonder if people even use this:

> echo include 'foo.bar', 'baz';
> as currently it was interpreted as
> echo include('foo.bar'), 'baz';

I even didn't know it worked that way and if I saw code like this before
today I would consider it an error (I would discover that it actually
works, but I definitively would rewrite that part in two lines as distinct
operators them with ; instead of , between them)

Maybe it's not that big deal and a BC break would not impact things a lot.
What do you think?

Reply via email to