Any idea why I'm getting this strange error? "Fatal error: Call to undefined function empty()"
function newpart($name,$country,$bday_day,$bday_month,$bday_year,$gender,$pass1,$pass2,$email,$option1,$secondOption1,$secondOptionLevel1){
$this->name = $name;
$this->country = $country;
$this->bday_day = $bday_day;
$this->bday_month = $bday_month;
$this->bday_year = $bday_year;
$this->gender = $gender;
$this->pass1 = $pass1;
$this->pass2 = $pass2;
$this->email = $email;
$this->option1 = $option1;
$this->secondOption1 = $secondOption1;
$this->secondOptionLevel1 = $secondOptionLevel1;
if( empty($this->name) || empty($this->pass1) ){
$this->errorCount++;
}
}
If the variable isn't set you can get this error. Always when you are using the empty()
, also use the isset()
. I guess it will solve it for you.
The only thing I can think is you are using a version of php older than php 3. Though I cannot imagine you are on a server running on php3. Empty() came around in php 3.
I had the same fatal error...
before the word "empty" I did press alt + space instead of space in my editor. There was a fake white space.