Phalcon\Mvc\Model::count() return string

In document, count() return int.

Abstract class Phalcon\Mvc\Model — Phalcon 1.3.0 documentation

public static int count ([array $parameters])

But count() return string.


        $count = Robots::count();


string '2' (length=1)

Is it bug?

Phalcon 1.3.2 (DB: MySQL)


PHP is a weak type language, if a number present as a string, you still can use it as number, and make number operation on it.

Hi, hu2008yinxiang.

If count() returns int described in the document, I want to chek result by strict comparisons.

PHP: PHP type comparison tables - Manual



as the document it returns int, mean the result is number value, do you think it is realy matter the number value's type ?


strict comparison work for the mixed returned value, but the Model::count always return a string-type number value. not the mixed-type

Hi, hu2008yinxiang.

This is not realy matter :). I feel a little bad feeling.

I haven't check cphalcon source code deeply, sorry. If the Model::count never returns FALSE, NULL and "", I'll check result by loose comparisons.

If the Model::count always return a string-type, I hope fix the document.