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("file.csv", "X+"); foreach ($list as $fields) { fputcsv($fp, $fields); } fclose($fp); ?>
Output for 5.3.0 - 7.1.0
Warning: fopen(file.csv): failed to open stream: Inappropriate ioctl for device in /in/EqsZd on line 7 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/EqsZd on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/EqsZd on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/EqsZd on line 9 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/EqsZd on line 11
Output for 5.1.0 - 5.2.17
Warning: fopen(file.csv): failed to open stream: Inappropriate ioctl for device in /in/EqsZd on line 7 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/EqsZd on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/EqsZd on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/EqsZd on line 9 Warning: fclose(): supplied argument is not a valid stream resource in /in/EqsZd on line 11
Output for 5.0.0 - 5.0.5
Warning: fopen(file.csv): failed to open stream: Inappropriate ioctl for device in /in/EqsZd on line 7 Fatal error: Call to undefined function fputcsv() in /in/EqsZd on line 9
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Warning: fopen(file.csv): failed to open stream: Success in /in/EqsZd on line 7 Fatal error: Call to undefined function: fputcsv() in /in/EqsZd on line 9
Process exited with code 255.
Output for 4.3.3 - 4.4.4
Warning: fopen(file.csv): failed to open stream: Success in /in/EqsZd on line 7 Fatal error: Call to undefined function: fputcsv() in /in/EqsZd on line 9
Process exited with code 255.
Output for 4.3.2
Warning: fopen(file.csv): failed to open stream: Inappropriate ioctl for device in /in/EqsZd on line 7 Fatal error: Call to undefined function: fputcsv() in /in/EqsZd on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: fopen(file.csv) [http://www.php.net/function.fopen]: failed to create stream: Invalid argument in /in/EqsZd on line 7 Fatal error: Call to undefined function: fputcsv() in /in/EqsZd on line 9