3v4l.org

run code in 300+ PHP versions simultaneously
<?php $paradasarray = [ (object)['localidad' => 'Estepona whatever'], (object)['localidad' => 'something Benalmádena'], (object)['localidad' => 'Benalmádena foo'], (object)['localidad' => 'Estepona bar'] ]; $result = []; foreach ($paradasarray as $i => $parada) { echo "iteration #$i\n"; if (strpos($parada->localidad, 'Benalmádena') !== false) { $result['Benalmádena'] = "Benalmádena Costa"; } elseif (strpos($parada->localidad, 'Estepona') !== false) { $result['Estepona'] = 'Estepona'; } if (count($result) == 2) { break; } } // you don't need to declare a value attribute if it matches the text echo "<select>\n"; echo "\t<option>" , implode("</option>\n\t<option>", $result) , "</option>\n"; echo "</select>";
Output for git.master, git.master_jit, rfc.property-hooks
iteration #0 iteration #1 <select> <option>Estepona</option> <option>Benalmádena Costa</option> </select>

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:
30.13 ms | 405 KiB | 5 Q