2009/8/21 Hannes Magnusson <hannes.magnus...@gmail.com>:
> On Fri, Aug 21, 2009 at 13:06, Richard Quadling<rquadl...@googlemail.com> 
> wrote:
>> 2009/8/21 Greg Beaver <g...@chiaraquartet.net>:
>>> Lars Torben Wilson wrote:
>>>> 2009/8/20 Hannes Magnusson <hannes.magnus...@gmail.com>:
>>>>
>>>>> In 2 years (when everyone knows about the warning) people will be
>>>>> wondering why the example shows a complicated way to throw an error..
>>>>>
>>>>> The example is nice to show what exactly no longer works, but the
>>>>> wording and example show a hint of disappointment that it doesn't work
>>>>> in 5.3..
>>>>>
>>>>> I don't know how to rephrase it though ;)
>>>>>
>>>>> Maybe add <refsect role="errors">, including a file calling
>>>>> func_get_args() will throw an E_WARNING, even when included from
>>>>> functions.. ?
>>>>>
>>>>>
>>>>> -Hannes
>>>>>
>>>>
>>>> Hi Hannes, Greg, and others,
>>>>
>>>> I've been thinking about this some more and honestly, so far the
>>>> wording I first posted still is the least ambiguous and most concise.
>
> Then go for it.
> If someone finds something better down the road then she will fix :)

OK. That tends to be my take on version-controlled sources too.

>>> I personally had no idea what it was talking about until I read the
>>> example, for what that's worth :).  I tend to find code far more
>
> Same here, as soon as I read the example I understood the issue

OK. Also, in that case, I'll keep thinking about the wording and hope
to come up with something clearer.

>> Regardless of how this is documented, isn't it a bug? The included
>> code _is_ in a function when it is executed, and therefore not in the
>> global scope.
>
> func_get/num_arg[s]() are not normal functions.

At first I considered it a bug as well but it has been flagged as
'wontfix' in http://bugs.php.net/bug.php?id=48569 since apparently the
old behaviour depended on "weird implementation of func_get_args()'.
There are arguments to be made both ways based on the current
documentation of include() and what, for instance, debug_backtrace()
returns. Perhaps more discussion is needed in php-internals on this
for a final resolution but as long as it's considered wontfix then it
should probably be documented in case someone else runs into it.

> -Hannes
>

Thanks for all the comments!

Torben

Reply via email to