Not returning properly
Posted: Thu Jun 02, 2005 7:28 pm
Hi guys, I have this seemingly silly problem. I'm not sure whether it's to do with php5 or not, as I've done this type of thing numerous times before without any problems, what stupid thing am I missing?
I'm calling this class on a seperate page as follows:
The problem being the results of var_dump are
This is not correct as doing a var_dump within the function files() confirms everything is as it should be, just not after it is returned. Any ideas what i'm doing wrong? Also as I've just upgraded to php5 should I be able to use the _construct() instead of the function files() in my class ? thanks.
Code: Select all
class files {
/**
* @return array
* @param mixed $file
* @desc class constructer, places contents of file in array
**/
function files($file) {
return file($file);
}
}Code: Select all
require_once('common/files.class.php');
$f = new files($_FILES['file']['tmp_name']);
var_dump($f);Code: Select all
object(files)#1 (0) { }