We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb8e4e6 commit b551ff4Copy full SHA for b551ff4
src/Entity.php
@@ -34,18 +34,18 @@ class Entity
34
*
35
* @param $tag
36
* @param $data
37
- * @param int $time unixtime
+ * @param int|float $time unixtime with microseconds
38
*/
39
public function __construct($tag, $data, $time = null)
40
{
41
- if (is_long($time)) {
+ if (is_long($time) || is_float($time)) {
42
$this->time = $time;
43
} else {
44
if (!is_null($time)) {
45
error_log("Entity::__construct(): unexpected time format `{$time}` specified.");
46
}
47
48
- $this->time = time();
+ $this->time = microtime(true);
49
50
51
$this->tag = $tag;
@@ -81,4 +81,4 @@ public function getTime()
81
82
return $this->time;
83
84
-}
+}
0 commit comments