3v4l.org

run code in 300+ PHP versions simultaneously
<?php $acceleration = array(); $acceleration[0]= array("name"=>"60 to 90 in 6", "timing"=>4.7 ); $acceleration[1]= array("name"=>"40 to 120 in KD", "timing"=>3.3 ); $acceleration[2]= array("name"=>"60 to 100 in 4", "timing"=>1.5 ); $acceleration[3]= array("name"=>"60 to 90 in 4", "timing"=>2.4 ); $acceleration[4]= array("name"=>"140 to 160 in 6", "timing"=>2.4 ); $acceleration[5]= array("name"=>"60 to 90 in KD", "timing"=>5.7 ); function comp_maker( $key ) { return function ($a, $b) use ( $key ) { // closure for uasort to invoke return strnatcmp( $a[$key], $b[$key] ); // comp by "natural order" }; } uasort($acceleration, comp_maker( 'name' ) ); $str = ''; foreach ( $acceleration as $key => $value ){ $str .= ", $key"; } echo substr($str,1);
Output for git.master, git.master_jit, rfc.property-hooks
1, 3, 0, 5, 2, 4

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
79.3 ms | 401 KiB | 8 Q