3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = array( 'lala', 'tral"ala' ); $buffer = fopen('php://temp', 'r+'); fputcsv($buffer, $data, ',', 'A'); rewind($buffer); $csv = fgets($buffer); fclose($buffer); echo $csv;
based on 781Ms
Output for 5.1.4 - 7.1.0
lala,tral"ala
Output for 5.1.0 - 5.1.3
Warning: fopen(php://temp): failed to open stream: Inappropriate ioctl for device in /in/Fdn6o on line 6 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/Fdn6o on line 7 Warning: rewind(): supplied argument is not a valid stream resource in /in/Fdn6o on line 8 Warning: fgets(): supplied argument is not a valid stream resource in /in/Fdn6o on line 9 Warning: fclose(): supplied argument is not a valid stream resource in /in/Fdn6o on line 10
Output for 5.0.0 - 5.0.5
Warning: fopen(php://temp): failed to open stream: Inappropriate ioctl for device in /in/Fdn6o on line 6 Fatal error: Call to undefined function fputcsv() in /in/Fdn6o on line 7
Process exited with code 255.
Output for 4.4.9
Warning: fopen(php://temp): failed to open stream: Cannot allocate memory in /in/Fdn6o on line 6 Fatal error: Call to undefined function: fputcsv() in /in/Fdn6o on line 7
Process exited with code 255.
Output for 4.4.5 - 4.4.8
Warning: fopen(php://temp): failed to open stream: Success in /in/Fdn6o on line 6 Fatal error: Call to undefined function: fputcsv() in /in/Fdn6o 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/Fdn6o on line 6 Fatal error: Call to undefined function: fputcsv() in /in/Fdn6o 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/Fdn6o on line 6 Fatal error: Call to undefined function: fputcsv() in /in/Fdn6o 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/Fdn6o on line 6 Fatal error: Call to undefined function: fputcsv() in /in/Fdn6o on line 7