I\'m reading JSON data with PHP and that data contains empty objects (like {}). So the problem is, I have to handle the case when object is empty in different m
{}
You could cast it to an array (unfortunately you can't do this within a call to empty():
empty()
$x = (array)$obj; if (empty($x)) ...
Or cast to an array and count():
count()
if (count((array)$obj)) ...