summaryrefslogtreecommitdiff
path: root/src/tests/harden_mt_rand.phpt
diff options
context:
space:
mode:
authorSebastien Blot2017-09-20 10:11:01 +0200
committerSebastien Blot2017-09-20 10:11:01 +0200
commit868f96c759b6650d88ff9f4fbc5c048302134248 (patch)
treec0de0af318bf77a8959164ef11aeeeb2b7bab294 /src/tests/harden_mt_rand.phpt
Initial import
Diffstat (limited to 'src/tests/harden_mt_rand.phpt')
-rw-r--r--src/tests/harden_mt_rand.phpt22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/tests/harden_mt_rand.phpt b/src/tests/harden_mt_rand.phpt
new file mode 100644
index 0000000..8887613
--- /dev/null
+++ b/src/tests/harden_mt_rand.phpt
@@ -0,0 +1,22 @@
1--TEST--
2Harden mt_rand
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
5--INI--
6sp.configuration_file={PWD}/config/harden_rand.ini
7--FILE--
8<?php
9mt_srand(0);
10$a = mt_rand(0,100)."\n";
11$b = mt_rand(0,100)."\n";
12mt_srand(0);
13$c = mt_rand(0,100)."\n";
14$d = mt_rand(0,100)."\n";
15
16if ($a == $c && $b == $d)
17 echo 'lose';
18else
19 echo 'win';
20?>
21--EXPECT--
22win