2009/8/20 Hannes Magnusson <hannes.magnus...@gmail.com>:
> On Thu, Aug 20, 2009 at 08:13, Lars Torben Wilson<larstor...@gmail.com> wrote:
>> Hi all,
>>
>> Just asking because I've been out of the loop for a while (again) but
>> a coworker recently noticed this BC break in func_get_args() and
>> friends. While the changes to way func_get_args() do seem necessary
>> this should probably still be documented. I just wanted to make sure
>> I'm not breaking any current standards too badly with this. :)
>>
>> I've added similar notes and examples to func-get-arg.xml and
>> func-arg-num.xml but have left them out of this email for brevity.
>>
>> If I don't hear any objections I'll commit tomorrow. Or if I get an OK
>> tonight, I'll commit tonight. :)
>
>
> In 2 years (when everyone knows about the warning) people will be
> wondering why the example shows a complicated way to throw an error..

Hi Hannes,

I many ways I agree--but I'm not sure that in two years, everyone will
know about it. Honestly I can't say I am personally surprised by the
change; given the way PHP works I can see this being expected to
either A) work or B) not work. I've been using PHP since long before
func_get_args() was added and have never seen this construct used,
though--so I'm not sure how many examples of this kind of usage are
really out there in the wild.

Until someone else comes forward and says "WTF?" I'd be tempted to
treat this as an edge case.

> 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 ;)

Neither do I. :) I've been rewriting it for two days trying to satisfy
myself. So far this is the best I've come up with that is unambiguous
and still explains the difference. I agree that perhaps the example is
overdoing it; I just didn't want to include too little info since that
tends to lead to chaos in the user notes. :)

Perhaps surprisingly the change should be fairly easy to work around
for people who need it to work.

> Maybe add <refsect role="errors">, including a file calling
> func_get_args() will throw an E_WARNING, even when included from
> functions.. ?

I could see something like that. In fact at one point I had something
almost exactly like that but it didn't read all that well. I'll take
another pass at it after work today. It seemed that the changelog
section was appropriate though since it's version-related, but I also
thought about the errors list. I could go either way on that.

Mostly I think the change needs to be noted so when someone does run
into the change we can say it's documented, but I don't want to seem
disappointed at all in the change or drive it into the ground or
anything. I don't think it's exactly one of the bigger BC breaks
around but for a few folks it might be a surprise.

> -Hannes

Thanks for the notes!


Cheers,

Torben

Reply via email to