3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrays = array( array( 'resize', 'width' => 2, 'height' => 3), array( 'resize', 'height' => 3, 'width' => 2), array( 'resize', 'scale', 'height' => 3, 'width' => 2), ); foreach($arrays as $array){ uksort($array, function($key1, $key2){ return is_numeric($key1)? is_numeric($key2)? ($key1- $key2): -1: is_numeric($key2)? 1 : strcmp($key1, $key2); }); var_dump($array); //echo serialize($array)."\n"; }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /in/pHS0P on line 11
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /in/pHS0P on line 11
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /in/pHS0P on line 11 array(3) { ["height"]=> int(3) ["width"]=> int(2) [0]=> string(6) "resize" } array(3) { ["height"]=> int(3) ["width"]=> int(2) [0]=> string(6) "resize" } array(4) { [1]=> string(5) "scale" ["height"]=> int(3) ["width"]=> int(2) [0]=> string(6) "resize" }
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
array(3) { ["height"]=> int(3) ["width"]=> int(2) [0]=> string(6) "resize" } array(3) { ["height"]=> int(3) ["width"]=> int(2) [0]=> string(6) "resize" } array(4) { [1]=> string(5) "scale" ["height"]=> int(3) ["width"]=> int(2) [0]=> string(6) "resize" }
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
array(3) { ["height"]=> int(3) [0]=> string(6) "resize" ["width"]=> int(2) } array(3) { [0]=> string(6) "resize" ["height"]=> int(3) ["width"]=> int(2) } array(4) { ["height"]=> int(3) [0]=> string(6) "resize" [1]=> string(5) "scale" ["width"]=> int(2) }

preferences:
310.06 ms | 402 KiB | 381 Q