3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $list = array ( array('aaa', 'bbb', 'ccc', 'dddd'), array('123', '456', '789'), array('"aaa"', '"bbb"') ); $fp = fopen('file.csv', 'w'); foreach ($list as $fields) { fputcsv($fp, $fields); } fclose($fp);
Output for 7.3.0 - 7.3.1
Warning: fopen(): open_basedir restriction in effect. File(file.csv) is not within the allowed path(s): (/tmp:/in:/etc) in /in/69s47 on line 9 Warning: fopen(file.csv): failed to open stream: Operation not permitted in /in/69s47 on line 9 Warning: fputcsv() expects parameter 1 to be resource, bool given in /in/69s47 on line 12 Warning: fputcsv() expects parameter 1 to be resource, bool given in /in/69s47 on line 12 Warning: fputcsv() expects parameter 1 to be resource, bool given in /in/69s47 on line 12 Warning: fclose() expects parameter 1 to be resource, bool given in /in/69s47 on line 15
Output for 7.1.25 - 7.2.13
Warning: fopen(): open_basedir restriction in effect. File(file.csv) is not within the allowed path(s): (/tmp:/in:/etc) in /in/69s47 on line 9 Warning: fopen(file.csv): failed to open stream: Operation not permitted in /in/69s47 on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/69s47 on line 12 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/69s47 on line 12 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/69s47 on line 12 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/69s47 on line 15
Output for 7.1.20
Warning: fopen(): open_basedir restriction in effect. File(file.csv) is not within the allowed path(s): (/tmp:/in) in /in/69s47 on line 9 Warning: fopen(file.csv): failed to open stream: Operation not permitted in /in/69s47 on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/69s47 on line 12 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/69s47 on line 12 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/69s47 on line 12 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/69s47 on line 15
Output for 5.3.0 - 5.6.30, 7.0.0 - 7.1.11
Warning: fopen(file.csv): failed to open stream: Permission denied in /in/69s47 on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/69s47 on line 12 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/69s47 on line 12 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/69s47 on line 12 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/69s47 on line 15
Output for hhvm-3.22.0
Warning: Permission denied in /in/69s47 on line -1 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/69s47 on line -1 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/69s47 on line -1 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/69s47 on line -1 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/69s47 on line -1
Output for hhvm-3.10.1 - 3.21.3
Warning: Permission denied in /in/69s47 on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/69s47 on line 12 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/69s47 on line 12 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/69s47 on line 12 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/69s47 on line 15
Output for 5.1.0 - 5.2.17
Warning: fopen(file.csv): failed to open stream: Permission denied in /in/69s47 on line 9 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/69s47 on line 12 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/69s47 on line 12 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/69s47 on line 12 Warning: fclose(): supplied argument is not a valid stream resource in /in/69s47 on line 15
Output for 5.0.0 - 5.0.5
Warning: fopen(file.csv): failed to open stream: Read-only file system in /in/69s47 on line 9 Fatal error: Call to undefined function fputcsv() in /in/69s47 on line 12
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Warning: fopen(file.csv): failed to open stream: Read-only file system in /in/69s47 on line 9 Fatal error: Call to undefined function: fputcsv() in /in/69s47 on line 12
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Warning: fopen(file.csv): failed to open stream: Read-only file system in /in/69s47 on line 9 Fatal error: Call to undefined function: fputcsv() in /in/69s47 on line 12
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: Read-only file system in /in/69s47 on line 9 Fatal error: Call to undefined function: fputcsv() in /in/69s47 on line 12