3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "\xEF\xBB\xBF\x22\x61\x22\x0A"; var_dump(mb_detect_encoding($string)); $stream = fopen('php://memory', 'w+'); fwrite($stream, $string); rewind($stream); var_dump(fgetcsv($stream, 1000, ","));
Output for 5.3.7 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.25, 5.5.27 - 5.5.38, 5.6.0 - 5.6.24, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
string(5) "UTF-8" array(1) { [0]=> string(6) ""a"" }
Output for 5.5.26

Process exited with code 137.
Output for 5.1.4 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.6
string(5) "UTF-8" array(1) { [0]=> string(1) "a" }
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.3
string(5) "UTF-8" Warning: fopen(php://memory): failed to open stream: Success in /in/I3e3l on line 7 Warning: fwrite(): supplied argument is not a valid stream resource in /in/I3e3l on line 8 Warning: rewind(): supplied argument is not a valid stream resource in /in/I3e3l on line 9 Warning: fgetcsv() expects parameter 1 to be resource, boolean given in /in/I3e3l on line 11 NULL
Output for 4.3.5 - 4.3.11, 4.4.0 - 4.4.9
string(5) "UTF-8" Warning: fopen(php://memory): failed to open stream: Success in /in/I3e3l on line 7 Warning: fwrite(): supplied argument is not a valid stream resource in /in/I3e3l on line 8 Warning: rewind(): supplied argument is not a valid stream resource in /in/I3e3l on line 9 Warning: fgetcsv(): supplied argument is not a valid stream resource in /in/I3e3l on line 11 bool(false)
Output for 4.3.3 - 4.3.4
string(5) "UTF-8" Warning: fopen(php://memory): failed to open stream: Success in /in/I3e3l on line 7 Warning: fwrite(): supplied argument is not a valid stream resource in /in/I3e3l on line 8 Warning: rewind(): supplied argument is not a valid stream resource in /in/I3e3l on line 9 Warning: fgetcsv(): supplied argument is not a valid stream resource in /in/I3e3l on line 11 NULL
Output for 4.3.2
string(5) "UTF-8" Warning: fopen(php://memory): failed to open stream: Inappropriate ioctl for device in /in/I3e3l on line 7 Warning: fwrite(): supplied argument is not a valid stream resource in /in/I3e3l on line 8 Warning: rewind(): supplied argument is not a valid stream resource in /in/I3e3l on line 9 Warning: fgetcsv(): supplied argument is not a valid stream resource in /in/I3e3l on line 11 NULL
Output for 4.3.0 - 4.3.1
string(5) "UTF-8" Warning: fopen(php://memory) [http://www.php.net/function.fopen]: failed to create stream: Inappropriate ioctl for device in /in/I3e3l on line 7 Warning: fwrite(): supplied argument is not a valid stream resource in /in/I3e3l on line 8 Warning: rewind(): supplied argument is not a valid stream resource in /in/I3e3l on line 9 Warning: fgetcsv(): supplied argument is not a valid stream resource in /in/I3e3l on line 11 NULL

preferences:
305.1 ms | 402 KiB | 374 Q