summaryrefslogtreecommitdiff
path: root/src/tests/harden_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_rand.phpt
Initial import
Diffstat (limited to 'src/tests/harden_rand.phpt')
-rw-r--r--src/tests/harden_rand.phpt24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tests/harden_rand.phpt b/src/tests/harden_rand.phpt
new file mode 100644
index 0000000..391bccc
--- /dev/null
+++ b/src/tests/harden_rand.phpt
@@ -0,0 +1,24 @@
1--TEST--
2Harden 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
9srand(0);
10$a = rand(0,100)."\n";
11$b = rand(0,100)."\n";
12srand(0);
13$c = rand(0,100)."\n";
14$d = rand(0,100)."\n";
15
16rand(100,0)."\n";
17
18if ($a == $c && $b == $d)
19 echo 'fail';
20else
21 echo 'win';
22?>
23--EXPECT--
24win