Skip to content

Conversation

Andreyco
Copy link
Contributor

@Andreyco Andreyco commented Apr 7, 2014

Hi there, I have very simple query

dd($this->borrowings()->count());

Actual output

string(1) "1"

Expected output

int(1)

Happens on 4.1.x, but probably on 4.x versions as well.
Since this, we cannot relly on === comparsion operator, which result into false all the time.
Is this behaviour by design, or just a flaw?

Return number represented as integer instead of string.
@Andreyco Andreyco changed the title Fix count method return value. Fix count method return value. #4.1 Apr 7, 2014
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put a space in between the cast and the function call?

@Andreyco
Copy link
Contributor Author

Andreyco commented Apr 7, 2014

I did.

taylorotwell added a commit that referenced this pull request Apr 7, 2014
Fix `count` method return value. #4.1
@taylorotwell taylorotwell merged commit 618910c into laravel:4.1 Apr 7, 2014
@Andreyco Andreyco deleted the 4.1 branch April 7, 2014 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants