mi restituisce errore questo codice, cosa sbaglio?

<?php
$i = 0;
$max = 4;
while($i < $max) :
if (preg_match("/^lingua-/", $title)) :
echo $title;
$i++;
endif;
endwhile;
?>

Grazie