Bring back call-time pass-by-reference

php.internals

Karoly Negyesi

18 years ago
Hi, Although this should be an old hat, I am surprised PHP5 has not fixed it, let's fix it in PHP6. There are things you can't without call time pass-by-reference, most of all variables arguments with references. So, please de-deprecate it. Thanks much, Karoly Negyesi

Brian Moon

18 years ago
Karoly Negyesi wrote:
> Hi, > > Although this should be an old hat, I am surprised PHP5 has not fixed > it, let's fix it in PHP6. There are things you can't without call time > pass-by-reference, most of all variables arguments with references. > So, please de-deprecate it.
I am feeling froggy. I will bite. What can't you do? I can think of several really bad things that can happen. It can't be OOP cause objects are already always passed by reference.
-- Brian Moon Senior Developer ------------------------------ http://dealnews.com/ It's good to be cheap =)

Karoly Negyesi

18 years ago
Dear Brian, Say, you have a CMS which generally calls some kind of functions and some of them might need to modify one array the other needs to modify two arrays... Currently you need to wrap these into a "arguments" array otherwise func_get_args will butcher your references. Regards, NK

Stanislav Malyshev

18 years ago
> Say, you have a CMS which generally calls some kind of functions and > some of them might need to modify one array the other needs to modify > two arrays... Currently you need to wrap these into a "arguments" > array otherwise func_get_args will butcher your references.
Can you give a short code example of what you want to do?
-- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

Karoly Negyesi

18 years ago
http://blog.phpdoc.info/archives/3-PHP-Fun-Variable-Arguments-Be-Reference.html just an example from 2.5yrs ago.

Karoly Negyesi

18 years ago
I try to be constructive here -- I might end up as a moron, I do not know, sorry -- but what about adding a parameter to func_get_arg to get the argument by reference?

Hodicska Gergely

18 years ago
> Say, you have a CMS which generally calls some kind of functions and > some of them might need to modify one array the other needs to modify > two arrays... Currently you need to wrap these into a "arguments" > array otherwise func_get_args will butcher your references.
In PHP6 allow_call_time_pass_reference settings will be removed. Best Regards, Felhő

Hodicska Gergely

18 years ago
Hi!
> some of them might need to modify one array the other needs to modify > two arrays...
But every function knows the number of its own arguments, isn't it?
> array otherwise func_get_args will butcher your references.
This behavior has nothing to do with the call-time-pass-reference settings, func_get_args works this way. Best Regards, Felhő

Brian Moon

18 years ago
Karoly Negyesi wrote:
> Dear Brian, > > Say, you have a CMS which generally calls some kind of functions and > some of them might need to modify one array the other needs to modify > two arrays... Currently you need to wrap these into a "arguments" > array otherwise func_get_args will butcher your references. > > Regards, > > NK
So, you need to relabel this, "func_get_args() should allow arguments to be passed by reference". This has nothing to do with call time pass by reference IMO.
-- Brian Moon Senior Developer ------------------------------ http://dealnews.com/ It's good to be cheap =)

Cristian Rodriguez

18 years ago
2007/11/17, Karoly Negyesi <karoly@negyesi.net>:
> There are things you can't without call time > pass-by-reference,
huh ? are you seriuos ? care to show some proof of your statements ?
-- http://www.kissofjudas.net/