3v4l.org

run code in 300+ PHP versions simultaneously
<?php $csv = tmpfile(); fputcsv($csv, ['foo', 'bar', 'baz'], '💩'); rewind($csv); echo stream_get_contents($csv); fclose($csv);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
Fatal error: Uncaught ValueError: fputcsv(): Argument #3 ($separator) must be a single character in /in/ons2t:4 Stack trace: #0 /in/ons2t(4): fputcsv(Resource id #4, Array, '\xF0\x9F\x92\xA9') #1 {main} thrown in /in/ons2t on line 4
Process exited with code 255.
Output for 5.6.0 - 5.6.26, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: fputcsv(): delimiter must be a single character in /in/ons2t on line 4 foo�bar�baz
Output for 7.3.32 - 7.3.33
foo�bar�baz

preferences:
189.33 ms | 401 KiB | 233 Q