I am recieveing the following parse error:
Parse error: syntax error, unexpected '(', expecting ',' or ';' in
H:ProgramsUSBWebserver
v8.58.5
ootoopforumfunc
egister.class.php on line 7
which relates to the following line of code in my class:
private $random_name = rand(1000,9999).rand(1000,9999).rand(1000,9999).rand(1000,9999);
I can not see why this line of code would cause a parse error?
Here is some surrounding code:
class register{
public $post_data = array();
private $dbh;
private $allowed_type = array('image/jpeg','image/png','image/gif');
private $random_name = rand(1000,9999).rand(1000,9999).rand(1000,9999).rand(1000,9999);
private $path = 'img/thumb_/'.$random_name. $_FILES['file']['name'];
private $max_width = 4040;
private $max_height = 4040;
private $max_size = 5242880;
private $temp_dir = $_FILES['file']['tmp_name'];
private $image_type = $_FILES['file']['type'];
private $image_size = $_FILES['file']['size'];
private $image_name = $_FILES['file']['name'];
private $image_dimensions = getimagesize($temp_dir);
private $image_width = $image_dimensions[0]; // Image width
private $image_height = $image_dimensions[1]; // Image height
private $error = array();
public function __construct($post_data, PDO $dbh){
$this->post_data = array_map('trim', $post_data);
$this->dbh = $dbh;
}
}
What is causing the parse error?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…