mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00

Squashes commits from PR #1397 commit cd5dcc8c9eb43603d908abcea69c9e18df0f2ed5 Author: SammyK <sammyk@sammykmedia.com> Date: Tue Sep 8 13:53:42 2015 -0500 Add min max samezies commit b719499218a4e84efecd4dc1d4235d16142c9793 Author: SammyK <sammyk@sammykmedia.com> Date: Wed Sep 2 07:00:25 2015 -0500 Make random_bytes() throw Error when $length <= 0 and random_int() throw Error when $min > $max commit 0cca557291c278716ec4b00b32fc2bdc1c1c8848 Author: SammyK <sammyk@sammykmedia.com> Date: Wed Sep 2 06:55:59 2015 -0500 Make random_*() functions throw Error exception when random bytes cannot be obtained commit 998c7f1e209123605b41139e8d9093075ce16bd6 Author: SammyK <sammyk@sammykmedia.com> Date: Wed Sep 2 06:41:20 2015 -0500 Make random_*() functions throw TypeError when zend_parse_parameters fails commit 99d305c18820ff55d82d952777cbcdf1cf0158be Author: SammyK <sammyk@sammykmedia.com> Date: Mon Jul 6 19:50:47 2015 -0500 Make exceptions less specific commit b042dfab290713366741a663a420cf12bf802f39 Author: SammyK <sammyk@sammykmedia.com> Date: Mon Jul 6 17:20:13 2015 -0500 Upgrade warnings to RuntimeExceptions
21 lines
296 B
PHP
21 lines
296 B
PHP
--TEST--
|
|
Test normal operation of random_int()
|
|
--FILE--
|
|
<?php
|
|
//-=-=-=-
|
|
|
|
var_dump(is_int(random_int(10, 100)));
|
|
|
|
$x = random_int(10, 100);
|
|
var_dump($x >= 10 && $x <= 100);
|
|
|
|
var_dump(random_int(-1000, -1) < 0);
|
|
|
|
var_dump(random_int(42,42));
|
|
|
|
?>
|
|
--EXPECT--
|
|
bool(true)
|
|
bool(true)
|
|
bool(true)
|
|
int(42)
|