3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$data = $form->data[]; $list = array ( array('aaa', 'bbb', 'ccc', 'dddd'), array('123', '456', '789'), array('"aaa"', '"bbb"') ); $folder = 'csv-test'; $fp = fopen('$folder', 'w'); foreach ($list as $fields) { fputcsv($fp, $fields); } fclose($fp); ?>
Output for 8.3.0 - 8.3.4, 8.3.6
Warning: fopen(): open_basedir restriction in effect. File($folder) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Th9BF on line 11 Warning: fopen($folder): Failed to open stream: Operation not permitted in /in/Th9BF on line 11 Fatal error: Uncaught TypeError: fputcsv(): Argument #1 ($stream) must be of type resource, false given in /in/Th9BF:14 Stack trace: #0 /in/Th9BF(14): fputcsv(false, Array) #1 {main} thrown in /in/Th9BF on line 14
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Warning: fopen(): open_basedir restriction in effect. File($folder) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Th9BF on line 11 Warning: fopen($folder): Failed to open stream: Operation not permitted in /in/Th9BF on line 11 Fatal error: Uncaught TypeError: fputcsv(): Argument #1 ($stream) must be of type resource, false given in /in/Th9BF:14 Stack trace: #0 /in/Th9BF(14): fputcsv(false, Array) #1 {main} thrown in /in/Th9BF on line 14
Process exited with code 255.
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Warning: fopen(): open_basedir restriction in effect. File($folder) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Th9BF on line 11 Warning: fopen($folder): Failed to open stream: Operation not permitted in /in/Th9BF on line 11 Fatal error: Uncaught TypeError: fputcsv(): Argument #1 ($stream) must be of type resource, bool given in /in/Th9BF:14 Stack trace: #0 /in/Th9BF(14): fputcsv(false, Array) #1 {main} thrown in /in/Th9BF on line 14
Process exited with code 255.
Output for 8.0.13
Warning: fopen($folder): Failed to open stream: Read-only file system in /in/Th9BF on line 11 Fatal error: Uncaught TypeError: fputcsv(): Argument #1 ($stream) must be of type resource, bool given in /in/Th9BF:14 Stack trace: #0 /in/Th9BF(14): fputcsv(false, Array) #1 {main} thrown in /in/Th9BF on line 14
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 7.4.33
Warning: fopen($folder): failed to open stream: Read-only file system in /in/Th9BF on line 11 Warning: fputcsv() expects parameter 1 to be resource, bool given in /in/Th9BF on line 14 Warning: fputcsv() expects parameter 1 to be resource, bool given in /in/Th9BF on line 14 Warning: fputcsv() expects parameter 1 to be resource, bool given in /in/Th9BF on line 14 Warning: fclose() expects parameter 1 to be resource, bool given in /in/Th9BF on line 17
Output for 7.3.16 - 7.3.31, 7.4.0 - 7.4.32
Warning: fopen(): open_basedir restriction in effect. File($folder) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Th9BF on line 11 Warning: fopen($folder): failed to open stream: Operation not permitted in /in/Th9BF on line 11 Warning: fputcsv() expects parameter 1 to be resource, bool given in /in/Th9BF on line 14 Warning: fputcsv() expects parameter 1 to be resource, bool given in /in/Th9BF on line 14 Warning: fputcsv() expects parameter 1 to be resource, bool given in /in/Th9BF on line 14 Warning: fclose() expects parameter 1 to be resource, bool given in /in/Th9BF on line 17
Output for 7.2.29 - 7.2.33
Warning: fopen(): open_basedir restriction in effect. File($folder) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Th9BF on line 11 Warning: fopen($folder): failed to open stream: Operation not permitted in /in/Th9BF on line 11 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/Th9BF on line 14 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/Th9BF on line 14 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/Th9BF on line 14 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/Th9BF on line 17
Output for 7.2.6
Warning: fopen(): open_basedir restriction in effect. File($folder) is not within the allowed path(s): (/tmp:/in) in /in/Th9BF on line 11 Warning: fopen($folder): failed to open stream: Operation not permitted in /in/Th9BF on line 11 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/Th9BF on line 14 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/Th9BF on line 14 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/Th9BF on line 14 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/Th9BF on line 17
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0
Warning: fopen($folder): failed to open stream: Permission denied in /in/Th9BF on line 11 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/Th9BF on line 14 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/Th9BF on line 14 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/Th9BF on line 14 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/Th9BF on line 17
Output for 5.2.3 - 5.2.17
Warning: fopen($folder): failed to open stream: Permission denied in /in/Th9BF on line 11 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/Th9BF on line 14 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/Th9BF on line 14 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/Th9BF on line 14 Warning: fclose(): supplied argument is not a valid stream resource in /in/Th9BF on line 17
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.2
Warning: fopen($folder): failed to open stream: Read-only file system in /in/Th9BF on line 11 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/Th9BF on line 14 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/Th9BF on line 14 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/Th9BF on line 14 Warning: fclose(): supplied argument is not a valid stream resource in /in/Th9BF on line 17
Output for 5.0.0 - 5.0.5
Warning: fopen($folder): failed to open stream: Read-only file system in /in/Th9BF on line 11 Fatal error: Call to undefined function fputcsv() in /in/Th9BF on line 14
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Warning: fopen($folder): failed to open stream: Read-only file system in /in/Th9BF on line 11 Fatal error: Call to undefined function: fputcsv() in /in/Th9BF on line 14
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Warning: fopen($folder): failed to open stream: Read-only file system in /in/Th9BF on line 11 Fatal error: Call to undefined function: fputcsv() in /in/Th9BF on line 14
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: fopen($folder) [http://www.php.net/function.fopen]: failed to create stream: Read-only file system in /in/Th9BF on line 11 Fatal error: Call to undefined function: fputcsv() in /in/Th9BF on line 14

preferences:
240.28 ms | 401 KiB | 310 Q