3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = "hello : 6\ngoodbye : 7\nfoo : bar\n"; $lines = explode("\n", trim($data)); $tuples = array_map( function($line) { $splitLine = array_map('trim', explode(':', $line)); return array( trim(substr($line, 0, strpos($line, ':'))), trim(substr($line, strpos($line, ':') + 1)) ); }, $lines ); $output = array_combine( array_map(function($t) { return $t[0]; }, $tuples), array_map(function($t) { return $t[1]; }, $tuples) ); var_dump($output);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { ["hello"]=> string(1) "6" ["goodbye"]=> string(1) "7" ["foo"]=> string(3) "bar" }

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:
50.97 ms | 401 KiB | 8 Q