3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $list = array ( array('aaa,', 'bbb', 'ccc', 'dddd'), array('123', '456', '789'), array('"aaa"', '"bbb"') ); $fp = fopen('/tmp/file.csv', 'w'); foreach ($list as $fields) { fputcsv($fp, $fields); } fclose($fp); echo file_get_contents('/tmp/file.csv');
based on WT0lN
Output for 5.1.0 - 7.2.0
"aaa,",bbb,ccc,dddd 123,456,789 """aaa""","""bbb"""
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function fputcsv() in /in/dJaBF on line 11
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: fputcsv() in /in/dJaBF on line 11
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: fputcsv() in /in/dJaBF on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: fputcsv() in /in/dJaBF on line 11