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.
     _      _           _   _       _  _   
/ \ (_) _ _ | | | |__ | || |
/ _ \ | | | | | | | | | '_ \ | || |_
/ ___ \ | | | |_| | | | | |_) | |__ _|
/_/ \_\ |_| \__,_| |_| |_.__/ |_|
Enter the code depicted in ASCII art style.
Honey Pot that kill bots