CActiveRecord::count() should always return an integer. Please, someone tell me that i’m overlooking something. But i was very suprised today when i found this out today:
$count = User::model()->count();
echo gettype($count); // echoes 'string'
echo ($count===0) ? 'No users' : 'We have users'; // will not work as expected
I thought, this already worked for me. But checked with an older version, too. It’s the same there.
Now i read your post again - o.k. we might limit the range for max count values this way. I’m still for a change. If not, at least it needs to be made clearer in the API docs.
Return type "int" is simply wrong. So this needs to be corrected - you can spend lot of time to find bugs like these in your code, that could have been avoided with correct API docs.
Like i’ve written in the issue: A small note on the return value should help to clarify why it’s a string.