caller has no way knowing whether the function will modify the argument?

caller has no way knowing whether the function will modify the argument?

am 27.09.2007 04:13:56 von Summercoolness

Is it true that the caller has no way to know whether the function it
is calling uses

function foo($a)

or

function foo(&$a)

so the caller never knows whether it is "pass by value" or "pass by
reference" and so won't know whether the argument can be modified or
not?

Re: caller has no way knowing whether the function will modify the argument?

am 27.09.2007 09:35:10 von nc

On Sep 26, 7:13 pm, Summercool wrote:
>
> Is it true that the caller has no way to know whether the function it
> is calling uses
>
> function foo($a)
>
> or
>
> function foo(&$a)
>
> so the caller never knows whether it is "pass by value" or "pass by
> reference" and so won't know whether the argument can be modified or
> not?

That's what documentation is for...

Cheers,
NC