Doesn't really test your php knowledge but definitely tests your problems solving skills. I'd say it is a pretty reasonable question to ask at an interview.
function returnCounts($jump,$slip,$height,$walls)
{
$count = 0;
while(true)
{
$count++;
$height -= $jump;
if ($height <= 0)
{
return $walls * $count;
}
else
{
$height += $slip;
}
}
}
I haven't tested this, but something like this should work