3v4l.org

run code in 300+ PHP versions simultaneously
<?php $alternatives = array( 'foo' => 0, 'foo1' => 0, 'foo3' => 0, ); asort($alternatives, SORT_STRING); print_r($alternatives); $keys = array_keys($alternatives); print_r($keys); sort($keys); print_r($keys); sort($keys, SORT_STRING); print_r($keys); sort($keys, SORT_NAT); print_r($keys);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [foo] => 0 [foo1] => 0 [foo3] => 0 ) Array ( [0] => foo [1] => foo1 [2] => foo3 ) Array ( [0] => foo [1] => foo1 [2] => foo3 ) Array ( [0] => foo [1] => foo1 [2] => foo3 ) Fatal error: Uncaught Error: Undefined constant "SORT_NAT" in /in/mjj8q:21 Stack trace: #0 {main} thrown in /in/mjj8q on line 21
Process exited with code 255.

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:
57.32 ms | 401 KiB | 8 Q