3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "Raphaƫl said you aren't coming home."; function isValidLength($text, $length) { return $length <= preg_match_all("~[\pL\pM'-]+~u", $text); } var_export( [ 5 => isValidLength($text, 5), 6 => isValidLength($text, 6), 7 => isValidLength($text, 7), ] );

preferences:
56.89 ms | 402 KiB | 5 Q