3v4l.org

run code in 300+ PHP versions simultaneously
<?php $abc = array( 'a' => array('Aron','M'), 'b' => array('Abbey','D'), 'c' => array('Alice','P')); function cmp($a, $b) { array_pop($a); array_pop($b); $res = strcmp($a,$b); if ( $res == 0) { return 0; } return ($res < 0) ? -1 : 1; } usort($abc, "cmp"); foreach ($a as $key => $value) { echo "$key: $value\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: strcmp(): Argument #1 ($string1) must be of type string, array given in /in/m8hqK:11 Stack trace: #0 /in/m8hqK(11): strcmp(Array, Array) #1 [internal function]: cmp(Array, Array) #2 /in/m8hqK(17): usort(Array, 'cmp') #3 {main} thrown in /in/m8hqK on line 11
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:
36.26 ms | 401 KiB | 8 Q