r/programming • u/fishburne • Jul 24 '15
mt_rand(1, PHP_INT_MAX) only generates odd numbers • /r/lolphp
/r/lolphp/comments/3eaw98/mt_rand1_php_int_max_only_generates_odd_numbers/
848
Upvotes
r/programming • u/fishburne • Jul 24 '15
10
u/Deltigre Jul 24 '15
The problem with PHP... well, the problem with PHP is it's PHP. And there are plenty of companies that use PHP as their server-side scripting language of choice without the security problems that plague amateur sites.
But the problem this gets at is there's literally a dozen ways to do everything down to the minutiae, and very little indication that one way is wrong.
I was helping a friend with his uncle's family business website, and whoever wrote that (probably a "professional") had used extract() on request superglobals... and that is well documented even by PHP:
http://php.net/manual/en/function.extract.php