4

知道为什么我会收到这个奇怪的错误吗?“致命错误:调用未定义的函数 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++;
        }



    }
4

3 回答 3

9

我有同样的致命错误......

在“空”这个词之前,我确实按alt+space而不是space在我的编辑器中。有一个假的空白区域。

于 2015-09-10T21:49:42.917 回答
0

我唯一能想到的是您使用的 php 版本早于 php 3。虽然我无法想象您在运行 php3 的服务器上。Empty() 在 php 3 中出现。

于 2012-09-14T22:28:38.223 回答
-3

如果未设置变量,您可能会收到此错误。始终在使用 时empty(),也使用isset()。我想它会为你解决的。

于 2012-09-14T22:27:46.707 回答