3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array(); $a[] = array(1, 2); $a[] = array(3, 4); $a[] = array(5, 6); $file = new splfileobject('/tmp/stdfile.txt', 'w+'); $file->fputcsv($a); var_dump(file_get_contents('/tmp/stdfile.txt'));
based on CUVV2
Output for 5.4.0 - 7.2.0
Notice: Array to string conversion in /in/kuGq9 on line 9 Notice: Array to string conversion in /in/kuGq9 on line 9 Notice: Array to string conversion in /in/kuGq9 on line 9 string(18) "Array,Array,Array "
Output for 5.1.0 - 5.3.29
Fatal error: Call to undefined method SplFileObject::fputcsv() in /in/kuGq9 on line 9
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Class 'splfileobject' not found in /in/kuGq9 on line 8
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: splfileobject in /in/kuGq9 on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: splfileobject in /in/kuGq9 on line 8