<?php
function isPrime($num) {
if ($num <= 1) return false;
for ($i = 2; $i * $i <= $num; $i++) {
if ($num % $i == 0) return false;
}
return true;
}
echo isPrime(87);
?>
PD9waHAKCmZ1bmN0aW9uIGlzUHJpbWUoJG51bSkgewogICAgaWYgKCRudW0gPD0gMSkgcmV0dXJuIGZhbHNlOwogICAgZm9yICgkaSA9IDI7ICRpICogJGkgPD0gJG51bTsgJGkrKykgewogICAgICAgIGlmICgkbnVtICUgJGkgPT0gMCkgcmV0dXJuIGZhbHNlOwogICAgfQogICAgcmV0dXJuIHRydWU7Cn0KCmVjaG8gaXNQcmltZSg4Nyk7Cj8+