3v4l.org

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

Process exited with code 153.
Output for 5.1.0 - 5.1.3
b Warning: fopen(php://temp): failed to open stream: Inappropriate ioctl for device in /in/eCClZ on line 6 Warning: fputcsv() expects parameter 1 to be resource, boolean given in /in/eCClZ on line 7 Warning: rewind(): supplied argument is not a valid stream resource in /in/eCClZ on line 8 Warning: fgets(): supplied argument is not a valid stream resource in /in/eCClZ on line 9 Warning: fclose(): supplied argument is not a valid stream resource in /in/eCClZ on line 10
Output for 5.0.0 - 5.0.5
b Warning: fopen(php://temp): failed to open stream: Inappropriate ioctl for device in /in/eCClZ on line 6 Fatal error: Call to undefined function fputcsv() in /in/eCClZ on line 7
Process exited with code 255.
Output for 4.4.5 - 4.4.9
b Warning: fopen(php://temp): failed to open stream: Success in /in/eCClZ on line 6 Fatal error: Call to undefined function: fputcsv() in /in/eCClZ on line 7
Process exited with code 255.
Output for 4.3.3 - 4.4.4
b Warning: fopen(php://temp): failed to open stream: Success in /in/eCClZ on line 6 Fatal error: Call to undefined function: fputcsv() in /in/eCClZ on line 7
Process exited with code 255.
Output for 4.3.2
b Warning: fopen(php://temp): failed to open stream: Inappropriate ioctl for device in /in/eCClZ on line 6 Fatal error: Call to undefined function: fputcsv() in /in/eCClZ on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
b Warning: fopen(php://temp) [http://www.php.net/function.fopen]: failed to create stream: Inappropriate ioctl for device in /in/eCClZ on line 6 Fatal error: Call to undefined function: fputcsv() in /in/eCClZ on line 7