fork download
  1. <?php
  2. $y= bubbleSort(array(5,4,6,3,2,5,1);
  3. echo $y;
  4. function bubbleSort($numbers){
  5. $x=count($numbers);
  6. $temp=0;
  7. for($i=1;$i<$x;$i++){
  8. if($numbers[$i]<$numbers[$temp]){
  9. $temp1=$numbers[$i];
  10. for($j=$i-1;$j>-1;$j--){
  11. if($numbers[$j]>$temp1){
  12. $numbers[$j+1]=$numbers[$j];
  13. }
  14. else{
  15. $numbers[j]=$temp1;
  16. }
  17. }
  18. }
  19. }
  20. }
  21. ?>
Runtime error #stdin #stdout 0.02s 13664KB
stdin
Standard input is empty
stdout
Parse error: syntax error, unexpected ';' in /home/n5GexI/prog.php on line 2