3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = "Apr 21 08:45 AM,RediMed Northeast,15,2015-04-21 08:00:00.000,2015-04-21 08:04:00.000,2015-04-21 08:17:00.000,2015-04-21 08:17:00.000,90 minutes Apr 21 08:45 AM,RediMed North,14,2015-04-21 08:00:00.000,2015-04-21 08:22:00.000,2015-04-21 08:27:00.000,2015-04-21 00:00:00.000,90 minutes Apr 21 09:00 AM,RediMed Northeast,15,2015-04-21 08:00:00.000,2015-04-21 08:04:00.000,2015-04-21 08:17:00.000,2015-04-21 08:17:00.000,90 minutes Apr 21 09:00 AM,RediMed North,14,2015-04-21 08:00:00.000,2015-04-21 08:13:00.000,2015-04-21 08:17:00.000,2015-04-21 08:25:00.000,90 minutes"; $data = explode("\n", $data); $csv = array_map('str_getcsv', $data); foreach ($csv as $v) { echo $v; } ?>
based on D6i9q
Output for 5.4.0 - 7.2.0
Notice: Array to string conversion in /in/5VdBS on line 13 Array Notice: Array to string conversion in /in/5VdBS on line 13 Array Notice: Array to string conversion in /in/5VdBS on line 13 Array Notice: Array to string conversion in /in/5VdBS on line 13 Array
Output for 5.3.0 - 5.3.29
ArrayArrayArrayArray
Output for 4.3.2 - 4.3.10, 4.4.0 - 5.2.17
Warning: array_map(): The first argument, 'str_getcsv', should be either NULL or a valid callback in /in/5VdBS on line 10 Warning: Invalid argument supplied for foreach() in /in/5VdBS on line 12
Output for 4.3.11
Warning: array_map(): The first argument, 'str_getcsv', should be either NULL or a valid callback in /in/5VdBS on line 10
Output for 4.3.0 - 4.3.1
Warning: array_map() [http://www.php.net/function.array-map]: The first argument, 'str_getcsv', should be either NULL or a valid callback in /in/5VdBS on line 10 Warning: Invalid argument supplied for foreach() in /in/5VdBS on line 12