3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<pre> <?php $csv = <<<CSV "item1", "single line field" "item2", "multi line field" "item3", "single line field" CSV; $csvDataURI = 'data:text/plain;base64,'.base64_encode( $csv ); $handle = fopen( $csvDataURI, 'r' ); while ( $line = fgetcsv($handle) ){ print_r( $line ); } fclose( $handle ); ?> </pre>
Output for 5.2.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<pre> Array ( [0] => item1 [1] => single line field ) Array ( [0] => item2 [1] => multi line field ) Array ( [0] => item3 [1] => single line field ) </pre>
Output for 5.0.0 - 5.1.1, 5.1.3 - 5.1.6
<pre> Warning: fopen(data:text/plain;base64,CSJpdGVtMSIsICJzaW5nbGUgbGluZSBmaWVsZCIKCSJpdGVtMiIsICJtdWx0aQoJbGluZQoJZmllbGQiCgkiaXRlbTMiLCAic2luZ2xlIGxpbmUgZmllbGQi): failed to open stream: No such file or directory in /in/sb0Cq on line 14 Warning: fgetcsv() expects parameter 1 to be resource, boolean given in /in/sb0Cq on line 16 Warning: fclose(): supplied argument is not a valid stream resource in /in/sb0Cq on line 21 </pre>
Output for 5.1.2
<pre> Warning: fopen(data:text/plain;base64,CSJpdGVtMSIsICJzaW5nbGUgbGluZSBmaWVsZCIKCSJpdGVtMiIsICJtdWx0aQoJbGluZQoJZmllbGQiCgkiaXRlbTMiLCAic2luZ2xlIGxpbmUgZmllbGQi): failed to open stream: No such file or directory in /in/sb0Cq on line 15 Warning: fgetcsv() expects parameter 1 to be resource, boolean given in /in/sb0Cq on line 17 Warning: fclose(): supplied argument is not a valid stream resource in /in/sb0Cq on line 22 </pre>
Output for 4.3.2 - 4.4.1, 4.4.3 - 4.4.9
<pre> Warning: fopen(data:text/plain;base64,CSJpdGVtMSIsICJzaW5nbGUgbGluZSBmaWVsZCIKCSJpdGVtMiIsICJtdWx0aQoJbGluZQoJZmllbGQiCgkiaXRlbTMiLCAic2luZ2xlIGxpbmUgZmllbGQi): failed to open stream: No such file or directory in /in/sb0Cq on line 14 Warning: Wrong parameter count for fgetcsv() in /in/sb0Cq on line 16 Warning: fclose(): supplied argument is not a valid stream resource in /in/sb0Cq on line 21 </pre>
Output for 4.4.2
<pre> Warning: fopen(data:text/plain;base64,CSJpdGVtMSIsICJzaW5nbGUgbGluZSBmaWVsZCIKCSJpdGVtMiIsICJtdWx0aQoJbGluZQoJZmllbGQiCgkiaXRlbTMiLCAic2luZ2xlIGxpbmUgZmllbGQi): failed to open stream: No such file or directory in /in/sb0Cq on line 15 Warning: Wrong parameter count for fgetcsv() in /in/sb0Cq on line 17 Warning: fclose(): supplied argument is not a valid stream resource in /in/sb0Cq on line 22 </pre>
Output for 4.3.0 - 4.3.1
<pre> Warning: fopen(data:text/plain;base64,CSJpdGVtMSIsICJzaW5nbGUgbGluZSBmaWVsZCIKCSJpdGVtMiIsICJtdWx0aQoJbGluZQoJZmllbGQiCgkiaXRlbTMiLCAic2luZ2xlIGxpbmUgZmllbGQi) [http://www.php.net/function.fopen]: failed to create stream: No such file or directory in /in/sb0Cq on line 14 Warning: Wrong parameter count for fgetcsv() in /in/sb0Cq on line 16 Warning: fclose(): supplied argument is not a valid stream resource in /in/sb0Cq on line 21 </pre>