Skip to content

Commit 7fb9203

Browse files
authored
add RAND
1 parent 00048b9 commit 7fb9203

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/Functions/Rand.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)