empty() and method return values

From: Date: Mon, 07 Jun 2010 19:40:43 +0000
Subject: empty() and method return values
Groups: php.general 
Request: Send a blank email to php-general+get-305913@lists.php.net to get a copy of this message
Hi, empty() cannot check the return value of the method or function. which would be the best workaround? empty($class->method()) // gets an error i could do $method_return_value = $class->method() and then run empty() on $method_return_value or is there an better option? i would like to do it in if statement.... i wrote an class for handling file uploads and there is an method getErrors() which returns empty array in case of 0 errors and i need to check it before i move any files. i'm just curious, what is the right way to do that! Br Tanel

« previous php.general (#305913) next »