3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [1,2,3]; var_dump( asort($array) ); var_dump( ksort($array) ); var_dump( natcasesort($array) ); var_dump( natsort($array) ); var_dump( uasort($array, function() { return 0; } ) ); var_dump( uksort($array, function() { return 0; } ) ); $notArray = 'Hello, World'; var_dump( asort($notAarray) ); $notArray = 'Hello, World'; var_dump( ksort($notAarray) ); $notArray = 'Hello, World'; var_dump( natcasesort($notAarray) ); $notArray = 'Hello, World'; var_dump( natsort($notAarray) ); $notArray = 'Hello, World'; var_dump( uasort($notAarray, function() { return 0; } ) ); $notArray = 'Hello, World'; var_dump( uksort($notAarray, function() { return 0; } ) );
Output for git.master, git.master_jit, rfc.property-hooks
bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) Fatal error: Uncaught TypeError: asort(): Argument #1 ($array) must be of type array, null given in /in/AXUbm:13 Stack trace: #0 /in/AXUbm(13): asort(NULL) #1 {main} thrown in /in/AXUbm on line 13
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:
142.49 ms | 405 KiB | 5 Q