Re: How to check if an object is empty in PHP5
| From: | Jochem Maas | Date: | Mon, 02 Jan 2006 11:16:39 +0000 |
| Subject: | Re: How to check if an object is empty in PHP5 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-228080@lists.php.net to get a copy of this message | ||
Mathijs wrote:
Hello ppl, How can i check if an Object is empty in PHP5? Becouse empty() doesn't work. Quote: "As of PHP 5, objects with no properties are no longer considered empty.".try: class Test {} $obj = new Test; $arr = (array) $obj; var_dump( empty($obj), empty($arr) );
Thx in advanced.