1--TEST--
2Test mt_rand() output
3--FILE--
4<?php
5
6mt_srand(12345678);
7
8for ($i=0; $i<16; $i++) {
9    echo mt_rand().PHP_EOL;
10}
11echo PHP_EOL;
12
13$x = 0;
14for ($i=0; $i<1024; $i++) {
15    $x ^= mt_rand();
16}
17echo $x.PHP_EOL;
18
19/*
20 * Note that the output will be different from the original mt19937ar.c,
21 * because PHP's implementation contains a bug. Thus, this test actually
22 * checks to make sure that PHP's behaviour is wrong, but consistently so.
23 */
24
25?>
26--EXPECTF--
271614640687
281711027313
29857485497
30688176834
311386682158
32412773096
33813703253
34898651287
352087374214
361382556330
371640700129
381863374167
391324097651
401923803667
41676334965
42853386222
43
441571178311
45