3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = [ "newsletter" => [ "capture_source" => "popup", "gender" => "female", "email" => "da12@da.com", "signed_up_date" => "2015-03-10T14:15:19+10:00", ] ]; var_dump(json_encode($a));
Output for 5.4.0 - 7.2.0
string(126) "{"newsletter":{"capture_source":"popup","gender":"female","email":"da12@da.com","signed_up_date":"2015-03-10T14:15:19+10:00"}}"
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/D9d44 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/D9d44 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/D9d44 on line 3
Process exited with code 255.