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); $errors = 0; $objects = 0; $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('suppress_and_count'); 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)); // --------------- functions ----------------- // function obj($prop) { global $objects; $objects++; return (object) array('prop' => $prop); } function arr($val) { return array($val); } function tostring($val) { if (is_object($val)) { $val = sprintf('obj(%s)', $val->prop); } if (is_array($val)) { $val = '[' . implode(',', $val) . ']'; } return $val; } function suppress_and_count() { global $errors; $errors++; }

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.0030.01018.55
8.3.50.0150.00521.98
8.3.40.0040.01118.79
8.3.30.0090.00619.09
8.3.20.0000.00720.22
8.3.10.0040.00421.92
8.3.00.0040.00422.38
8.2.180.0080.00816.88
8.2.170.0040.01122.96
8.2.160.0090.00621.01
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0030.00517.75
8.2.110.0060.00322.25
8.2.100.0040.00719.64
8.2.90.0000.00819.34
8.2.80.0050.00319.66
8.2.70.0110.00017.48
8.2.60.0040.00417.91
8.2.50.0030.00618.07
8.2.40.0040.00418.34
8.2.30.0050.00218.13
8.2.20.0040.00417.66
8.2.10.0040.00419.54
8.2.00.0080.00017.86
8.1.280.0140.00725.92
8.1.270.0080.00023.84
8.1.260.0050.00326.35
8.1.250.0030.01328.09
8.1.240.0030.00723.97
8.1.230.0090.00319.04
8.1.220.0000.00817.77
8.1.210.0080.00018.77
8.1.200.0000.00917.35
8.1.190.0040.00417.51
8.1.180.0040.00418.10
8.1.170.0030.00518.45
8.1.160.0020.00521.95
8.1.150.0030.00618.59
8.1.140.0040.00417.48
8.1.130.0000.00717.73
8.1.120.0040.00417.52
8.1.110.0040.00417.49
8.1.100.0070.00017.46
8.1.90.0000.00717.43
8.1.80.0000.00717.45
8.1.70.0000.00717.42
8.1.60.0040.00417.54
8.1.50.0040.00417.59
8.1.40.0030.00517.57
8.1.30.0000.00817.64
8.1.20.0000.00817.75
8.1.10.0040.00417.43
8.1.00.0000.00717.41
8.0.300.0070.00018.77
8.0.290.0070.00017.18
8.0.280.0000.00718.50
8.0.270.0070.00017.25
8.0.260.0040.00416.87
8.0.250.0040.00416.95
8.0.240.0000.00716.96
8.0.230.0000.00717.07
8.0.220.0030.00516.93
8.0.210.0030.00316.89
8.0.200.0070.00017.01
8.0.190.0030.00617.04
8.0.180.0050.00216.90
8.0.170.0040.00417.07
8.0.160.0050.00316.96
8.0.150.0000.00716.91
8.0.140.0080.00016.82
8.0.130.0060.00013.43
8.0.120.0050.00316.83
8.0.110.0000.00817.00
8.0.100.0050.00217.04
8.0.90.0040.00416.86
8.0.80.0170.00316.99
8.0.70.0000.00716.81
8.0.60.0040.00416.93
8.0.50.0000.00817.10
8.0.30.0080.01217.05
8.0.20.0140.00417.40
8.0.10.0030.00517.05
8.0.00.0070.01416.75
7.4.330.0030.00315.00
7.4.320.0040.00416.53
7.4.300.0030.00316.68
7.4.290.0030.00316.63
7.4.280.0040.00416.55
7.4.270.0040.00416.55
7.4.260.0040.00416.47
7.4.250.0040.00416.45
7.4.240.0040.00416.66
7.4.230.0070.00016.63
7.4.220.0060.01316.47
7.4.210.0120.00416.62
7.4.200.0070.00016.63
7.4.190.0000.00716.48
7.4.160.0090.00616.77
7.4.150.0100.00717.40
7.4.140.0140.00817.86
7.4.130.0090.00916.59
7.4.120.0060.01416.66
7.4.110.0100.00716.51
7.4.100.0090.00916.63
7.4.90.0120.00616.61
7.4.80.0140.00316.68
7.4.70.0060.01116.54
7.4.60.0080.00816.45
7.4.50.0030.00316.48
7.4.40.0070.00722.77
7.4.30.0030.01316.51
7.4.00.0060.01014.95
7.3.330.0000.00513.25
7.3.320.0000.00513.28
7.3.310.0030.00316.57
7.3.300.0040.00416.51
7.3.290.0080.00716.51
7.3.280.0060.01116.45
7.3.270.0160.00617.40
7.3.260.0050.01516.39
7.3.250.0130.00816.55
7.3.240.0040.01216.45
7.3.230.0090.01216.45
7.3.210.0180.00616.52
7.3.200.0110.00819.39
7.3.190.0120.00616.54
7.3.180.0100.00716.53
7.3.170.0060.01116.45
7.3.160.0130.01016.59
7.3.120.0050.01214.79
7.3.110.0060.01114.72
7.3.100.0030.01214.87
7.3.90.0070.00214.85
7.3.80.0040.00914.92
7.3.70.0070.00714.91
7.3.60.0080.00414.80
7.3.50.0000.01314.80
7.3.40.0050.01014.91
7.3.30.0070.00714.72
7.3.20.0050.00916.63
7.3.10.0050.00816.62
7.3.00.0040.00916.68
7.2.330.0090.00916.51
7.2.320.0060.01716.68
7.2.310.0070.01416.66
7.2.300.0060.01216.42
7.2.290.0130.00316.75
7.2.250.0070.01115.16
7.2.240.0070.01314.78
7.2.230.0090.00315.09
7.2.220.0050.00615.18
7.2.210.0020.01314.98
7.2.200.0030.00715.06
7.2.190.0030.01214.92
7.2.180.0040.00815.06
7.2.170.0050.01015.10
7.2.130.0020.01416.98
7.2.120.0060.00816.77
7.2.110.0050.00916.88
7.2.100.0040.00917.00
7.2.90.0090.00516.84
7.2.80.0070.00816.90
7.2.70.0020.01416.98
7.2.60.0080.00616.94
7.2.50.0080.00517.00
7.2.40.0060.00716.87
7.2.30.0050.01216.93
7.2.20.0030.00916.91
7.2.10.0120.00716.95
7.2.00.0040.01017.65
7.1.330.0110.00515.74
7.1.320.0050.01015.66
7.1.310.0050.00815.83
7.1.300.0020.01115.89
7.1.290.0030.00815.73
7.1.280.0050.00515.70
7.1.270.0040.00915.60
7.1.260.0080.00215.64
7.1.250.0090.00315.87
7.1.200.0110.00315.61
7.1.100.0040.01118.33
7.1.70.0040.00417.29
7.1.60.0080.00419.82
7.1.50.0090.00616.79
7.1.00.0000.08022.37
7.0.200.0060.00616.85
7.0.140.0000.07722.22
7.0.120.0130.06721.96
7.0.110.0130.08021.94
7.0.100.0070.04322.21
7.0.90.0200.07722.00
7.0.80.0230.04021.83
7.0.70.0170.05021.82
7.0.60.0130.07017.03
7.0.50.0200.04320.37
7.0.40.0070.06720.02
7.0.30.0100.08320.05
7.0.20.0170.07719.92
7.0.10.0230.07720.09
7.0.00.0130.06320.00
5.6.280.0000.07721.09
5.6.270.0100.05321.08
5.6.260.0200.06020.95
5.6.250.0100.03320.60
5.6.240.0170.06720.86
5.6.230.0070.05321.03
5.6.220.0100.04720.77
5.6.210.0200.05720.76
5.6.200.0030.06020.98
5.6.190.0070.04720.71
5.6.180.0070.06721.04
5.6.170.0070.08320.90
5.6.160.0130.06021.00
5.6.150.0100.03720.83
5.6.140.0000.04720.75
5.6.130.0100.04021.00
5.6.120.0100.06720.92
5.6.110.0100.04720.98
5.6.100.0100.05320.98
5.6.90.0130.03721.03
5.6.80.0070.04320.19
5.6.70.0100.05020.41
5.6.60.0130.07020.13
5.6.50.0100.04020.37
5.6.40.0070.06320.07
5.6.30.0030.04720.32
5.6.20.0070.04720.36
5.6.10.0130.05020.07
5.6.00.0070.06720.33
5.5.380.0170.03717.50
5.5.370.0030.05717.70
5.5.360.0100.07317.60
5.5.350.0100.08317.51
5.5.340.0070.07318.04
5.5.330.0100.03318.08
5.5.320.0100.05717.91
5.5.310.0070.06718.09
5.5.300.0030.04717.83
5.5.290.0100.02718.12
5.5.280.0030.05318.10
5.5.270.0070.04017.86
5.5.260.0030.03318.21
5.5.250.0070.05717.91
5.5.240.0030.05317.64
5.5.230.0030.05017.45
5.5.220.0030.04017.48
5.5.210.0070.03717.21
5.5.200.0100.07317.41
5.5.190.0070.07317.44
5.5.180.0070.07717.28
5.5.160.0200.06317.45
5.5.150.0130.06717.47
5.5.140.0030.05717.57
5.5.130.0030.04017.28
5.5.120.0030.10317.30
5.5.110.0100.06317.27
5.5.100.0100.06717.19
5.5.90.0100.07317.32
5.5.80.0130.06017.18
5.5.70.0070.06017.31
5.5.60.0070.06717.34
5.5.50.0000.05017.34
5.5.40.0100.06017.34
5.5.30.0000.04317.33
5.5.20.0030.04017.19
5.5.10.0130.06017.29
5.5.00.0130.06717.16
5.4.450.0030.04719.51
5.4.440.0070.07019.27
5.4.430.0070.03719.52
5.4.420.0070.04019.45
5.4.410.0170.02019.48
5.4.400.0100.05318.95
5.4.390.0070.05719.18
5.4.380.0070.08019.06
5.4.370.0070.05318.96
5.4.360.0030.03719.26
5.4.350.0130.04718.90
5.4.340.0100.06718.92
5.4.320.0100.07718.98
5.4.310.0070.04018.92
5.4.300.0070.05719.13
5.4.290.0030.06718.90
5.4.280.0070.06319.28
5.4.270.0070.06718.95
5.4.260.0100.07718.96
5.4.250.0130.04018.97
5.4.240.0030.06018.98
5.4.230.0070.06718.93
5.4.220.0100.06719.12
5.4.210.0000.08718.94
5.4.200.0030.07319.10
5.4.190.0070.06319.18
5.4.180.0030.04019.17
5.4.170.0070.07318.97
5.4.160.0070.07319.11
5.4.150.0100.06719.16
5.4.140.0170.04016.54
5.4.130.0130.04716.37
5.4.120.0070.03716.43
5.4.110.0170.05716.58
5.4.100.0070.03316.47
5.4.90.0100.04316.36
5.4.80.0070.04716.55
5.4.70.0100.03716.49
5.4.60.0070.03316.39
5.4.50.0030.06016.40
5.4.40.0070.06316.48
5.4.30.0070.03316.35
5.4.20.0070.03716.46
5.4.10.0030.04716.28
5.4.00.0070.03316.02
5.3.290.0130.07714.67
5.3.280.0100.05714.75
5.3.270.0100.05014.62
5.3.260.0130.06314.64
5.3.250.0200.05714.76
5.3.240.0100.05714.63
5.3.230.0030.06714.71
5.3.220.0100.06314.60
5.3.210.0070.06314.45
5.3.200.0000.05714.59
5.3.190.0100.04014.82
5.3.180.0030.05714.63
5.3.170.0030.08314.72
5.3.160.0130.04314.57
5.3.150.0100.03714.71
5.3.140.0100.04714.67
5.3.130.0000.04014.60
5.3.120.0130.06314.58
5.3.110.0000.04014.57
5.3.100.0100.03314.08
5.3.90.0070.03313.91
5.3.80.0000.04014.00
5.3.70.0070.03714.18
5.3.60.0100.03314.02
5.3.50.0070.03714.00
5.3.40.0030.04313.94
5.3.30.0030.05713.93
5.3.20.0030.03713.94
5.3.10.0030.05713.77
5.3.00.0100.03713.75
5.2.170.0100.02311.16
5.2.160.0030.02711.26
5.2.150.0000.03311.25
5.2.140.0030.03011.18
5.2.130.0070.04011.12
5.2.120.0030.02710.98
5.2.110.0000.03011.12
5.2.100.0070.02311.14
5.2.90.0100.02711.12
5.2.80.0030.03011.34
5.2.70.0000.03311.20
5.2.60.0100.02311.20
5.2.50.0000.03310.91
5.2.40.0000.03010.88
5.2.30.0000.03711.22
5.2.20.0030.02711.00
5.2.10.0030.03010.85
5.2.00.0030.02710.76
5.1.60.0030.02310.14
5.1.50.0030.02310.19
5.1.40.0030.02310.14
5.1.30.0000.02710.21
5.1.20.0070.02010.35
5.1.10.0000.03710.14
5.1.00.0000.02710.14
5.0.50.0070.01310.14
5.0.40.0000.02310.14
5.0.30.0030.05010.14
5.0.20.0000.02310.14
5.0.10.0070.01710.14
5.0.00.0000.03310.14
4.4.90.0030.01310.14
4.4.80.0030.01310.14
4.4.70.0000.01710.14
4.4.60.0030.01310.14
4.4.50.0000.03010.14
4.4.40.0030.02310.14
4.4.30.0000.01710.14
4.4.20.0070.01010.14
4.4.10.0000.01710.14
4.4.00.0000.02310.14
4.3.110.0000.01710.14
4.3.100.0070.01010.14
4.3.90.0070.00710.14
4.3.80.0030.02310.14
4.3.70.0030.01310.14
4.3.60.0030.01710.14
4.3.50.0030.01310.14
4.3.40.0030.02310.14
4.3.30.0000.01710.14
4.3.20.0000.01710.14
4.3.10.0000.01710.14
4.3.00.0000.02010.14

preferences:
45.22 ms | 401 KiB | 5 Q