3v4l.org

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

preferences:
42.57 ms | 402 KiB | 5 Q