Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

PHP WTFs

Name: Anonymous 2013-03-20 18:58

http://php.net/manual/en/function.shuffle.php
This function shuffles (randomizes the order of the elements in) an array.
Returns TRUE on success or FALSE on failure.


How can a shuffle fail?

Name: Anonymous 2013-03-22 1:06

this is how


$php -r "$a = array(); var_export(shuffle($a));"
true

$php -r "$a = false; var_export(shuffle($a));"
[22-Mar-2013 18:05:10] PHP Warning:  shuffle() expects parameter 1 to be array, boolean given in Command line code on line 1

false

$php -r "$a = 1.337; var_export(shuffle($a));"
[22-Mar-2013 18:05:19] PHP Warning:  shuffle() expects parameter 1 to be array, double given in Command line code on line 1

false

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List