3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array ( array ('B.Osweiler',14.88 ), array ('D.Fales', 3.96), array ('B.Radcliff', 6.4 ), array ('K.Ballage', 13.7 ), array ('J.Langford', 2.8 ), array ('B.Howell', 16.8 ) ); print '<pre>'; print "Before Sort". PHP_EOL;; print_r($array); usort($array, function($a, $b) { return $b['1'] - $a['1']; }); print "After Sort". PHP_EOL; print_r($array); ?>
Output for 7.1.0 - 7.1.21, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0
<pre>Before Sort Array ( [0] => Array ( [0] => B.Osweiler [1] => 14.88 ) [1] => Array ( [0] => D.Fales [1] => 3.96 ) [2] => Array ( [0] => B.Radcliff [1] => 6.4 ) [3] => Array ( [0] => K.Ballage [1] => 13.7 ) [4] => Array ( [0] => J.Langford [1] => 2.8 ) [5] => Array ( [0] => B.Howell [1] => 16.8 ) ) After Sort Array ( [0] => Array ( [0] => B.Howell [1] => 16.8 ) [1] => Array ( [0] => B.Osweiler [1] => 14.88 ) [2] => Array ( [0] => K.Ballage [1] => 13.7 ) [3] => Array ( [0] => B.Radcliff [1] => 6.4 ) [4] => Array ( [0] => D.Fales [1] => 3.96 ) [5] => Array ( [0] => J.Langford [1] => 2.8 ) )
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
165.74 ms | 408 KiB | 5 Q