3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = 'test'; $arr = ['test','test2']; if(false !== $key = array_search($test, $arr)){ echo $key; }

preferences:
45.59 ms | 402 KiB | 5 Q