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() . "<br />"; //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.0140.00418.43
8.3.50.0080.01221.06
8.3.40.0150.00018.71
8.3.30.0110.00319.01
8.3.20.0040.00420.16
8.3.10.0000.00823.65
8.3.00.0040.00419.38
8.2.180.0160.00016.38
8.2.170.0100.01022.96
8.2.160.0100.00320.28
8.2.150.0050.00224.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0060.00321.91
8.2.110.0080.00020.41
8.2.100.0040.00818.09
8.2.90.0080.00019.21
8.2.80.0040.00417.97
8.2.70.0030.00617.63
8.2.60.0080.00017.80
8.2.50.0080.00018.07
8.2.40.0030.00519.94
8.2.30.0050.00317.96
8.2.20.0020.00517.68
8.2.10.0070.00017.95
8.2.00.0000.00717.68
8.1.280.0100.01025.92
8.1.270.0080.00022.06
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0000.00923.90
8.1.230.0060.00618.88
8.1.220.0030.00517.75
8.1.210.0000.00718.77
8.1.200.0030.00617.21
8.1.190.0050.00317.23
8.1.180.0020.00518.10
8.1.170.0050.00318.45
8.1.160.0000.00821.94
8.1.150.0040.00418.93
8.1.140.0050.00217.45
8.1.130.0000.00717.82
8.1.120.0040.00417.45
8.1.110.0040.00417.42
8.1.100.0040.00317.45
8.1.90.0000.00717.49
8.1.80.0030.00317.40
8.1.70.0030.00317.39
8.1.60.0030.00617.45
8.1.50.0000.00817.46
8.1.40.0050.00317.39
8.1.30.0050.00317.66
8.1.20.0040.00417.59
8.1.10.0000.00717.56
8.1.00.0030.00517.43
8.0.300.0040.00418.77
8.0.290.0040.00416.58
8.0.280.0030.00318.36
8.0.270.0040.00417.19
8.0.260.0060.00017.32
8.0.250.0000.00717.03
8.0.240.0000.00816.82
8.0.230.0000.00716.99
8.0.220.0030.00316.87
8.0.210.0040.00416.88
8.0.200.0030.00616.91
8.0.190.0000.00716.91
8.0.180.0070.00016.81
8.0.170.0070.00016.99
8.0.160.0000.00716.79
8.0.150.0020.00516.90
8.0.140.0040.00416.78
8.0.130.0050.00013.25
8.0.120.0040.00416.81
8.0.110.0040.00416.88
8.0.100.0080.00016.89
8.0.90.0040.00416.84
8.0.80.0110.01116.89
8.0.70.0000.00716.87
8.0.60.0030.00316.86
8.0.50.0040.00416.75
8.0.30.0160.00417.07
8.0.20.0130.00717.40
8.0.10.0000.00716.89
8.0.00.0080.01016.78
7.4.330.0000.00515.08
7.4.320.0030.00316.40
7.4.300.0060.00016.54
7.4.290.0000.00716.53
7.4.280.0040.00716.54
7.4.270.0040.00416.44
7.4.260.0000.00916.35
7.4.250.0000.00716.39
7.4.240.0020.00516.50
7.4.230.0030.00316.47
7.4.220.0170.00316.50
7.4.210.0030.01316.41
7.4.200.0030.00316.56
7.4.160.0170.00316.41
7.4.150.0100.00717.40
7.4.140.0130.00617.86
7.4.130.0140.00616.44
7.4.120.0100.00616.33
7.4.110.0060.01516.40
7.4.100.0060.01216.57
7.4.90.0030.01316.38
7.4.80.0090.00919.39
7.4.70.0090.00816.48
7.4.60.0080.01016.40
7.4.50.0030.00516.41
7.4.40.0100.00616.29
7.4.30.0070.01016.34
7.4.00.0030.01514.73
7.3.330.0030.00313.11
7.3.320.0020.00213.05
7.3.310.0040.00416.31
7.3.300.0000.00716.21
7.3.290.0060.01016.21
7.3.280.0080.01016.20
7.3.270.0060.01117.40
7.3.260.0070.01016.35
7.3.250.0070.01016.41
7.3.240.0100.00716.30
7.3.230.0120.01216.39
7.3.210.0130.01016.63
7.3.200.0170.00319.39
7.3.190.0130.00316.16
7.3.180.0080.00816.37
7.3.170.0140.00316.47
7.3.160.0110.00716.24
7.3.10.0060.00716.32
7.3.00.0090.00416.48
7.2.330.0130.00616.39
7.2.320.0080.01516.54
7.2.310.0160.00016.76
7.2.300.0000.01616.44
7.2.290.0100.01016.43
7.2.130.0120.00616.96
7.2.120.0040.00416.92
7.2.110.0000.01117.07
7.2.100.0030.00717.03
7.2.90.0050.00816.79
7.2.80.0110.00317.07
7.2.70.0070.01016.91
7.2.60.0070.01116.96
7.2.50.0080.00616.92
7.2.40.0080.00316.61
7.2.30.0070.00716.57
7.2.20.0090.00616.89
7.2.10.0030.00917.08
7.2.00.0030.00718.18
7.1.250.0000.01215.61
7.1.100.0040.00718.21
7.1.70.0090.00017.12
7.1.60.0040.01519.11
7.1.50.0060.01916.94
7.1.00.0070.07022.51
7.0.200.0080.00016.67
7.0.140.0070.07021.92
7.0.60.0070.07019.93
7.0.50.0070.03717.83
7.0.40.0130.08720.04
7.0.30.0470.07020.21
7.0.20.0230.04020.09
7.0.10.0130.08320.09
7.0.00.0070.04720.14
5.6.280.0070.06721.07
5.6.210.0070.03720.61
5.6.200.0100.07318.21
5.6.190.0030.04720.49
5.6.180.0200.08320.49
5.6.170.0130.04020.48
5.6.160.0070.08320.44
5.6.150.0100.03318.08
5.6.140.0070.03718.17
5.6.130.0170.06018.21
5.6.120.0030.04321.02
5.6.110.0200.06720.88
5.6.100.0170.06020.95
5.6.90.0100.04021.10
5.6.80.0030.08320.53
5.6.70.4300.04320.27
5.5.350.0130.07020.50
5.5.340.0000.05017.95
5.5.330.0170.06720.37
5.5.320.0300.07720.28
5.5.310.0230.05720.20
5.5.300.0070.04317.88
5.5.290.0030.08317.90
5.5.280.0100.05320.77
5.5.270.0030.06020.88
5.5.260.0170.06320.95
5.5.250.0100.08020.79
5.5.240.0270.07320.28
5.4.450.0300.05019.13
5.4.440.0370.06019.22
5.4.430.0300.04719.41
5.4.420.0300.07019.40
5.4.410.0500.06319.28
5.4.400.0270.03719.13
5.4.390.0270.04318.88
5.4.380.0330.06719.24
5.4.370.0230.04318.80
5.4.360.0230.06719.06
5.4.350.0200.08019.09
5.4.340.0270.03719.06
5.4.320.0370.07019.09
5.4.310.0400.04019.25
5.4.300.0300.07319.08
5.4.290.0300.07019.21
5.4.280.0270.05019.06
5.4.270.0270.07019.09
5.4.260.0270.04319.08
5.4.250.0230.03719.07
5.4.240.0200.08019.13
5.4.230.0330.06719.07
5.4.220.0330.03719.21
5.4.210.0230.03719.07
5.4.200.0300.07319.07
5.4.190.0270.04018.78
5.4.180.0270.06019.04
5.4.170.0300.07318.93
5.4.160.0300.07719.04
5.4.150.0370.05719.11
5.4.140.0230.05016.41
5.4.130.0230.04316.30
5.4.120.0200.04016.22
5.4.110.0230.08016.19
5.4.100.0270.07316.43
5.4.90.0200.04316.41
5.4.80.0330.03316.38
5.4.70.0200.04016.37
5.4.60.0200.04016.20
5.4.50.0270.07016.43
5.4.40.0300.04316.38
5.4.30.0230.04716.39
5.4.20.0200.04016.38
5.4.10.0330.06716.36
5.4.00.0270.03715.71
5.3.290.0270.07714.84
5.3.280.0200.06714.84
5.3.270.0330.06714.84
5.3.260.0230.05714.84
5.3.250.0270.04014.84
5.3.240.0270.03314.84
5.3.230.0130.04314.84
5.3.220.0300.04714.84
5.3.210.0330.04714.84
5.3.200.0300.03314.84
5.3.190.0230.06314.84
5.3.180.0230.04314.84
5.3.170.0230.04014.84
5.3.160.0300.03014.84
5.3.150.0270.07314.84
5.3.140.0270.06014.84
5.3.130.0330.06714.84
5.3.120.0370.05714.84
5.3.110.0300.04314.84
5.3.100.0270.07314.84
5.3.90.0200.06014.84
5.3.80.0300.02714.84
5.3.70.0200.03714.84
5.3.60.0230.03714.84
5.3.50.0170.03714.84
5.3.40.0200.03314.84
5.3.30.0200.03714.84
5.3.20.0200.03314.84
5.3.10.0170.03314.84
5.3.00.0200.03014.84
5.2.170.0300.01714.84
5.2.160.0130.03714.84
5.2.150.0170.02714.84
5.2.140.0200.02714.84
5.2.130.0200.02714.84
5.2.120.0130.02714.84
5.2.110.0100.03314.84
5.2.100.0230.02714.84
5.2.90.0100.04014.84
5.2.80.0170.03014.84
5.2.70.0230.05714.84
5.2.60.0070.04714.84
5.2.50.0270.05314.84
5.2.40.0070.03314.84
5.2.30.0170.03314.84
5.2.20.0070.03714.84
5.2.10.0170.02314.84
5.2.00.0000.03014.84
5.1.60.0000.03014.84
5.1.50.0030.03014.84
5.1.40.0070.03014.84
5.1.30.0100.02714.84
5.1.20.0130.02314.84
5.1.10.0170.02314.84
5.1.00.0100.02714.84
5.0.50.0070.02014.84
5.0.40.0030.02014.84
5.0.30.0070.03014.84
5.0.20.0070.02014.84
5.0.10.0030.02014.84
5.0.00.0030.03014.84
4.4.90.0070.01314.84
4.4.80.0070.03714.84
4.4.70.0070.01314.84
4.4.60.0030.01314.84
4.4.50.0000.02014.84
4.4.40.0070.02714.84
4.4.30.0030.01314.84
4.4.20.0070.01314.84
4.4.10.0070.01314.84
4.4.00.0030.02714.84
4.3.110.0030.01714.84
4.3.100.0100.01014.84
4.3.90.0070.01314.84
4.3.80.0070.02714.84
4.3.70.0030.01714.84
4.3.60.0100.01014.84
4.3.50.0030.02014.84
4.3.40.0070.02314.84
4.3.30.0030.01714.84
4.3.20.0000.01714.84
4.3.10.0000.01714.84
4.3.00.0030.01314.84

preferences:
39.76 ms | 400 KiB | 5 Q