Skip to content

Commit fed26a9

Browse files
committed
PHPLIB-97: Cast count() results to integers
Older servers may return floats.
1 parent d41c3f2 commit fed26a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public function count(array $filter = array(), array $options = array())
244244

245245
$doc = current($this->_runCommand($this->dbname, $cmd)->toArray());
246246
if ($doc["ok"]) {
247-
return $doc["n"];
247+
return (integer) $doc["n"];
248248
}
249249
throw $this->_generateCommandException($doc);
250250
}

0 commit comments

Comments
 (0)