When writing a function that takes in a variable number of parameters and
processing it using func_get_args or a similar technique, I'm assuming that
one is only able to use the pass by value method of parameter passing. Can
someone confirm or deny this for me?
Below is a trivial example of what I'm talking about. I'm assuming the
function below does nothing useful.
<?php
function squares( )
{
$params=functio n_get_args();
$numparams= func_num_args() ;
for ($i=0;$i<$numpa rams;$i++)
$params[$i]*=$params[$i];
}
?>
processing it using func_get_args or a similar technique, I'm assuming that
one is only able to use the pass by value method of parameter passing. Can
someone confirm or deny this for me?
Below is a trivial example of what I'm talking about. I'm assuming the
function below does nothing useful.
<?php
function squares( )
{
$params=functio n_get_args();
$numparams= func_num_args() ;
for ($i=0;$i<$numpa rams;$i++)
$params[$i]*=$params[$i];
}
?>
Comment