Skip to content

Commit

Permalink
when countable is not implemented, it is probably better to return 0
Browse files Browse the repository at this point in the history
  • Loading branch information
EmielBruijntjes authored Jul 8, 2022
1 parent 3709bac commit 6d0ee21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zend/base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ Php::Value Base::__count(Php::Parameters &params)
auto *countable = dynamic_cast<Countable*>(this);

// this one should not fail
if (countable == nullptr) return -1;
if (countable == nullptr) return 0;

// pass the call to the interface
return countable->count();
Expand Down

0 comments on commit 6d0ee21

Please sign in to comment.