3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $stream = fopen('data://text/plain,' . "", 'w+'); fputcsv($stream, array('test','csv "derp"')); rewind($stream); $csv = stream_get_contents($stream); fclose($stream); echo $csv;
Output for 5.2.0 - 5.6.28, 7.0.0 - 7.1.0
test,"csv ""derp"""
Output for hhvm-3.10.0 - 3.12.0
Fatal error: cannot write a mem stream: data://text/plain, in /in/FAj6g on line 4
Process exited with code 255.
Output for 5.1.0 - 5.1.6
<br /> <b>Warning</b>: fopen(data://text/plain,) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in <b>/in/FAj6g</b> on line <b>3</b><br /> <br /> <b>Warning</b>: fputcsv() expects parameter 1 to be resource, boolean given in <b>/in/FAj6g</b> on line <b>4</b><br /> <br /> <b>Warning</b>: rewind(): supplied argument is not a valid stream resource in <b>/in/FAj6g</b> on line <b>5</b><br /> <br /> <b>Warning</b>: stream_get_contents() expects parameter 1 to be resource, boolean given in <b>/in/FAj6g</b> on line <b>6</b><br /> <br /> <b>Warning</b>: fclose(): supplied argument is not a valid stream resource in <b>/in/FAj6g</b> on line <b>7</b><br />
Output for 5.0.0 - 5.0.5
<br /> <b>Warning</b>: fopen(data://text/plain,) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in <b>/in/FAj6g</b> on line <b>3</b><br /> <br /> <b>Fatal error</b>: Call to undefined function fputcsv() in <b>/in/FAj6g</b> on line <b>4</b><br />
Process exited with code 255.
Output for 4.4.5 - 4.4.9
<br /> <b>Warning</b>: fopen(data://text/plain,) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in <b>/in/FAj6g</b> on line <b>3</b><br /> <br /> <b>Fatal error</b>: Call to undefined function: fputcsv() in <b>/in/FAj6g</b> on line <b>4</b><br />
Process exited with code 255.
Output for 4.4.3 - 4.4.4
<br /> <b>Warning</b>: fopen(data://text/plain,) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in <b>/in/FAj6g</b> on line <b>3</b><br /> <br /> <b>Fatal error</b>: Call to undefined function: fputcsv() in <b>/in/FAj6g</b> on line <b>4</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.4.2
<br /> <b>Warning</b>: fopen(data://text/plain,): failed to open stream: No such file or directory in <b>/in/FAj6g</b> on line <b>3</b><br /> <br /> <b>Fatal error</b>: Call to undefined function: fputcsv() in <b>/in/FAj6g</b> on line <b>4</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Warning</b>: fopen(data://text/plain,) [<a href='http://www.php.net/function.fopen'>function.fopen</a>]: failed to create stream: No such file or directory in <b>/in/FAj6g</b> on line <b>3</b><br /> <br /> <b>Fatal error</b>: Call to undefined function: fputcsv() in <b>/in/FAj6g</b> on line <b>4</b><br />