use scalar() when counting array elements...more consistent than counting on scalar context