Home  >  Q&A  >  body text

Can't use constants with empty()?

parent::_initialize();//The initialization operation in the inherited parent class is different from what the teacher said

In addition, if(empty(USER_ID)) reports an error, if(USER_ID!=null )Can.

刘磊刘磊2159 days ago1348

reply all(2)I'll reply

  • BestModer

    BestModer2018-11-03 11:48:01

    bool empty ( mixed $var )

    Determines whether a variable is considered empty. When a variable does not exist, or its value is equal to FALSE, then it is considered not to exist. empty() does not generate a warning if the variable does not exist.

    It means that empty is used to detect variables; Attached link

    reply
    0
  • 鸿运达

    鸿运达2018-11-01 16:22:51

    empty() detects variables, right

    reply
    0
  • Cancelreply