#29018 [Com]: function arguments 'null' and staticval with n passing by reference
| From: | josh at vodafone dot de | Date: | Tue, 03 Aug 2004 13:21:44 +0000 |
| Subject: | #29018 [Com]: function arguments 'null' and staticval with n passing by reference | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969362531@lists.php.net to get a copy of this message | ||
ID: 29018
Comment by: josh at vodafone dot de
Reported By: none at space dot com
Status: Open
Bug Type: Documentation problem
Operating System: any
PHP Version: 4.3.6
Assigned To: vrana
New Comment:
Ok. No pun intended.
It's just so odd that we're stuck in a situation where a good solution
has changed to something agreeably
- not really elegant
and
- the reason for the change cannot be explained by the php team
itself.
I guess no further comment is needed.
Previous Comments:
------------------------------------------------------------------------
[2004-08-03 09:50:55] vrana@php.net
Along workarounds I mentioned also one solution. I'll document that.
foo(NULL) is maybe the most elegant solution in your eyes however this
manner is deprecated :-(.
I'm not sure why it's deprecated (probably for performance reasons) so
I can't explain why it's deprecated.
------------------------------------------------------------------------
[2004-08-02 15:44:38] josh at vodafone dot de
Workarounds? How elegant! :P
You got to be kidding, right? We were talking improvements!
The workarounds are known by know. Is there nothing more elegant like
foo(NULL);
------------------------------------------------------------------------
[2004-07-28 21:58:48] vrana@php.net
Possible solution:
function foo (& $var){
if (is_null($var)){return 0};
return(1);
}
$somevar = null;
foo($somevar);
Possible workarounds:
allow_call_time_pass_reference can be set on per directory basis.
@ can be added before function call (with side-effect of not displaying
any errors of course)
There's no other solution AFAIK.
------------------------------------------------------------------------
[2004-07-19 14:24:07] jsabre at jjsbr dot tv
I was wondering about this too... how can you deprecate this and not
tell the community what is going on? I found only very little info
about this issue out there. But meny people seem to truggle with it.
------------------------------------------------------------------------
[2004-07-07 11:57:57] jform at helmsdeep dot org
above: sorry, typo:
function foo ($obj){
should obviously be
function myfunc ($obj){
i was copying...
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/29018
--
Edit this bug report at http://bugs.php.net/?id=29018&edit=1