To create an empty JSON object I do usually use:
json_encode((object) null);
casting null to an object works, but is there any other prefer
To create an empty object in JSON with PHP I used
$json=json_decode('{}'); $json->status=202; $json->message='Accepted'; print_r($json);
which produced
stdClass Object ( [status] => 202 [message] => Accepted )
which is necessary, because later I have to do this
if(is_object($json))