3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * sort() triggers type-conversion notice * @link https://bugs.php.net/bug.php?id=64580 */ error_reporting(~0); function obj($prop) { // return array($prop); global $objects; isset($objects) || $objects = 0; $objects++; return (object) array('prop' => $prop); } function tostring($val) { if (is_object($val)) { $val = sprintf('obj(%s)', $val->prop); } if (is_array($val)) { $val = '[' . implode(',', $val) . ']'; } return $val; } function myhandler() { global $errors; isset($errors) || $errors = 0; $errors++; } $subject = array(3, 3, 2, 3, 3, 2, 2, 3, 3, 1, 1, obj(1), 1, obj(1.2), 2, obj(2), 2, 2, 2, 2, obj(2.1), 1, 0, 0); set_error_handler('myhandler'); sort($subject); restore_error_handler(); printf("sort caused %d error(s) in an array of %d member(s) of which %d are object(s).\n", $errors, count($subject), $objects); echo 'sort()-result: ', implode(', ', array_map('tostring', $subject));

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.60.0100.01016.63
8.3.50.0140.01122.16
8.3.40.0000.01518.96
8.3.30.0040.01119.04
8.3.20.0040.00420.38
8.3.10.0080.00023.66
8.3.00.0000.00820.82
8.2.180.0120.00318.54
8.2.170.0070.01122.96
8.2.160.0070.00721.95
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0080.00022.26
8.2.110.0050.00522.32
8.2.100.0090.00317.97
8.2.90.0040.00419.35
8.2.80.0080.00018.03
8.2.70.0000.00917.50
8.2.60.0040.00417.93
8.2.50.0100.00018.07
8.2.40.0040.00418.22
8.2.30.0040.00418.06
8.2.20.0040.00417.75
8.2.10.0040.00417.70
8.2.00.0050.00317.77
8.1.280.0100.00725.92
8.1.270.0040.00422.18
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0030.00723.88
8.1.230.0070.00419.06
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0030.00617.48
8.1.190.0000.00817.41
8.1.180.0000.00818.10
8.1.170.0060.00318.45
8.1.160.0000.00722.11
8.1.150.0000.00718.66
8.1.140.0040.00417.48
8.1.130.0030.00317.77
8.1.120.0000.00717.50
8.1.110.0000.00817.50
8.1.100.0000.00717.45
8.1.90.0070.00017.46
8.1.80.0000.00817.48
8.1.70.0030.00317.46
8.1.60.0090.00017.59
8.1.50.0040.00417.55
8.1.40.0030.00517.59
8.1.30.0000.00917.68
8.1.20.0060.00317.69
8.1.10.0080.00317.55
8.1.00.0070.00017.55
8.0.300.0050.00318.77
8.0.290.0040.00417.18
8.0.280.0070.00018.54
8.0.270.0070.00317.25
8.0.260.0080.00016.91
8.0.250.0070.00016.95
8.0.240.0000.00716.94
8.0.230.0000.00717.00
8.0.220.0070.00017.00
8.0.210.0000.00716.94
8.0.200.0030.00316.93
8.0.190.0030.00516.93
8.0.180.0000.00717.09
8.0.170.0040.00416.98
8.0.160.0040.00416.93
8.0.150.0000.00816.78
8.0.140.0000.00916.94
8.0.130.0050.00013.39
8.0.120.0040.00417.00
8.0.110.0000.00816.94
8.0.100.0000.00716.90
8.0.90.0030.00516.99
8.0.80.0060.00817.00
8.0.70.0000.00716.90
8.0.60.0040.00416.87
8.0.50.0080.00017.09
8.0.30.0070.01217.18
8.0.20.0100.01017.40
8.0.10.0050.00217.00
8.0.00.0050.01316.74
7.4.330.0050.00015.12
7.4.320.0000.00716.61
7.4.300.0000.00616.59
7.4.290.0000.00716.66
7.4.280.0040.00416.42
7.4.270.0000.00616.54
7.4.260.0000.00716.54
7.4.250.0040.00416.42
7.4.240.0020.00516.50
7.4.230.0070.00016.66
7.4.220.0070.01016.64
7.4.210.0070.01016.64
7.4.200.0000.00716.43
7.4.190.0050.00316.59
7.4.160.0110.00716.56
7.4.150.0130.00517.40
7.4.140.0100.00717.86
7.4.130.0070.00916.63
7.4.120.0110.00816.52
7.4.110.0130.01016.58
7.4.100.0120.00616.61
7.4.90.0080.00916.52
7.4.80.0030.01616.55
7.4.70.0130.00716.47
7.4.60.0110.00616.62
7.4.50.0040.00416.42
7.4.40.0110.00722.77
7.4.30.0070.01016.55
7.4.10.0040.01515.04
7.4.00.0070.00914.99
7.3.330.0050.00013.51
7.3.320.0000.00513.46
7.3.310.0000.00716.44
7.3.300.0040.00416.38
7.3.290.0080.00516.46
7.3.280.0070.00916.45
7.3.270.0030.01417.40
7.3.260.0100.00716.50
7.3.250.0100.00716.52
7.3.240.0160.00616.44
7.3.230.0130.00316.63
7.3.210.0070.01116.54
7.3.200.0130.00819.39
7.3.190.0060.01316.54
7.3.180.0060.01016.59
7.3.170.0100.01116.52
7.3.160.0030.01616.46
7.3.130.0140.00414.83
7.3.120.0050.01215.09
7.3.110.0070.01014.90
7.3.100.0060.00614.70
7.3.90.0070.01115.11
7.3.80.0140.00015.08
7.3.70.0030.01414.63
7.3.60.0000.01515.06
7.3.50.0070.00414.57
7.3.40.0060.00614.77
7.3.30.0060.01214.91
7.3.20.0170.00016.59
7.3.10.0040.01116.79
7.3.00.0120.00316.68
7.2.330.0060.01316.78
7.2.320.0110.00516.81
7.2.310.0060.01716.73
7.2.300.0100.00616.70
7.2.290.0100.00716.80
7.2.260.0130.00715.30
7.2.250.0060.01015.35
7.2.240.0040.01115.14
7.2.230.0110.00414.83
7.2.220.0160.00015.36
7.2.210.0050.00514.98
7.2.200.0030.00915.27
7.2.190.0000.01415.24
7.2.180.0100.00314.98
7.2.170.0100.00615.30
7.2.160.0090.00615.15
7.2.150.0000.01316.94
7.2.140.0060.00317.00
7.2.130.0100.00316.79
7.2.120.0060.00716.76
7.2.110.0060.00716.89
7.2.100.0050.00816.85
7.2.90.0110.00516.90
7.2.80.0030.01116.87
7.2.70.0060.00816.97
7.2.60.0110.00716.86
7.2.50.0090.00716.94
7.2.40.0050.00916.94
7.2.30.0090.00716.82
7.2.20.0050.00817.08
7.2.10.0040.00916.92
7.2.00.0080.00817.62
7.1.330.0100.00315.99
7.1.320.0100.00716.07
7.1.310.0120.00415.88
7.1.300.0080.00415.91
7.1.290.0030.00515.84
7.1.280.0070.01015.84
7.1.270.0090.00915.67
7.1.260.0030.01015.86
7.1.250.0060.00715.69
7.1.240.0070.00515.80
7.1.230.0080.00415.57
7.1.220.0060.00815.81
7.1.210.0050.01015.56
7.1.200.0050.00615.89
7.1.190.0110.00515.71
7.1.180.0080.00615.58
7.1.170.0080.00915.73
7.1.160.0090.00515.71
7.1.150.0080.00615.78
7.1.140.0080.00615.74
7.1.130.0050.01015.87
7.1.120.0050.00715.68
7.1.110.0100.00515.66
7.1.100.0040.00816.46
7.1.90.0070.00715.50
7.1.80.0060.00715.76
7.1.70.0050.00416.16
7.1.60.0080.00916.85
7.1.50.0060.01016.13
7.1.40.0080.00715.75
7.1.30.0080.00515.75
7.1.20.0070.00515.76
7.1.10.0050.00815.67
7.1.00.0050.03117.89
7.0.330.0140.00115.28
7.0.320.0070.00815.29
7.0.310.0050.01015.19
7.0.300.0080.01015.28
7.0.290.0060.01115.20
7.0.280.0070.00515.39
7.0.270.0060.00915.46
7.0.260.0070.00515.39
7.0.250.0100.00415.42
7.0.240.0040.00915.27
7.0.230.0030.01115.40
7.0.220.0070.00715.43
7.0.210.0100.00515.26
7.0.200.0050.00715.69
7.0.190.0010.01015.25
7.0.180.0060.00615.26
7.0.170.0080.00315.07
7.0.160.0040.00915.20
7.0.150.0090.00315.42
7.0.140.0050.02817.68
7.0.130.0060.00915.17
7.0.120.0080.00615.38
7.0.110.0060.00615.37
7.0.100.0050.02116.79
7.0.90.0070.03116.90
7.0.80.0080.03116.92
7.0.70.0040.03416.75
7.0.60.0080.03016.88
7.0.50.0050.03217.06
7.0.40.0040.02215.62
7.0.30.0050.03415.47
7.0.20.0060.03115.51
7.0.10.0080.02915.62
7.0.00.0030.03215.59
5.6.400.0040.00814.24
5.6.390.0070.00714.35
5.6.380.0070.00514.41
5.6.370.0060.00614.45
5.6.360.0030.00914.32
5.6.350.0100.00414.33
5.6.340.0060.00514.29
5.6.330.0090.00514.42
5.6.320.0020.01214.32
5.6.310.0070.00514.18
5.6.300.0070.00514.39
5.6.290.0080.00414.24
5.6.280.0080.02716.52
5.6.270.0040.00814.29
5.6.260.0050.01014.25
5.6.250.0090.02916.31
5.6.240.0060.01916.46
5.6.230.0060.01916.51
5.6.220.0060.03116.35
5.6.210.0050.02416.39
5.6.200.0100.03216.55
5.6.190.0060.03516.46
5.6.180.0080.03016.57
5.6.170.0060.03116.51
5.6.160.0080.02316.58
5.6.150.0060.03316.50
5.6.140.0050.03216.62
5.6.130.0080.03416.40
5.6.120.0050.03316.52
5.6.110.0070.03116.49
5.6.100.0110.02816.50
5.6.90.0100.03316.57
5.6.80.0060.02916.22
5.6.70.0010.03416.25
5.6.60.0040.03316.27
5.6.50.0040.02416.14
5.6.40.0060.02716.30
5.6.30.0120.01716.28
5.6.20.0100.02816.18
5.6.10.0060.02516.36
5.6.00.0020.02716.25
5.5.380.0050.03215.24
5.5.370.0050.02115.17
5.5.360.0050.02715.31
5.5.350.0080.02815.26
5.5.340.0070.02915.49
5.5.330.0090.02915.54
5.5.320.0060.03215.43
5.5.310.0070.03015.45
5.5.300.0060.03415.43
5.5.290.0070.02715.46
5.5.280.0080.02815.44
5.5.270.0040.02315.34
5.5.260.0070.02015.49
5.5.250.0060.02015.27
5.5.240.0030.03014.99
5.5.230.0030.03115.03
5.5.220.0050.02815.19
5.5.210.0050.03215.06
5.5.200.0040.01715.02
5.5.190.0050.03015.09
5.5.180.0030.02215.06
5.5.170.0050.01012.61
5.5.160.0070.02515.08
5.5.150.0050.01715.00
5.5.140.0030.01715.12
5.5.130.0080.02615.11
5.5.120.0040.01815.10
5.5.110.0090.02514.94
5.5.100.0070.02315.08
5.5.90.0030.02315.16
5.5.80.0060.01515.12
5.5.70.0080.01615.00
5.5.60.0030.01915.05
5.5.50.0070.02215.20
5.5.40.0050.01915.10
5.5.30.0080.01515.08
5.5.20.0020.01915.04
5.5.10.0070.02115.03
5.5.00.0040.01815.11
5.4.450.0080.02713.77
5.4.440.0070.02513.75
5.4.430.0030.02413.75
5.4.420.0050.03213.79
5.4.410.0060.03013.77
5.4.400.0040.03113.63
5.4.390.0050.02913.49
5.4.380.0100.02613.75
5.4.370.0040.03013.74
5.4.360.0060.01913.78
5.4.350.0070.02813.75
5.4.340.0060.01813.61
5.4.330.0080.00310.99
5.4.320.0060.02313.85
5.4.310.0070.02813.79
5.4.300.0070.01613.64
5.4.290.0050.03013.69
5.4.280.0060.02913.66
5.4.270.0080.02913.70
5.4.260.0100.01013.54
5.4.250.0060.01713.63
5.4.240.0080.01413.78
5.4.230.0070.01413.68
5.4.220.0060.01713.63
5.4.210.0040.01813.73
5.4.200.0040.01913.63
5.4.190.0070.01613.68
5.4.180.0040.01713.69
5.4.170.0070.01613.81
5.4.160.0050.01713.72
5.4.150.0050.01913.75
5.4.140.0090.01612.83
5.4.130.0080.01512.70
5.4.120.0070.01412.85
5.4.110.0060.01712.99
5.4.100.0050.02612.96
5.4.90.0080.02212.74
5.4.80.0070.03012.81
5.4.70.0030.02112.78
5.4.60.0060.01712.90
5.4.50.0050.01712.78
5.4.40.0060.01712.86
5.4.30.0060.01712.70
5.4.20.0070.01512.78
5.4.10.0080.01512.84
5.4.00.0040.02912.74
5.3.290.0080.02912.09
5.3.280.0060.02212.00
5.3.270.0060.01512.11
5.3.260.0050.02611.99
5.3.250.0040.02312.13
5.3.240.0070.02811.94
5.3.230.0060.01512.02
5.3.220.0040.01811.99
5.3.210.0080.01611.97
5.3.200.0080.02211.90
5.3.190.0080.02012.01
5.3.180.0090.02011.95
5.3.170.0070.02112.03
5.3.160.0020.02111.97
5.3.150.0150.01012.10
5.3.140.0060.01612.05
5.3.130.0040.02712.02
5.3.120.0050.01612.02
5.3.110.0090.01512.06
5.3.100.0070.01811.82
5.3.90.0030.02011.83
5.3.80.0080.02511.72
5.3.70.0050.01711.79
5.3.60.0090.01411.91
5.3.50.0070.01411.77
5.3.40.0060.02811.79
5.3.30.0050.02211.80
5.3.20.0050.01611.73
5.3.10.0080.01411.67
5.3.00.0040.01711.63
5.2.170.0040.02511.04
5.2.160.0020.02311.09
5.2.150.0070.01410.97
5.2.140.0060.01711.10
5.2.130.0080.01610.94
5.2.120.0040.01911.02
5.2.110.0060.01611.05
5.2.100.0050.02711.04
5.2.90.0050.01711.04
5.2.80.0060.02011.03
5.2.70.0030.02411.00
5.2.60.0070.01511.05
5.2.50.0040.01711.00
5.2.40.0080.03010.95
5.2.30.0070.03510.90
5.2.20.0020.02810.96
5.2.10.0040.03610.96
5.2.00.0080.03210.83
5.1.60.0070.02610.52
5.1.50.0040.03110.50
5.1.40.0070.03010.45
5.1.30.0060.03010.68
5.1.20.0060.03010.65
5.1.10.0030.02810.40
5.1.00.0100.02810.52
5.0.50.0040.0259.65
5.0.40.0060.0189.60
5.0.30.0010.0319.56
5.0.20.0040.0259.59
5.0.10.0080.0209.58
5.0.00.0040.0249.60
4.4.90.0020.0179.33
4.4.80.0020.0109.33
4.4.70.0020.0199.33
4.4.60.0040.0179.33
4.4.50.0050.0189.33
4.4.40.0030.0169.33
4.4.30.0020.0139.33
4.4.20.0070.0179.33
4.4.10.0040.0209.33
4.4.00.0020.0329.33
4.3.110.0020.0149.33
4.3.100.0030.0179.33
4.3.90.0020.0209.33
4.3.80.0050.0299.33
4.3.70.0040.0159.33
4.3.60.0000.0259.33
4.3.50.0040.0199.33
4.3.40.0050.0239.33
4.3.30.0000.0229.33
4.3.20.0030.0219.33
4.3.10.0000.0189.33
4.3.00.0010.0219.33

preferences:
41.32 ms | 401 KiB | 5 Q