semsol/arc2 — pull request #53 by pietercolpaert (2013-05-17 08:43:22+00:00)
Title: My previous pull request broke support for PHP <5.4 - Fixed

# Problem

Apparently this constant is unknown on some servers:

https://github.com/tdt/formatters/blob/development/src/tdt/formatters/strategies/JSON.php#L28

[error] [...] PHP Notice: Use of undefined constant JSON_UNESCAPED_SLASHES - assumed 'JSON_UNESCAPED_SLASHES' in tdt/formatters/src/tdt/formatters/strategies/JSON.php on line 28

~# php --version
PHP 5.3.3-7+squeeze14 with Suhosin-Patch (cli) (built: Aug 6 2012 20:08:59)

And the docs:

http://php.net/manual/en/function.json-encode.php

Were added in 5.4.0:
JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, and JSON_UNESCAPED_UNICODE options were added.

# Solution

Instead of using the constant, use a str_replace.