3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $result = array( array("claim_id" => 1, "forename" => "foo", "surname" => "bar", "date" => "2013-12-01"), array("claim_id" => 2, "forename" => "foo2", "surname" => "bar2", "date" => "2013-12-02"), array("claim_id" => 3, "forename" => "foo3", "surname" => "bar3", "date" => "2013-12-03") ; $fp = fopen('php://output', 'w'); foreach($result AS $row) { if(!$header) { $header = array_keys($row); fputcsv($fp, $row); } fputcsv($fp, $row); } fclose($fp);
Output for 5.3.0 - 5.4.22
Parse error: syntax error, unexpected ';', expecting ')' in /in/8jskH on line 6
Process exited with code 255.