3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = array( 'lala', 'tralala' ); $buffer = fopen('php://temp', 'r+'); fputcsv($buffer, $data, ',', ' g'); rewind($buffer); $csv = fgets($buffer); fclose($buffer); var_dump($csv);
based on 7NTiA
Output for 5.1.4 - 5.6.28, 7.0.0 - 7.1.0
Notice: fputcsv(): enclosure must be a single character in /in/TkC7K on line 7 string(13) "lala,tralala "
Output for hhvm-3.10.0 - 3.13.2
Notice: enclosure must be a single character in /in/TkC7K on line 7 string(13) "lala,tralala "
Output for 5.1.0 - 5.1.3
Warning: fopen(php://temp): failed to open stream: Inappropriate ioctl for device in /in/TkC7K on line 6 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/TkC7K on line 7 Warning: rewind(): supplied argument is not a valid stream resource in /in/TkC7K on line 8 Warning: fgets(): supplied argument is not a valid stream resource in /in/TkC7K on line 9 Warning: fclose(): supplied argument is not a valid stream resource in /in/TkC7K on line 10 bool(false)
Output for 5.0.0 - 5.0.5
Warning: fopen(php://temp): failed to open stream: Inappropriate ioctl for device in /in/TkC7K on line 6 Fatal error: Call to undefined function fputcsv() in /in/TkC7K on line 7
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Warning: fopen(php://temp): failed to open stream: Success in /in/TkC7K on line 6 Fatal error: Call to undefined function: fputcsv() in /in/TkC7K on line 7
Process exited with code 255.
Output for 4.3.3 - 4.4.4
Warning: fopen(php://temp): failed to open stream: Success in /in/TkC7K on line 6 Fatal error: Call to undefined function: fputcsv() in /in/TkC7K on line 7
Process exited with code 255.
Output for 4.3.2
Warning: fopen(php://temp): failed to open stream: Inappropriate ioctl for device in /in/TkC7K on line 6 Fatal error: Call to undefined function: fputcsv() in /in/TkC7K on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: fopen(php://temp) [http://www.php.net/function.fopen]: failed to create stream: Inappropriate ioctl for device in /in/TkC7K on line 6 Fatal error: Call to undefined function: fputcsv() in /in/TkC7K on line 7