Summary: HHVM's JSON parsing is lax in some respects: it allows trailing commas in arrays and objects; allows single quotes around strings; ignores trailing text in some cases; and allows control characters U+0001–U+001F to appear unescaped in strings, which includes tab (U+0009, `\t`), carriage return (U+000D, `\r`), and linefeed (U+000A, `\n`).
Templates or modules generating JSON with these errors for things like `<mapframe>` will be accepted under HHVM but will be (correctly) rejected under PHP7. Such templates/modules should be fixed to produce valid JSON.
We've had various tasks over the years pointing out this HHVM laxity, including T74778, T103346, T128029, T184694, and T207523.
----
Sorry if this is not the right way to go about doing this. I have recently been adding the [[https://en.wikipedia.org/wiki/Template:Highway_system_OSM_map|Highway system OSM map]] template to many pages without highway maps. This template basically displays a map with the red line being the highway the page is about and the green line being the highways that are part of the same system.
Normally, it renders like this:
{F28075611}
However, in PHP7 it displays this error:
{F28075623}
(Plaintext: <mapframe> Couldn't parse JSON: Syntax error).
What confuses me is why this new version of PHP would affect any template or Lua module. Even though this issue is specific to this one template so far, it seems rather odd that the new implementation of PHP would mess with any of the template and module code.
**Steps to Reproduce:**
1. Log into https://en.wikipedia.org.
2. In the "Beta" tab, make sure PHP7 is checked.
3. Go to a page using the Highway system OSM map template (in this example, the [[https://en.wikipedia.org/wiki/D%C5%8Dt%C5%8D_Expressway|Doto Expressway]] page).
4. Purge the page to erase the cache, or preview the page in Edit mode, then you will see this bug.
I am using Firefox 64. This issue has happened on every page with this template whenever I have PHP7 turned on.
Thank you in advance for helping.