Can't use method return value in write context

后端 未结 8 1394
野趣味
野趣味 2020-11-22 01:52

I would think the following piece of code should work, but it doesn\'t (Edited: Now works in PHP 5.5+):

if (!empty($r->getError()))
         


        
8条回答
  •  执笔经年
    2020-11-22 02:34

    I usually create a global function called is_empty() just to get around this issue

    function is_empty($var)
    { 
     return empty($var);
    }
    

    Then anywhere I would normally have used empty() I just use is_empty()

提交回复
热议问题