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++; return FALSE; } $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.0150.00018.68
8.3.50.0120.00522.17
8.3.40.0040.01418.96
8.3.30.0140.00019.02
8.3.20.0050.00318.85
8.3.10.0050.00321.09
8.3.00.0040.00423.61
8.2.180.0090.00618.43
8.2.170.0070.01122.96
8.2.160.0130.00020.44
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0110.00719.91
8.2.110.0070.00420.52
8.2.100.0080.00417.84
8.2.90.0050.00319.35
8.2.80.0080.00017.97
8.2.70.0060.00317.63
8.2.60.0040.00717.91
8.2.50.0040.00418.07
8.2.40.0000.00818.34
8.2.30.0080.00019.79
8.2.20.0040.00417.66
8.2.10.0030.00517.65
8.2.00.0040.00417.81
8.1.280.0070.01125.92
8.1.270.0000.00723.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.00322.59
8.1.230.0070.00420.92
8.1.220.0030.00618.77
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0080.00017.65
8.1.180.0040.00418.10
8.1.170.0060.00318.57
8.1.160.0040.00418.90
8.1.150.0030.00618.68
8.1.140.0000.00717.48
8.1.130.0030.00317.81
8.1.120.0000.00717.53
8.1.110.0030.00517.36
8.1.100.0030.00517.48
8.1.90.0050.00217.52
8.1.80.0030.00517.54
8.1.70.0030.00317.43
8.1.60.0040.00417.51
8.1.50.0040.00417.48
8.1.40.0030.00617.50
8.1.30.0000.00817.73
8.1.20.0040.00417.70
8.1.10.0040.00417.58
8.1.00.0040.00417.56
8.0.300.0000.00720.03
8.0.290.0040.00416.93
8.0.280.0000.00718.48
8.0.270.0000.00717.22
8.0.260.0060.00016.90
8.0.250.0040.00417.10
8.0.240.0040.00416.96
8.0.230.0030.00317.04
8.0.220.0030.00317.00
8.0.210.0040.00416.98
8.0.200.0030.00316.93
8.0.190.0030.00517.11
8.0.180.0030.00616.98
8.0.170.0070.00016.96
8.0.160.0000.00816.88
8.0.150.0000.00816.88
8.0.140.0000.00816.96
8.0.130.0030.00613.43
8.0.120.0020.00516.83
8.0.110.0000.00816.80
8.0.100.0080.00016.85
8.0.90.0040.00416.93
8.0.80.0070.01016.98
8.0.70.0040.00416.94
8.0.60.0000.00817.00
8.0.50.0040.00416.80
8.0.30.0140.00717.26
8.0.20.0140.00617.40
8.0.10.0030.00516.94
8.0.00.0060.01316.84
7.4.330.0070.00013.43
7.4.320.0000.00616.57
7.4.300.0000.00716.49
7.4.290.0060.00316.64
7.4.280.0070.00416.64
7.4.270.0040.00416.53
7.4.260.0000.00513.33
7.4.250.0080.00016.59
7.4.240.0070.00016.44
7.4.230.0070.00016.54
7.4.220.0030.01316.50
7.4.210.0070.01016.57
7.4.200.0000.00716.66
7.4.190.0000.00716.77
7.4.160.0060.01116.61
7.4.150.0140.00417.40
7.4.140.0110.00717.86
7.4.130.0090.00816.61
7.4.120.0130.00616.47
7.4.110.0090.00916.69
7.4.100.0060.01216.49
7.4.90.0070.01016.71
7.4.80.0130.00319.37
7.4.70.0130.00516.58
7.4.60.0060.01216.58
7.4.50.0050.00016.46
7.4.40.0100.00222.27
7.4.30.0060.01216.64
7.4.00.0090.00814.85
7.3.330.0000.00513.47
7.3.320.0000.00513.27
7.3.310.0070.00016.53
7.3.300.0030.00316.42
7.3.290.0070.00716.53
7.3.280.0070.01216.47
7.3.270.0070.01117.40
7.3.260.0110.00718.24
7.3.250.0110.00516.47
7.3.240.0070.01516.66
7.3.230.0090.00916.74
7.3.210.0160.00316.55
7.3.200.0140.00719.39
7.3.190.0130.00316.49
7.3.180.0060.01316.52
7.3.170.0160.00616.46
7.3.160.0120.00316.58
7.3.120.0020.01114.95
7.3.110.0070.01015.03
7.3.100.0030.01214.85
7.3.90.0060.00614.80
7.3.80.0120.00314.84
7.3.70.0000.01014.59
7.3.60.0090.00914.95
7.3.50.0040.01014.93
7.3.40.0090.00314.95
7.3.30.0080.00414.91
7.3.20.0030.01016.73
7.3.10.0030.01016.56
7.3.00.0040.00416.75
7.2.330.0090.00916.81
7.2.320.0130.00316.78
7.2.310.0120.01216.71
7.2.300.0100.01016.70
7.2.290.0130.00416.74
7.2.250.0030.01314.89
7.2.240.0060.01215.11
7.2.230.0040.00815.07
7.2.220.0110.00714.97
7.2.210.0070.01014.92
7.2.200.0030.00615.25
7.2.190.0030.01115.24
7.2.180.0060.00615.00
7.2.170.0100.00014.93
7.2.160.0030.01415.30
7.2.150.0040.01117.07
7.2.140.0060.01316.92
7.2.130.0090.00616.78
7.2.120.0070.00616.72
7.2.110.0060.00317.00
7.2.100.0030.01216.73
7.2.90.0110.00417.21
7.2.80.0100.01016.96
7.2.70.0030.01216.86
7.2.60.0020.01416.73
7.2.50.0070.00316.98
7.2.40.0100.00717.07
7.2.30.0060.00916.79
7.2.20.0000.01116.98
7.2.10.0070.00316.80
7.2.00.0070.00717.07
7.1.330.0070.01015.78
7.1.320.0030.01415.51
7.1.310.0060.00315.94
7.1.300.0040.01216.02
7.1.290.0000.01215.77
7.1.280.0030.01015.61
7.1.270.0060.00915.56
7.1.260.0060.00615.77
7.1.250.0100.00315.83
7.1.240.0060.00615.79
7.1.230.0000.01315.54
7.1.220.0040.00415.82
7.1.210.0070.00715.83
7.1.200.0070.00515.62
7.1.190.0050.00515.81
7.1.180.0040.00815.94
7.1.170.0080.00815.91
7.1.160.0090.00015.79
7.1.150.0070.01015.79
7.1.140.0030.01015.75
7.1.130.0070.01015.64
7.1.120.0040.01115.90
7.1.110.0050.00815.76
7.1.100.0000.01015.85
7.1.90.0100.00715.92
7.1.80.0090.00615.93
7.1.70.0040.00416.67
7.1.60.0080.01117.62
7.1.50.0090.00916.51
7.1.40.0100.00715.91
7.1.30.0070.00715.87
7.1.20.0030.00915.59
7.1.10.0110.00015.93
7.1.00.0050.02019.12
7.0.330.0070.00715.08
7.0.320.0000.01415.16
7.0.310.0070.00715.34
7.0.300.0040.01115.58
7.0.290.0000.01115.53
7.0.280.0070.00715.43
7.0.270.0000.01215.31
7.0.260.0080.00415.60
7.0.250.0000.01315.46
7.0.240.0080.00315.59
7.0.230.0100.00315.58
7.0.220.0100.00715.47
7.0.210.0000.01215.54
7.0.200.0020.00816.04
7.0.190.0070.00715.56
7.0.180.0070.00715.43
7.0.170.0000.00815.43
7.0.160.0060.00315.54
7.0.150.0070.00715.50
7.0.140.0050.04018.76
7.0.130.0060.00315.43
7.0.120.0070.00315.27
7.0.110.0040.00815.27
7.0.100.0030.01015.48
7.0.90.0030.01215.54
7.0.80.0040.01115.32
7.0.70.0030.03518.52
7.0.60.0050.04218.46
7.0.50.0030.04018.73
7.0.40.0020.02616.91
7.0.30.0050.03916.85
7.0.20.0050.04316.83
7.0.10.0070.04316.86
7.0.00.0050.03316.68
5.6.400.0070.00414.38
5.6.390.0060.00614.38
5.6.380.0030.00614.68
5.6.370.0030.01614.46
5.6.360.0030.01014.52
5.6.350.0030.01214.50
5.6.340.0070.01014.57
5.6.330.0030.01014.00
5.6.320.0100.00714.38
5.6.310.0000.00814.36
5.6.300.0000.01314.25
5.6.290.0070.00714.31
5.6.280.0030.04017.76
5.6.270.0100.00314.30
5.6.260.0030.01314.60
5.6.250.0030.00614.40
5.6.240.0040.00414.32
5.6.230.0070.00314.53
5.6.220.0030.03217.48
5.6.210.0030.04217.53
5.6.200.0050.04517.71
5.6.190.0050.04417.63
5.6.180.0040.04617.75
5.6.170.0050.03817.83
5.6.160.0100.03017.50
5.6.150.0090.04217.75
5.6.140.0080.04317.68
5.6.130.0050.04817.61
5.6.120.0070.02717.54
5.6.110.0050.02917.75
5.6.100.0030.02717.88
5.6.90.0020.02717.60
5.6.80.0000.02717.32
5.6.70.0030.02517.15
5.6.60.0050.01717.36
5.6.50.0000.02317.27
5.6.40.0070.02217.33
5.6.30.0030.02217.38
5.6.20.0030.02317.32
5.6.10.0050.02317.26
5.6.00.0070.02217.39
5.5.380.0030.01014.39
5.5.370.0040.01114.10
5.5.360.0050.04017.33
5.5.350.0040.03717.44
5.5.340.0030.04017.53
5.5.330.0070.02517.57
5.5.320.0050.02717.59
5.5.310.0100.03717.34
5.5.300.0050.04317.58
5.5.290.0060.04117.53
5.5.280.0090.03417.57
5.5.270.0030.02717.59
5.5.260.0010.02617.49
5.5.250.0050.02317.46
5.5.240.0030.02217.26
5.5.230.0030.02117.23
5.5.220.0040.01817.25
5.5.210.0020.02017.19
5.5.200.0030.02517.39
5.5.190.0080.02017.23
5.5.180.0030.03317.24
5.5.170.0060.00914.09
5.5.160.0030.02217.11
5.5.150.0060.02317.30
5.5.140.0050.02117.20
5.5.130.0050.01817.18
5.5.120.0020.02817.33
5.5.110.0020.02517.19
5.5.100.0040.01717.12
5.5.90.0050.01817.07
5.5.80.0000.02217.21
5.5.70.0080.01817.07
5.5.60.0020.02217.26
5.5.50.0030.02017.09
5.5.40.0030.02017.12
5.5.30.0060.01617.25
5.5.20.0040.02017.30
5.5.10.0050.01817.11
5.5.00.0060.01816.90
5.4.450.0000.04715.58
5.4.440.0020.04115.58
5.4.430.0050.02215.54
5.4.420.0020.03115.41
5.4.410.0020.02315.43
5.4.400.0030.02315.40
5.4.390.0020.02215.41
5.4.380.0000.02015.37
5.4.370.0030.02015.33
5.4.360.0030.01815.32
5.4.350.0030.03015.23
5.4.340.0030.02315.33
5.4.330.0080.00311.63
5.4.320.0030.01915.37
5.4.310.0030.02315.33
5.4.300.0010.02315.26
5.4.290.0020.01915.28
5.4.280.0030.01815.42
5.4.270.0000.02315.33
5.4.260.0030.02015.26
5.4.250.0040.01515.34
5.4.240.0020.01915.42
5.4.230.0040.01715.28
5.4.220.0020.02015.35
5.4.210.0050.01815.41
5.4.200.0050.01715.43
5.4.190.0050.01515.32
5.4.180.0030.01815.38
5.4.170.0020.02015.41
5.4.160.0030.01715.39
5.4.150.0020.02015.36
5.4.140.0020.01914.04
5.4.130.0020.02014.04
5.4.120.0050.01614.05
5.4.110.0020.02114.10
5.4.100.0050.02314.08
5.4.90.0070.01814.09
5.4.80.0050.01514.09
5.4.70.0020.01814.00
5.4.60.0020.02014.01
5.4.50.0050.02214.01
5.4.40.0040.03414.02
5.4.30.0020.01914.02
5.4.20.0020.02514.03
5.4.10.0060.04014.03
5.4.00.0100.02313.78
5.3.290.0080.02013.14
5.3.280.0070.01913.18
5.3.270.0000.02413.17
5.3.260.0030.01813.13
5.3.250.0040.01613.13
5.3.240.0050.01513.17
5.3.230.0000.01913.13
5.3.220.0010.01913.05
5.3.210.0050.01713.08
5.3.200.0030.01813.11
5.3.190.0020.02013.08
5.3.180.0020.01913.09
5.3.170.0040.01513.15
5.3.160.0000.03513.11
5.3.150.0030.01613.11
5.3.140.0010.02413.15
5.3.130.0020.02613.08
5.3.120.0060.04013.08
5.3.110.0030.03413.13
5.3.100.0030.02812.79
5.3.90.0030.02912.84
5.3.80.0060.03912.83
5.3.70.0030.03512.83
5.3.60.0000.02612.85
5.3.50.0040.03912.82
5.3.40.0020.04312.75
5.3.30.0000.02712.80
5.3.20.0020.02312.62
5.3.10.0050.03612.71
5.3.00.0020.03612.60
5.2.170.0070.05012.47
5.2.160.0070.05712.47
5.2.150.0000.03012.47
5.2.140.0000.03312.47
5.2.130.0030.02712.47
5.2.120.0000.05312.47
5.2.110.0070.05712.47
5.2.100.0030.04312.47
5.2.90.0000.06012.47
5.2.80.0100.05312.47
5.2.70.0000.06312.47
5.2.60.0000.05012.47
5.2.50.0030.06012.47
5.2.40.0100.05012.47
5.2.30.0100.04712.47
5.2.20.0000.04712.47
5.2.10.0030.06012.47
5.2.00.0030.04712.47
5.1.60.0070.03012.47
5.1.50.0000.03712.47
5.1.40.0000.04012.47
5.1.30.0030.04712.47
5.1.20.0030.04312.47
5.1.10.0000.05712.47
5.1.00.0030.02712.47
5.0.50.0030.04312.47
5.0.40.0000.02712.47
5.0.30.0030.05012.47
5.0.20.0000.03012.47
5.0.10.0030.03012.47
5.0.00.0030.04712.47
4.4.90.0030.03312.47
4.4.80.0030.03312.47
4.4.70.0100.01012.47
4.4.60.0000.03012.47
4.4.50.0030.03312.47
4.4.40.0030.05012.47
4.4.30.0030.02712.47
4.4.20.0000.02712.47
4.4.10.0000.02312.47
4.4.00.0000.03712.47
4.3.110.0000.02712.47
4.3.100.0030.03312.47
4.3.90.0000.02012.47
4.3.80.0030.05312.47
4.3.70.0000.03712.47
4.3.60.0000.01712.47
4.3.50.0000.02312.47
4.3.40.0000.04712.47
4.3.30.0030.03012.47
4.3.20.0030.02312.47
4.3.10.0000.03712.47
4.3.00.0030.02712.47

preferences:
30.63 ms | 401 KiB | 5 Q