3v4l.org

run code in 300+ PHP versions simultaneously
<?php $notes = array( '-Rnote', '-Gnote', '-Ynote', 'note1 -R', '-Gnote1', '-Ynote1', ); $colors = array( '-R' => 'red', '-G' => 'green', '-Y' => 'yellow', ); foreach ($notes as $note ) { If(isset($colors[substr($note,0,2)])){ echo str_replace(substr($note, 0, 2), '<span style="background-color:' . $colors[substr($note, 0, 2)] . '">', $note) . "</span>\n"; }Else{ Echo $note ."\n"; } }
Output for git.master, git.master_jit, rfc.property-hooks
<span style="background-color:red">note</span> <span style="background-color:green">note</span> <span style="background-color:yellow">note</span> note1 -R <span style="background-color:green">note1</span> <span style="background-color:yellow">note1</span>

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:
163.04 ms | 406 KiB | 5 Q