function quesiton
Posted: Thu Jul 17, 2003 12:44 am
hi all,
does parsing an array to a function actually copy everything in the array to another array? Is there anyway round this? i.e. just send the location of the array (array pointers?)
I was wondering if I globilize the array and use the global array inside the function would this still copy the array values?
e.g.
global $arr;
$arr = ("asdf", "asdg","bsdf");
function test() {
global $arr;
do something;
}
test();
instead of
function test($arr) {
do something;
}
$arr = ("asdf", "asdg","bsdf");
test($arr);
what's the difference?
does parsing an array to a function actually copy everything in the array to another array? Is there anyway round this? i.e. just send the location of the array (array pointers?)
I was wondering if I globilize the array and use the global array inside the function would this still copy the array values?
e.g.
global $arr;
$arr = ("asdf", "asdg","bsdf");
function test() {
global $arr;
do something;
}
test();
instead of
function test($arr) {
do something;
}
$arr = ("asdf", "asdg","bsdf");
test($arr);
what's the difference?