Skip to content

Commit 2e68ee7

Browse files
Sander Boljaviereguiluz
Sander Bol
authored andcommitted
Transition from mt_rand to random_int
1 parent 2b3d22b commit 2e68ee7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

controller.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class::
6868
*/
6969
public function numberAction($max)
7070
{
71-
$number = mt_rand(0, $max);
71+
$number = random_int(0, $max);
7272

7373
return new Response(
7474
'<html><body>Lucky number: '.$number.'</body></html>'

page_creation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ random) number and prints it. To do that, create a "Controller class" and a
5353
*/
5454
public function numberAction()
5555
{
56-
$number = mt_rand(0, 100);
56+
$number = random_int(0, 100);
5757

5858
return new Response(
5959
'<html><body>Lucky number: '.$number.'</body></html>'
@@ -123,7 +123,7 @@ variable so we can render that::
123123
*/
124124
public function numberAction()
125125
{
126-
$number = mt_rand(0, 100);
126+
$number = random_int(0, 100);
127127

128128
return $this->render('lucky/number.html.twig', array(
129129
'number' => $number,

0 commit comments

Comments
 (0)