Posted by Jochem Maas on 01/02/06 13:16
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.
>
Navigation:
[Reply to this message]
|