请阅读以下程序代码,输出结果正确的是( )。
<?php
$a=1;
$temp=0;
while($a<=10){
if($a==8) break;
$temp+=$a; $a++;
}
echo $temp;
?>
A.
0
B.
36
C.
28
D.
27
正确答案是C