PHP implementation of Bogosort

Bogosort, very inefficient sorting system, now it's in PHP, even more inefficient than ever.

function bogosort($array){
	$sorted = $array;
	sort($sorted);
	while($sorted !== $array){
		shuffle($array);
	}
        return $array;
}

Comments

Anonymous's picture

[...] PHP implementation of

[...] PHP implementation of Bogosort [...]

Post new comment

  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <span> <fn>
  • Lines and paragraphs break automatically.
  • Use [fn]...[/fn] (or <fn>...</fn>) to insert automatically numbered footnotes.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo].
  • Mathematical equations and graphs can be added between [tex] and [/tex], [graph] and [/graph] tags.
  • Textual smileys will be replaced with graphical ones.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
  _    __                        ____   ____  
/ | / /_ __ __ ___ / ___| | ___|
| | | '_ \ \ \ /\ / / / __| | | _ |___ \
| | | (_) | \ V V / | (__ | |_| | ___) |
|_| \___/ \_/\_/ \___| \____| |____/
Enter the code depicted in ASCII art style.
Honey Pot that kill bots