Keeguon/nicejson-php — pull request #1 by GerHobbelt (2013-05-23 11:44:12+00:00)
Title: some fixes to the formatter and it now also can process raw input into json

see the commit chain; when you feed it raw data (object tree or array...) as input PHP 5.4 default json pretty printing can be used when available; otherwise you get the same result using the custom code, which has been fixed to always use the same amount of whitespace irrespective of the exact amount available in the input (string or raw).