Commit fed26a90 authored by Jeremy Mikola's avatar Jeremy Mikola

PHPLIB-97: Cast count() results to integers

Older servers may return floats.
parent d41c3f26
...@@ -244,7 +244,7 @@ class Collection ...@@ -244,7 +244,7 @@ class Collection
$doc = current($this->_runCommand($this->dbname, $cmd)->toArray()); $doc = current($this->_runCommand($this->dbname, $cmd)->toArray());
if ($doc["ok"]) { if ($doc["ok"]) {
return $doc["n"]; return (integer) $doc["n"];
} }
throw $this->_generateCommandException($doc); throw $this->_generateCommandException($doc);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment