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
you can also use
$var = ["key" => (object) array()]; json_encode($var);