3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = array( 'lala', 'tral"alAa' ); $buffer = fopen('php://temp', 'r+'); fputcsv($buffer, $data, ',', '"'); rewind($buffer); $csv = fgets($buffer); fclose($buffer); echo $csv;
based on tN6WR
Output for 5.1.4 - 5.6.21, hhvm-3.12.0, 7.0.0 - 7.1.0
lala,"tral""alAa"
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.1.0 - 5.1.3
Warning: fopen(php://temp): failed to open stream: Inappropriate ioctl for device in /in/CtB2p on line 6 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/CtB2p on line 7 Warning: rewind(): supplied argument is not a valid stream resource in /in/CtB2p on line 8 Warning: fgets(): supplied argument is not a valid stream resource in /in/CtB2p on line 9 Warning: fclose(): supplied argument is not a valid stream resource in /in/CtB2p 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/CtB2p on line 6 Fatal error: Call to undefined function fputcsv() in /in/CtB2p 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/CtB2p on line 6 Fatal error: Call to undefined function: fputcsv() in /in/CtB2p 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/CtB2p on line 6 Fatal error: Call to undefined function: fputcsv() in /in/CtB2p 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/CtB2p on line 6 Fatal error: Call to undefined function: fputcsv() in /in/CtB2p 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/CtB2p on line 6 Fatal error: Call to undefined function: fputcsv() in /in/CtB2p on line 7