3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array =array( "123,456,789"=> "1,1,1", "333"=>"1", "777"=>"1" ); $keys = array_keys($array); $matching_key = preg_grep("/\b333\b/", $keys); $value = $array[current($matching_key)]; var_dump($matching_key);
based on PfnMi
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0alpha1
array(1) { [1]=> int(333) }
Output for hhvm-3.15.4
array(1) { [1]=> string(3) "333" }