3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $list = array ( array('aaa', 'bbb', 'ccc', 'dddd'), array('123', '456', '789'), array('"aaa"', '"bbb"') ); $fp = fopen("/tmp/file.csv", "x+"); foreach ($list as $fields) { fputcsv($fp, $fields); } fclose($fp);
Output for 5.2.9, 5.3.29, 5.4.15, 5.4.31 - 5.5.24, 5.6.28, 7.0.14 - 7.1.0
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.14, 5.4.16 - 5.4.30, 5.5.25 - 5.6.21, 7.0.0 - 7.0.6
Warning: fopen(/tmp/file.csv): failed to open stream: File exists in /in/J1EHO on line 7 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/J1EHO on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/J1EHO on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/J1EHO on line 9 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/J1EHO on line 11
Output for hhvm-3.10.0 - 3.12.0
Warning: File exists in /in/J1EHO on line 7 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/J1EHO on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/J1EHO on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/J1EHO on line 9 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/J1EHO on line 11
Output for 5.1.0 - 5.2.8, 5.2.10 - 5.2.17
Warning: fopen(/tmp/file.csv): failed to open stream: File exists in /in/J1EHO on line 7 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/J1EHO on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/J1EHO on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/J1EHO on line 9 Warning: fclose(): supplied argument is not a valid stream resource in /in/J1EHO on line 11
Output for 5.0.0 - 5.0.5
Warning: fopen(/tmp/file.csv): failed to open stream: File exists in /in/J1EHO on line 7 Fatal error: Call to undefined function fputcsv() in /in/J1EHO on line 9
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Warning: fopen(/tmp/file.csv): failed to open stream: File exists in /in/J1EHO on line 7 Fatal error: Call to undefined function: fputcsv() in /in/J1EHO on line 9
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Warning: fopen(/tmp/file.csv): failed to open stream: File exists in /in/J1EHO on line 7 Fatal error: Call to undefined function: fputcsv() in /in/J1EHO on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: fopen(/tmp/file.csv) [http://www.php.net/function.fopen]: failed to create stream: Invalid argument in /in/J1EHO on line 7 Fatal error: Call to undefined function: fputcsv() in /in/J1EHO on line 9