Even more efficiency:
The original code snippet and the following suggestions are inefficient in that they rely on the overlying php to fill vertically using loops rather than taking advantage of the underlying drawing routines. Also, this is done by repeatedly drawing filled partial elipses and circular calculations are typically expensive (PHP may use tables, I'm not sure) The original code could be rewritten as
<?php
imagefilledarc($image, 50, 60, 100, 50, 0, 45, $darknavy, IMG_ARC_PIE);
imagefilledarc($image, 50, 60, 100, 50, 45, 75 , $darkgray, IMG_ARC_PIE);
imagefilledarc($image, 50, 60, 100, 50, 75, 360 , $darkred, IMG_ARC_PIE);
$c1=50*cos(45/180*M_PI);
$s1=25*sin(45/180*M_PI);
$c2=50*cos(75/180*M_PI);
$s2=25*sin(75/180*M_PI);
$area1=array(100,60,100,50,50+$c1,50+$s1,50+$c1,60+$s1);
$area2=array(50+$c1,50+$s1,50+$c1,60+$s1,50+$c2,60+$s2,50+$c2,50+$s2);
$area3=array(50+$c2,50+$s2,50+$c2,60+$s2,0,60,0,50);
imagefilledpolygon($image, $area1 , 4 , $darknavy);
imagefilledpolygon($image, $area2 , 4 , $darkgray);
imagefilledpolygon($image, $area3 , 4 , $darkred);
imagefilledarc($image, 50, 50, 100, 50, 0, 45, $navy, IMG_ARC_PIE);
imagefilledarc($image, 50, 50, 100, 50, 45, 75 , $gray, IMG_ARC_PIE);
imagefilledarc($image, 50, 50, 100, 50, 75, 360 , $red, IMG_ARC_PIE);
?>
Note that the polygons are perhaps slightly inefficient. If there was an imagefilledtriangle, this code would be simpler. Given how fundamental triangles are, perhaps for a future version?
Rich