public static function object(\Closure $callback) {
		$obj = new Object;
		$callback->__invoke($obj);
		return json_encode($obj);
	}
public static function object(\Closure $callback) {
		$obj = new Object;
		$callback->__invoke($obj);
		return json_encode($obj);
	}
public static function object ( \ Closure $ callback ) { $ obj = new Object ; $ callback -> __invoke ( $ obj ) ; return json_encode ( $ obj ) ; }
Builds a JSON object by invoking a callback function.

echo JSONBuilder::object(function($json) {
$json->hello = "world!";
});
// {"hello":"world!"}

@param \Closure $callback
@return string
Builds a JSON object by invoking a callback function .