I looked into it again (and found things I didn't know before). This one's
bugging me enough that I braved the Wiki:
http://wiki.php.net/rfc/calltimebyref
- Steph
Hello Steph,
Is it me, or the wiki post talks about param and return by ref?
Return by ref is not related to call-time pass by ref, is it?
Anyway, my opinion is clear on that one: shoot that dead cow. It's
been deprecated for years, and you should declare your function
prototypes with the param by ref anyway if you need it.
Regards,
Olivier
I looked into it again (and found things I didn't know before). This one's
bugging me enough that I braved the Wiki:
Is it me, or the wiki post talks about param and return by ref?
Return by ref is not related to call-time pass by ref, is it?
See zend_compile.c.
Anyway, my opinion is clear on that one: shoot that dead cow. It's
been deprecated for years, and you should declare your function
prototypes with the param by ref anyway if you need it.
Did you bother to read the proposal or did you just hit send? What exactly
do you think the RFC is about?
- Steph
For anyone else who doesn't read to the end...
Anyway, my opinion is clear on that one: shoot that dead cow. It's
been deprecated for years, and you should declare your function
prototypes with the param by ref anyway if you need it.
All I'm asking is that we throw a warning by default in 5_3, because in PHP
6 there isn't even an option to switch that warning off. To be frank this
shouldn't ever have needed to go to an RFC; the lack of warning is an
obvious bug in PHP which should simply be fixed.
- Steph
Steph Fox wrote:
I looked into it again (and found things I didn't know before). This
one's bugging me enough that I braved the Wiki:
It has:
| Proposal
|
| Switch allow_call_time_pass_reference off by default in PHP_5_3
| branch. At present there is no warning when running PHP under default
| settings, whereas in PHP 6 there will be a 'deprecated' warning given
| and no means of turning it off.
We will be switching it on for our extension requirements. It would be
nice if it can be turned on in the [extension] section and the PHP
parser would enabled it per the extension's API call only and not others.
--
Hector Santos
I looked into it again (and found things I didn't know before). This one's
bugging me enough that I braved the Wiki:
I'm all for it.
regards,
Derick
I looked into it again (and found things I didn't know before). This one's
bugging me enough that I braved the Wiki:
I don't think we should get rid of it, or add a notice/message/whatever.
Because this:
could not be done without call time pass by ref right now. So unless
that's fixed, we shouldn't deprecate it.
regards,
Derick
--
Derick Rethans
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org
Hi Derick,
I don't think we should get rid of it, or add a notice/message/whatever.
Because this:could not be done without call time pass by ref right now. So unless
that's fixed, we shouldn't deprecate it.
Hm. Actually those 'expected values' are wrong because 12 is itself an array
and so isn't seen as an array element. But I take your point.
On the other hand, call_time_pass_reference already is deprecated and has
been for the last 8 years, so maybe fixing PHP to allow it where it makes
sense might be a good way to go?
Johannes mentioned call_user_func()
on irc too:
<?php
function increment(&$var) {
$var++;
}
$a = 0;
call_user_func('increment', $a);
echo $a;
Warning: Parameter 1 to increment() expected to be a reference, value given
in...
0
$b = 0;
call_user_func('increment', &$b);
echo $b;
Deprecated: Call-time pass-by-reference has been deprecated; If you would
like to pass it by reference, modify the declaration of call_user_func()
.
If you would like to enable call-time pass-by-reference, you can set
allow_call_time_pass_reference to true in your INI file in...
1
The manual advises that you use call_user_func_array()
instead - which
doesn't throw a warning - and virtually all the user notes recommend
variable functions as both faster and safer than call_user_func()
. So why
isn't that deprecated if call_time_pass_reference is?
- Steph
Derick Rethans wrote:
I looked into it again (and found things I didn't know before). This one's
bugging me enough that I braved the Wiki:I don't think we should get rid of it, or add a notice/message/whatever.
Because this:http://pastebin.com/d6e055957
This pastebin expired, but is the same as:
and: http://bugs.php.net/bug.php?id=45126
could not be done without call time pass by ref right now. So unless
that's fixed, we shouldn't deprecate it.regards,
Derick
- Mark
Hello Steph,
I am all for it: Making sure PHP's 5.3 default is OFF and issueing a warning when turning on starting with 5.3.
marcus
Wednesday, May 21, 2008, 3:13:04 PM, you wrote:
I looked into it again (and found things I didn't know before). This one's
bugging me enough that I braved the Wiki:
- Steph
Best regards,
Marcus