Re: How to check if an object is empty in PHP5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux