3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function cmp($a, $b) { $v = floatval($a) - floatval($b); return ($v == 0) ? 0 : (($v < 0) ? -1 : 1); } $kasa1[0]="5:franek"; $kasa1[1]="54:franek1"; $kasa1[2]="25:franek2"; $kasa1[3]="42:franek3"; $kasa1[4]="65:franek4"; uasort($kasa1, 'cmp'); foreach ($kasa1 as $i) { echo $i.' '; } ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
5:franek 25:franek2 42:franek3 54:franek1 65:franek4