3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array("red", "reddish", "re", "red diamond"); $red = array_keys(preg_grep("/red/", $a)); print_r($red); ?>
Output for 4.3.0 - 7.1.0
Array ( [0] => 0 [1] => 1 [2] => 3 )