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.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: fopen(/tmp/file.csv): failed to open stream: Inappropriate ioctl for device in /in/DFbir on line 7 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/DFbir on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/DFbir on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/DFbir on line 9 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/DFbir on line 11
Output for hhvm-3.10.0 - 3.12.0
Warning: Invalid argument in /in/DFbir on line 7 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/DFbir on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/DFbir on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/DFbir on line 9 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/DFbir on line 11
Output for 5.1.0 - 5.2.17
Warning: fopen(/tmp/file.csv): failed to open stream: Inappropriate ioctl for device in /in/DFbir on line 7 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/DFbir on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/DFbir on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/DFbir on line 9 Warning: fclose(): supplied argument is not a valid stream resource in /in/DFbir on line 11
Output for 5.0.0 - 5.0.5
Warning: fopen(/tmp/file.csv): failed to open stream: Inappropriate ioctl for device in /in/DFbir on line 7 Fatal error: Call to undefined function fputcsv() in /in/DFbir 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: Success in /in/DFbir on line 7 Fatal error: Call to undefined function: fputcsv() in /in/DFbir on line 9
Process exited with code 255.
Output for 4.3.3 - 4.3.9, 4.3.11 - 4.4.4
Warning: fopen(/tmp/file.csv): failed to open stream: Success in /in/DFbir on line 7 Fatal error: Call to undefined function: fputcsv() in /in/DFbir on line 9
Process exited with code 255.
Output for 4.3.10
Warning: fopen(/tmp/file.csv): failed to open stream: Cannot allocate memory in /in/DFbir on line 7 Fatal error: Call to undefined function: fputcsv() in /in/DFbir on line 9
Process exited with code 255.
Output for 4.3.2
Warning: fopen(/tmp/file.csv): failed to open stream: Inappropriate ioctl for device in /in/DFbir on line 7 Fatal error: Call to undefined function: fputcsv() in /in/DFbir 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/DFbir on line 7 Fatal error: Call to undefined function: fputcsv() in /in/DFbir on line 9