3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "TeSt", "Te s-t", "", "Te4St" ]; foreach ($strings as $string) { if(preg_match('#^[a-z -]+$#i', $string, $matches)){ echo $matches[0] . PHP_EOL; } }

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
209.35 ms | 2108 KiB | 11 Q