I have a function prototype as such:
function do_upload( $file, $id, $type )
And I'm calling the function like this:
$this->do_upload( $files, $id, 'article' );
However, only $files is actually being passed through to the function. I'm sure it's simple but what have I done wrong?
EDIT:
So $file is just an array of file information, similar to $_FILES and it is passed through fine, I do some manipulation of it further in the function.
$id is set before I call the function, if I print_r() before the function call I see an ID I would expect and $type is just a string.
However, If I print_r() or die() on either $id or $type they are both blank and var_dump() returns the following:
die( var_dump( $id ) );
-> string(0) ""
die( var_dump( $type );
-> bool(false)
Right before the function call: die( var_dump( $id) );
-> string(3) "111"
Any ideas?
SOLUTION:
In case anyone has a similar problem, check the accepted answer below. Essentially I needed to pass the $files array by reference as it was using up the available stack space.
Thanks