3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $intColumnValue = 5; $stringColumnValue = "asds"; $stringColumnValueWithQuotes = "asds \"test\" sdfg"; $jsonValue = [ 'number' => 7.8, 'string' => 'aqsdsdw', 'bool' => true, 'stringWithQuotes' => 'test1 "test2" test3', ]; $jsonColumnValue = json_encode($jsonValue); $csvRow = [$intColumnValue, $stringColumnValue, $stringColumnValueWithQuotes, $jsonColumnValue]; fputcsv(STDOUT, $csvRow);
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.1.0 - 7.2.6
5,asds,"asds ""test"" sdfg","{""number"":7.8,""string"":""aqsdsdw"",""bool"":true,""stringWithQuotes"":""test1 \"test2\" test3""}"