3v4l.org

run code in 300+ PHP versions simultaneously
<?php $csv = <<<'CSV' name, mail, age, bio john, j@ohn.com, 32, mary, mary@popp.com, 29, jeff, brid@ges.co, 47, "peterson, peter", peter@sson.com, 44, "loves: hobbies puzzles" CSV; $file = fopen('php://temp', 'rw'); var_dump($file); echo "\n"; fwrite($file, $csv); rewind($file); fpassthru($file); rewind($file); echo "\n\n"; function csv($file) { $header = null; while ($row = fgetcsv($file)) { $row = array_map('trim', $row); if ($header) { yield array_combine($header, $row); } else { $header = $row; } } } print_r(iterator_to_array(csv($file)));
Output for git.master, git.master_jit, rfc.property-hooks
resource(5) of type (stream) name, mail, age, bio john, j@ohn.com, 32, mary, mary@popp.com, 29, jeff, brid@ges.co, 47, "peterson, peter", peter@sson.com, 44, "loves: hobbies puzzles" Array ( [0] => Array ( [name] => john [mail] => j@ohn.com [age] => 32 [bio] => ) [1] => Array ( [name] => mary [mail] => mary@popp.com [age] => 29 [bio] => ) [2] => Array ( [name] => jeff [mail] => brid@ges.co [age] => 47 [bio] => ) [3] => Array ( [name] => peterson, peter [mail] => peter@sson.com [age] => 44 [bio] => loves: hobbies puzzles ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
27.01 ms | 407 KiB | 5 Q