# func_get_args BC break

- Thread: https://externals.io/message/70519
- Original archive: https://news-web.php.net/php.internals/70519
- Started by Nikita Popov on 2013-12-07T12:15:51+00:00
- Messages: 6
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #70519 — Nikita Popov — 2013-12-07T12:15:51+00:00

URL: https://externals.io/message/70519#70519

Hi internals!

The performance optimizations to func_get_args that were introduced in PHP
5.5.6 break BC for call_user_func_array on functions with by-ref args, see
https://bugs.php.net/bug.php?id=66107.

While using that kind of code is wrong in the first place, this seems like
a nasty break for a bugfix release. Maybe revert this for 5.5 and only keep
in 5.6?

Nikita

---

## #70542 — Dmitry Stogov — 2013-12-09T06:45:59+00:00

URL: https://externals.io/message/70519#70542

Hi,

I agree that the change makes BC break for some tricky code :(
and i don't insist to keep it in 5.5.

Thanks. Dmitry.




On Mon, Dec 9, 2013 at 4:26 AM, Stas Malyshev <smalyshev@sugarcrm.com>wrote:

> Hi!
>
> Can we do anything to fix it? Is the problem limited only to
> pass-object-by-ref or also for other by-ref scenarios? In the latter
> case it does constitute a BC break I think and it may be a good idea to
> move it to 5.6...
>
>
> -------- Original Message --------
> Subject: [PHP-DEV] func_get_args BC break
> Date: Sat, 7 Dec 2013 06:15:51 -0600
> From: Nikita Popov <nikita.ppv@gmail.com>
> To: PHP internals <internals@lists.php.net>
>
> Hi internals!
>
> The performance optimizations to func_get_args that were introduced in PHP
> 5.5.6 break BC for call_user_func_array on functions with by-ref args, see
> https://bugs.php.net/bug.php?id=66107.
>
> While using that kind of code is wrong in the first place, this seems like
> a nasty break for a bugfix release. Maybe revert this for 5.5 and only keep
> in 5.6?
>
> Nikita

---

## #70545 — Ferenc Kovacs — 2013-12-09T08:31:45+00:00

URL: https://externals.io/message/70519#70545 · In reply to: #70542

> Hi,
>
> I agree that the change makes BC break for some tricky code :(
> and i don't insist to keep it in 5.5.
>
> Thanks. Dmitry.
>
>
>
>
> On Mon, Dec 9, 2013 at 4:26 AM, Stas Malyshev <smalyshev@sugarcrm.com
> > […]
>
> > […]
>

Hi,

as we agreed that this is a BC break, I don't think that it is a good idea
even for 5.6.
could we also create a test for this behavior, so we don't change this
unintentionally later on?


-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

---

## #70546 — Dmitry Stogov — 2013-12-09T09:27:51+00:00

URL: https://externals.io/message/70519#70546 · In reply to: #70545

I'm completely disagree.
That PHP code (in bug report) worked not by design.
Actually, it's wrong code that worked just because of luck (zval refcount
became 1).
I don't see any reason to keep such compatibility for 5.6 in cost of
performance.

Thanks. Dmitry.





>
>
>
> 
>
> > […]
>
> Hi,
>
> as we agreed that this is a BC break, I don't think that it is a good idea
> even for 5.6.
> could we also create a test for this behavior, so we don't change this
> unintentionally later on?
>
>
> --
> Ferenc Kovács
> @Tyr43l - http://tyrael.hu

---

## #70547 — Pierre Joye — 2013-12-09T11:10:00+00:00

URL: https://externals.io/message/70519#70547 · In reply to: #70542

>
> Hi,
>
> I agree that the change makes BC break for some tricky code :(
> and i don't insist to keep it in 5.5.

An old enough bug may become a feature.

I am not sure it should be kept for 5.6 either. As of the last "dramatic"
performance loss (about some string funcs), what are you referencing to
here?

Cheers,
Pierre

---

## #70548 — Dmitry Stogov — 2013-12-09T12:28:05+00:00

URL: https://externals.io/message/70519#70548 · In reply to: #70547

Hi Pierre,

It was a performance improvement that caused that BC break.
For some reason `func_get_arg()` made a copy of each argument.
In case some argument is a big array it made a significant useless work
creating and filling new HashTable.

Thanks. Dmitry.




>
> 
> > […]
>
> An old enough bug may become a feature.
>
> I am not sure it should be kept for 5.6 either. As of the last "dramatic"
> performance loss (about some string funcs), what are you referencing to
> here?
>
> Cheers,
> Pierre
