3v4l.org

run code in 500+ PHP versions simultaneously
<?php $name = array( "ROWID" => [ 0 => 0, 1 => 1, 2 => 2, ], "First Name" => [ 0 => "BILLY", 1 => "SALLY", 2 => "TYLER", ], "Last Name" => [ 0 => "RAY", 1 => "SUE", 2 => "TERRIER" ], "Middle Name" => [ 0 => "B.", 1 => "S.", 2 => "T.", ], ); $ranking = array( 'ROWID', 'First Name', 'Middle Name', 'Last Name' ); var_dump( $name ); uksort( $name, function ( $a, $b ) use ( $ranking ) { return array_search ( $a, $ranking ) < array_search ( $b, $ranking ) ? -1 : 1; } ); echo "<hr>"; var_dump( $name );
Output for rfc.property-hooks, git.master, git.master_jit
array(4) { ["ROWID"]=> array(3) { [0]=> int(0) [1]=> int(1) [2]=> int(2) } ["First Name"]=> array(3) { [0]=> string(5) "BILLY" [1]=> string(5) "SALLY" [2]=> string(5) "TYLER" } ["Last Name"]=> array(3) { [0]=> string(3) "RAY" [1]=> string(3) "SUE" [2]=> string(7) "TERRIER" } ["Middle Name"]=> array(3) { [0]=> string(2) "B." [1]=> string(2) "S." [2]=> string(2) "T." } } <hr>array(4) { ["ROWID"]=> array(3) { [0]=> int(0) [1]=> int(1) [2]=> int(2) } ["First Name"]=> array(3) { [0]=> string(5) "BILLY" [1]=> string(5) "SALLY" [2]=> string(5) "TYLER" } ["Middle Name"]=> array(3) { [0]=> string(2) "B." [1]=> string(2) "S." [2]=> string(2) "T." } ["Last Name"]=> array(3) { [0]=> string(3) "RAY" [1]=> string(3) "SUE" [2]=> string(7) "TERRIER" } }

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:
59.39 ms | 1692 KiB | 4 Q