Считайте объект php

$total = count((array)$obj);
Shadow