3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pq = new SplPriorityQueue(); //insert method inserts an element in the queue by shifting it up $pq->insert('A', 3); $pq->insert('B', 6); $pq->insert('C', -1); $pq->insert('D', 2); //count the elements echo "count ->" . $pq->count(); //Sets the mode of extraction (EXTR_DATA, EXTR_PRIORITY, EXTR_BOTH) $pq->setExtractFlags(SplPriorityQueue::EXTR_BOTH); //go at the node from the top of the queue $pq->top(); //iterate the queue (by priority) and display each element while ($pq->valid()) { print_r($pq->current()); $pq->next(); }

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.0160.00618.31
8.3.50.0100.01121.04
8.3.40.0030.01218.69
8.3.30.0100.00319.05
8.3.20.0080.00020.34
8.3.10.0030.00523.71
8.3.00.0000.00819.13
8.2.180.0000.01416.63
8.2.170.0130.00622.96
8.2.160.0100.00720.35
8.2.150.0050.00324.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00422.18
8.2.110.0030.00622.32
8.2.100.0090.00317.63
8.2.90.0000.00819.27
8.2.80.0090.00017.97
8.2.70.0030.00617.75
8.2.60.0040.00417.80
8.2.50.0060.00318.07
8.2.40.0050.00318.16
8.2.30.0070.00017.94
8.2.20.0050.00317.70
8.2.10.0040.00418.06
8.2.00.0070.00017.62
8.1.280.0140.00725.92
8.1.270.0030.00522.14
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0080.00023.92
8.1.230.0080.00418.89
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0060.00317.23
8.1.190.0080.00017.23
8.1.180.0000.00718.10
8.1.170.0080.00018.49
8.1.160.0000.00721.91
8.1.150.0000.00718.75
8.1.140.0040.00417.27
8.1.130.0040.00417.82
8.1.120.0040.00417.41
8.1.110.0040.00417.43
8.1.100.0000.00717.32
8.1.90.0000.00717.41
8.1.80.0000.00717.42
8.1.70.0000.00717.40
8.1.60.0030.00617.52
8.1.50.0000.00817.52
8.1.40.0000.00817.46
8.1.30.0050.00217.49
8.1.20.0000.00717.59
8.1.10.0030.00617.49
8.1.00.0000.00817.40
8.0.300.0060.00318.77
8.0.290.0000.00716.63
8.0.280.0000.00718.38
8.0.270.0030.00317.26
8.0.260.0060.00017.29
8.0.250.0070.00016.98
8.0.240.0070.00016.86
8.0.230.0000.00716.84
8.0.220.0000.00716.92
8.0.210.0000.00716.93
8.0.200.0060.00316.99
8.0.190.0000.00716.99
8.0.180.0070.00016.93
8.0.170.0000.00716.96
8.0.160.0030.00316.87
8.0.150.0030.00316.70
8.0.140.0000.00716.91
8.0.130.0030.00313.33
8.0.120.0070.00016.77
8.0.110.0030.00516.73
8.0.100.0040.00416.79
8.0.90.0040.00416.68
8.0.80.0070.01416.82
8.0.70.0000.00716.86
8.0.60.0040.00416.61
8.0.50.0050.00216.84
8.0.30.0060.01416.98
8.0.20.0050.01217.40
8.0.10.0040.00416.92
8.0.00.0090.00916.71
7.4.330.0060.00015.02
7.4.320.0030.00316.39
7.4.300.0030.00316.36
7.4.290.0040.00416.39
7.4.280.0030.00716.54
7.4.270.0000.00816.41
7.4.260.0040.00416.50
7.4.250.0040.00416.53
7.4.240.0030.00316.45
7.4.230.0040.00416.44
7.4.220.0130.01116.41
7.4.210.0060.01216.49
7.4.200.0030.00316.34
7.4.160.0070.01416.30
7.4.150.0100.01017.40
7.4.140.0060.01317.86
7.4.130.0100.00616.42
7.4.120.0090.00716.46
7.4.110.0080.00816.33
7.4.100.0100.01016.69
7.4.90.0140.00316.39
7.4.80.0070.01019.39
7.4.70.0080.00816.71
7.4.60.0110.01116.43
7.4.50.0000.00816.27
7.4.40.0070.01016.50
7.4.30.0090.00916.36
7.4.00.0110.00515.00
7.3.330.0050.00013.14
7.3.320.0000.00513.08
7.3.310.0040.00416.05
7.3.300.0000.00716.20
7.3.290.0060.00816.22
7.3.280.0100.00516.20
7.3.270.0110.00717.40
7.3.260.0060.01016.18
7.3.250.0100.00816.22
7.3.240.0100.00916.23
7.3.230.0060.01316.39
7.3.210.0110.00816.26
7.3.200.0100.00719.39
7.3.190.0060.00916.27
7.3.180.0030.01316.59
7.3.170.0100.00716.61
7.3.160.0100.00716.42
7.3.120.0060.00614.45
7.3.110.0030.01314.48
7.3.100.0070.01014.99
7.3.90.0070.01014.79
7.3.80.0090.00614.63
7.3.70.0120.00014.45
7.3.60.0110.00414.52
7.3.50.0110.00714.77
7.3.40.0030.01014.44
7.3.30.0090.00614.59
7.3.20.0030.01416.43
7.3.10.0030.01016.82
7.3.00.0070.00716.59
7.2.330.0080.00816.71
7.2.320.0160.00916.62
7.2.310.0130.00316.57
7.2.300.0160.00016.42
7.2.290.0040.01716.51
7.2.250.0040.01215.21
7.2.240.0110.00815.17
7.2.230.0040.01214.88
7.2.220.0070.00715.25
7.2.210.0090.00615.10
7.2.200.0080.00315.06
7.2.190.0080.00814.99
7.2.180.0060.00915.05
7.2.170.0000.01315.18
7.2.60.0060.00616.73
7.2.00.0000.01219.47
7.1.330.0100.00615.73
7.1.320.0030.01215.64
7.1.310.0060.00615.78
7.1.300.0000.01415.64
7.1.290.0100.00315.58
7.1.280.0060.00615.43
7.1.270.0090.00615.60
7.1.260.0060.00615.71
7.1.200.0040.00815.40
7.1.100.0030.00918.27
7.1.70.0050.00316.81
7.1.60.0100.01319.11
7.1.50.0100.01316.53
7.1.00.0030.07022.37
7.0.200.0050.00316.67
7.0.140.0030.06722.08
7.0.60.0170.06020.06
7.0.50.0070.06717.66
7.0.40.0070.08020.23
7.0.30.0530.07320.18
7.0.20.0330.08320.34
7.0.10.0130.08020.00
7.0.00.0130.06320.09
5.6.280.0000.07720.89
5.6.210.0070.08320.54
5.6.200.0100.07718.15
5.6.190.0100.08320.60
5.6.180.0270.04020.69
5.6.170.0330.07320.37
5.6.160.0230.06720.52
5.6.150.0030.06718.12
5.6.140.0070.08018.21
5.6.130.0100.04018.16
5.6.120.0070.04320.98
5.6.110.0170.07720.95
5.6.100.0070.06320.97
5.6.90.0030.09321.09
5.6.80.0100.07720.48
5.6.70.4430.04020.35
5.5.350.0170.03320.35
5.5.340.0030.05717.93
5.5.330.0070.04020.40
5.5.320.0230.04020.32
5.5.310.0230.04720.17
5.5.300.0070.08017.88
5.5.290.0130.07317.91
5.5.280.0070.08020.87
5.5.270.0130.06720.75
5.5.260.0070.06020.89
5.5.250.0100.08020.70
5.5.240.0270.06020.14
5.4.450.1000.04019.63
5.4.440.0730.05319.54
5.4.430.0730.06019.63
5.4.420.0800.05019.52
5.4.410.0870.05719.39
5.4.400.0630.05318.81
5.4.390.0630.06018.77
5.4.380.0900.06019.25
5.4.370.0630.05719.25
5.4.360.0670.05719.09
5.4.350.0800.04319.19
5.4.340.0090.04111.97
5.4.320.0050.03912.46
5.4.310.0080.04712.45
5.4.300.0070.03812.46
5.4.290.0090.04012.45
5.4.280.0050.03812.35
5.4.270.0050.04512.35
5.4.260.0100.03812.35
5.4.250.0070.05012.35
5.4.240.0060.05212.35
5.4.230.0100.05212.34
5.4.220.0130.05412.34
5.4.210.0070.04012.34
5.4.200.0090.03912.34
5.4.190.0020.04012.34
5.4.180.0070.03612.34
5.4.170.0090.03312.35
5.4.160.0080.03512.34
5.4.150.0080.03612.34
5.4.140.0080.03612.02
5.4.130.0070.03612.01
5.4.120.0040.05111.97
5.4.110.0090.05111.97
5.4.100.0090.03311.97
5.4.90.0030.04011.97
5.4.80.0080.03811.97
5.4.70.0080.03311.96
5.4.60.0100.03211.96
5.4.50.0110.03211.96
5.4.40.0070.03711.95
5.4.30.0020.03911.95
5.4.20.0030.03811.95
5.4.10.0080.03311.95
5.4.00.0080.04111.43
5.3.290.0060.04012.80
5.3.280.0070.03812.71
5.3.270.0070.03912.73
5.3.260.0040.04112.72
5.3.250.0080.03912.72
5.3.240.0080.03612.72
5.3.230.0080.03712.71
5.3.220.0060.03912.68
5.3.210.0140.03912.68
5.3.200.0080.04112.68
5.3.190.0060.03612.68
5.3.180.0040.03712.67
5.3.170.0070.03612.67
5.3.160.0060.03612.68
5.3.150.0100.03412.68
5.3.140.0040.03912.66
5.3.130.0060.03912.66
5.3.120.0070.03712.65
5.3.110.0050.04012.66
5.3.100.0060.05112.12
5.3.90.0030.03912.08
5.3.80.0050.03812.08
5.3.70.0100.03512.08
5.3.60.0050.03812.06
5.3.50.0070.03612.00
5.3.40.0060.03612.00
5.3.30.0050.03611.95
5.3.20.0040.04111.72
5.3.10.0080.03511.69
5.3.00.0050.04111.68
5.2.170.0040.0319.18
5.2.160.0070.0309.18
5.2.150.0060.0379.18
5.2.140.0080.0419.18
5.2.130.0040.0399.14
5.2.120.0050.0299.14
5.2.110.0050.0299.15
5.2.100.0050.0329.14
5.2.90.0040.0329.14
5.2.80.0070.0369.14
5.2.70.0030.0399.14
5.2.60.0040.0339.09
5.2.50.0050.0319.06
5.2.40.0030.0309.04
5.2.30.0060.0359.01
5.2.20.0030.0309.00
5.2.10.0020.0308.92
5.2.00.0010.0328.78
5.1.60.0020.0268.07
5.1.50.0010.0288.07
5.1.40.0040.0248.04
5.1.30.0030.0298.39
5.1.20.0030.0298.41
5.1.10.0030.0288.14
5.1.00.0070.0238.14
5.0.50.0030.0216.62
5.0.40.0050.0186.48
5.0.30.0040.0306.29
5.0.20.0040.0186.27
5.0.10.0030.0206.24
5.0.00.0040.0306.24
4.4.90.0030.0154.78
4.4.80.0030.0164.75
4.4.70.0050.0134.76
4.4.60.0040.0134.75
4.4.50.0050.0134.77
4.4.40.0020.0264.71
4.4.30.0010.0174.76
4.4.20.0010.0174.85
4.4.10.0050.0134.85
4.4.00.0030.0244.76
4.3.110.0020.0174.67
4.3.100.0030.0154.66
4.3.90.0030.0204.63
4.3.80.0040.0294.58
4.3.70.0010.0174.63
4.3.60.0020.0154.63
4.3.50.0030.0154.63
4.3.40.0040.0234.53
4.3.30.0010.0173.29
4.3.20.0010.0173.27
4.3.10.0020.0173.22
4.3.00.0130.0206.68

preferences:
53.86 ms | 401 KiB | 5 Q