Adapt Json\Json for better prettyPrint support

I adapted the Json::prettyPrint to generate the same output as json_encode

also I added a "prettyPrint" option to Json::encode to take advantage of the json_encode pretty print and align the functionality to json_encode

This is my first pull request ever, so please be kind :-)
And now this can't be cached/optimezed into bytecode.
Use PHP_VERSION_ID instead.

See https://github.com/symfony/symfony/pull/12497


Or leave version and simply check if constant is defined.