We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 00048b9 commit 7fb9203Copy full SHA for 7fb9203
1 file changed
src/Functions/Rand.php
@@ -0,0 +1,20 @@
1
+<?php
2
+
3
+namespace Appel\SqliteFunctions\Functions;
4
5
+use Closure
6
7
+class Rand extends AbstractFunction
8
+{
9
+ /**
10
+ * https://stackoverflow.com/questions/14155603/random-float-number-between-0-and-1-0-php
11
+ *
12
+ * @return \Closure
13
+ */
14
+ public function mysql(): Closure
15
+ {
16
+ return function ($seed) {
17
+ return mt_rand() / mt_getrandmax();
18
+ };
19
+ }
20
+}
0 commit comments