3v4l.org

run code in 300+ PHP versions simultaneously
<?php // define arrays with the same keys - different key order ('4' and '@' are swapped) $array_at = [ '_' => '', 'Y' => '', '0' => '', '+' => '', 'X' => '', 'W' => '', '1' => '', '3' => '', '@' => '', '4' => '', '5' => '', 'P' => '', 'O' => '', 'N' => '', 'M' => '', 'L' => '', 'K' => '', ]; $array_fr = [ '_' => '', 'Y' => '', '0' => '', '+' => '', 'X' => '', 'W' => '', '1' => '', '3' => '', '4' => '', '@' => '', '5' => '', 'P' => '', 'O' => '', 'N' => '', 'M' => '', 'L' => '', 'K' => '', ]; ksort($array_at, SORT_STRING); // sort by key ksort($array_fr, SORT_STRING); // sort by key // expects the same key at the sorted array first position var_dump(array_slice($array_at, 0, 1)); // result: [0 => '''], but only '0' is defined as a key var_dump(array_slice($array_fr, 0, 1)); // result: ['+' => '' ]

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.70.0160.00316.58
8.3.60.0040.01118.43
8.3.50.0090.00619.57
8.3.40.0140.00018.89
8.3.30.0070.01118.51
8.3.20.0000.00724.18
8.3.10.0050.00324.66
8.3.00.0040.00426.16
8.2.190.0140.00718.16
8.2.180.0120.00325.92
8.2.170.0060.00919.01
8.2.160.0030.01022.96
8.2.150.0040.00425.66
8.2.140.0140.00324.66
8.2.130.0000.00826.16
8.2.120.0080.00026.16
8.2.110.0000.00919.06
8.2.100.0040.00817.91
8.2.90.0080.00017.63
8.2.80.0000.00818.61
8.2.70.0050.00317.38
8.2.60.0000.00717.93
8.2.50.0040.00418.07
8.2.40.0030.00618.22
8.2.30.0000.00718.00
8.2.20.0050.00319.30
8.2.10.0070.00017.49
8.2.00.0000.00819.17
8.1.280.0070.00725.92
8.1.270.0060.00323.99
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0060.00917.35
8.1.230.0090.00319.48
8.1.220.0030.00517.74
8.1.210.0000.00818.77
8.1.200.0060.00317.23
8.1.190.0030.00617.13
8.1.180.0060.00318.10
8.1.170.0040.00418.41
8.1.160.0040.00418.82
8.1.150.0040.00418.56
8.1.140.0040.00417.37
8.1.130.0070.00017.29
8.1.120.0070.00017.43
8.1.110.0040.00417.27
8.1.100.0040.00417.40
8.1.90.0030.00617.42
8.1.80.0030.00517.45
8.1.70.0030.00317.29
8.1.60.0030.00617.41
8.1.50.0000.00817.34
8.1.40.0080.00017.36
8.1.30.0030.00717.45
8.1.20.0060.00317.57
8.1.10.0000.00717.47
8.1.00.0040.00417.35
8.0.300.0070.00018.77
8.0.290.0000.00716.63
8.0.280.0030.00618.37
8.0.270.0040.00417.94
8.0.260.0000.00716.75
8.0.250.0000.00616.78
8.0.240.0070.00016.86
8.0.230.0030.00316.91
8.0.220.0080.00016.83
8.0.210.0040.00416.88
8.0.200.0080.00016.78
8.0.190.0070.00016.86
8.0.180.0000.00716.78
8.0.170.0080.00016.87
8.0.160.0000.00716.84
8.0.150.0000.00716.71
8.0.140.0060.00616.77
8.0.130.0050.00013.29
8.0.120.0060.00313.20
8.0.110.0040.00413.31
8.0.100.0000.00913.20
8.0.90.0060.00313.21
8.0.80.0040.00413.32
8.0.70.0040.00613.15
8.0.60.0090.00013.16
8.0.50.0070.00413.32
8.0.30.0020.00713.28
8.0.20.0060.00313.37
8.0.10.0050.00313.43
8.0.00.0000.00813.39
7.4.330.0000.00515.55
7.4.320.0060.00016.41
7.4.300.0040.00416.47
7.4.290.0030.00616.46
7.4.280.0040.00416.43
7.4.270.0030.00316.46
7.4.260.0030.00313.21
7.4.250.0040.00413.14
7.4.240.0000.00813.23
7.4.230.0040.00413.23
7.4.220.0070.00013.32
7.4.210.0050.00313.32
7.4.200.0050.00213.21
7.4.190.0000.00713.26
7.4.180.0050.00313.21
7.4.160.0030.00513.32
7.4.150.0040.00413.32
7.4.140.0070.00013.21
7.4.130.0000.00813.16
7.4.120.0060.00313.22
7.4.110.0070.00013.00
7.4.100.0030.00613.20
7.4.90.0000.00713.22
7.4.80.0100.00513.02
7.4.70.0000.00713.14
7.4.60.0030.00613.05
7.4.50.0050.00312.98
7.4.40.0000.00913.05
7.4.30.0030.00313.19
7.4.20.0050.00513.09
7.4.10.0090.00013.10
7.4.00.0050.00513.09
7.3.330.0080.00016.10
7.3.320.0040.00313.02
7.3.310.0050.00313.00
7.3.300.0000.00812.96
7.3.290.0100.00013.05
7.3.280.0120.00412.98
7.3.270.0030.00613.00
7.3.260.0050.00713.05
7.3.250.0120.00013.04
7.3.240.0110.00012.91
7.3.230.0040.00212.63
7.3.220.0080.00412.70
7.3.210.0140.00012.60
7.3.200.0140.00012.81
7.3.190.0000.00912.80
7.3.180.0050.00312.88
7.3.170.0020.00711.98
7.3.160.0050.00312.54
7.3.150.0060.00212.86
7.3.140.0070.00012.73
7.3.130.0050.00512.85
7.3.120.0000.00812.32
7.3.110.0000.00712.86
7.3.100.0070.00012.71
7.3.90.0000.00813.15
7.3.80.0040.00412.84
7.3.70.0030.00312.94
7.3.60.0060.00013.04
7.3.50.0000.00512.98
7.3.40.0030.00313.24
7.3.30.0030.00312.97
7.3.20.0000.00614.90
7.3.10.0060.00014.84
7.3.00.0060.00014.75

preferences:
51.19 ms | 401 KiB | 5 Q