3v4l.org

run code in 300+ PHP versions simultaneously
<?php class RouteCollection implements \IteratorAggregate { /** * @var Route[] */ public $routes = array(); /** * Gets the current RouteCollection as an Iterator that includes all routes. * * It implements \IteratorAggregate. * * @see all() * * @return \ArrayIterator An \ArrayIterator object for iterating over routes */ public function getIterator() { return new \ArrayIterator($this->routes); } } $c = new RouteCollection(); $o = new stdClass; $o->prio = 1; $c->routes[] = $o; $o = new stdClass; $o->prio = 5; $c->routes[] = $o; $c->getIterator()->uasort(function($a, $b) { if ($a->prio == $b->prio ) { return 0; } return $a->prio > $b->prio ? 1 : -1; } ); var_dump($c->routes);

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.0110.00316.75
8.3.50.0070.00719.85
8.3.40.0040.01118.84
8.3.30.0070.00719.04
8.3.20.0000.00720.16
8.3.10.0030.00523.48
8.3.00.0040.00419.38
8.2.180.0110.00716.88
8.2.170.0070.01122.96
8.2.160.0090.00520.31
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0070.00020.95
8.2.110.0040.00422.13
8.2.100.0090.00319.57
8.2.90.0000.00919.39
8.2.80.0050.00317.97
8.2.70.0060.00317.38
8.2.60.0040.00418.03
8.2.50.0030.00618.07
8.2.40.0030.00618.16
8.2.30.0040.00418.14
8.2.20.0050.00317.73
8.2.10.0000.00718.02
8.2.00.0000.00717.79
8.1.280.0150.00425.92
8.1.270.0030.00623.77
8.1.260.0040.00426.35
8.1.250.0090.00628.09
8.1.240.0060.00323.87
8.1.230.0040.00719.21
8.1.220.0000.00917.79
8.1.210.0000.00818.77
8.1.200.0030.00717.48
8.1.190.0000.00817.22
8.1.180.0030.00518.10
8.1.170.0000.00818.52
8.1.160.0000.00722.03
8.1.150.0070.00018.82
8.1.140.0040.00417.38
8.1.130.0030.00317.76
8.1.120.0000.00717.50
8.1.110.0000.00817.37
8.1.100.0000.00717.44
8.1.90.0030.00317.38
8.1.80.0070.00017.44
8.1.70.0040.00417.44
8.1.60.0040.00417.48
8.1.50.0030.00517.45
8.1.40.0060.00317.49
8.1.30.0060.00317.55
8.1.20.0000.00817.65
8.1.10.0000.00717.64
8.1.00.0040.00417.60
8.0.300.0040.00418.77
8.0.290.0000.00816.63
8.0.280.0040.00418.46
8.0.270.0030.00317.26
8.0.260.0030.00317.27
8.0.250.0030.00316.93
8.0.240.0060.00316.96
8.0.230.0000.00716.94
8.0.220.0000.00816.93
8.0.210.0030.00316.89
8.0.200.0030.00317.00
8.0.190.0040.00716.95
8.0.180.0000.00716.99
8.0.170.0000.00816.81
8.0.160.0040.00416.87
8.0.150.0000.00816.82
8.0.140.0040.00416.88
8.0.130.0050.00013.41
8.0.120.0040.00416.87
8.0.110.0030.00516.82
8.0.100.0070.00016.80
8.0.90.0040.00416.71
8.0.80.0100.01316.87
8.0.70.0000.00716.90
8.0.60.0060.00316.85
8.0.50.0000.00716.95
8.0.30.0150.00817.21
8.0.20.0100.00917.40
8.0.10.0000.00816.98
8.0.00.0130.00616.70
7.4.330.0050.00015.00
7.4.320.0060.00016.46
7.4.300.0040.00416.54
7.4.290.0030.00316.65
7.4.280.0040.00416.58
7.4.270.0000.00716.54
7.4.260.0080.00016.49
7.4.250.0000.00816.59
7.4.240.0020.00516.50
7.4.230.0000.00716.70
7.4.220.0110.00716.45
7.4.210.0070.01316.61
7.4.200.0000.00716.51
7.4.160.0050.01116.59
7.4.150.0160.00017.40
7.4.140.0120.00917.86
7.4.130.0070.01016.64
7.4.120.0100.00716.50
7.4.110.0090.00916.50
7.4.100.0070.01016.41
7.4.90.0140.00316.48
7.4.80.0090.01219.39
7.4.70.0000.01516.52
7.4.60.0030.01516.51
7.4.50.0030.00516.39
7.4.40.0120.00616.43
7.4.30.0120.00416.68
7.4.00.0070.01014.78
7.3.330.0000.00613.33
7.3.320.0050.00013.32
7.3.310.0030.00316.21
7.3.300.0030.00316.19
7.3.290.0110.00716.39
7.3.280.0100.00816.30
7.3.270.0120.00617.40
7.3.260.0090.00916.43
7.3.250.0060.01416.39
7.3.240.0040.01316.60
7.3.230.0090.00916.39
7.3.210.0090.00916.22
7.3.200.0110.00819.39
7.3.190.0160.00616.60
7.3.180.0170.00016.21
7.3.170.0160.00616.64
7.3.160.0070.01016.48
7.2.330.0090.01216.83
7.2.320.0080.01516.77
7.2.310.0110.01116.77
7.2.300.0110.01116.57
7.2.290.0070.01016.59
7.2.00.0220.01318.70
7.1.100.0030.00717.86
7.1.70.0030.00517.22
7.1.60.0090.00619.40
7.1.50.0140.00716.72
7.1.00.0030.07722.40
7.0.200.0040.00416.69
7.0.140.0100.06722.17
7.0.60.0070.06719.79
7.0.50.0000.04317.88
7.0.40.0070.08020.24
7.0.30.0300.04720.06
7.0.20.0400.04320.33
7.0.10.0030.04720.22
7.0.00.0030.04720.22
5.6.210.0130.07020.72
5.6.200.0130.07018.19
5.6.190.0070.07020.42
5.6.180.3370.04020.47
5.6.170.0230.05020.64
5.6.160.0070.05020.69
5.6.150.0100.03718.30
5.6.140.0170.07018.15
5.6.130.0070.04018.28
5.6.120.0100.04320.91
5.6.110.0100.08320.96
5.6.100.0100.06321.05
5.6.90.0030.08721.04
5.6.80.0200.05720.46
5.6.70.4270.04020.35
5.5.350.0200.06020.45
5.5.340.0170.07317.96
5.5.330.0030.05720.34
5.5.320.3800.03720.35
5.5.310.0330.07020.34
5.5.300.0170.06718.02
5.5.290.0100.03317.93
5.5.280.0070.05320.84
5.5.270.0070.04720.68
5.5.260.0030.09020.65
5.5.250.0130.07720.69
5.5.240.0170.06320.33
5.4.450.0570.05319.31
5.4.440.0470.04719.16
5.4.430.0230.04019.41
5.4.420.0230.05019.16
5.4.410.0530.03719.26
5.4.400.0370.03719.15
5.4.390.0500.04319.09
5.4.380.0930.06318.59
5.4.370.0570.05318.55
5.4.360.0930.06718.75
5.4.350.0700.06718.51
5.4.340.0730.06318.74
5.4.320.0100.04012.50
5.4.310.0070.04612.50
5.4.300.0040.04212.51
5.4.290.0090.04412.50
5.4.280.0050.04412.40
5.4.270.0080.04512.40
5.4.260.0080.05712.40
5.4.250.0060.05312.40
5.4.240.0060.03812.40
5.4.230.0050.03912.39
5.4.220.0070.03912.39
5.4.210.0050.03912.39
5.4.200.0110.04412.39
5.4.190.0070.03612.38
5.4.180.0110.04812.39
5.4.170.0050.04012.40
5.4.160.0130.05812.39
5.4.150.0080.04912.39
5.4.140.0070.04512.08
5.4.130.0080.04012.06
5.4.120.0090.04612.02
5.4.110.0100.03212.01
5.4.100.0100.03312.02
5.4.90.0080.04312.02
5.4.80.0040.04112.02
5.4.70.0100.03912.01
5.4.60.0090.03812.01
5.4.50.0050.04012.01
5.4.40.0050.04912.00
5.4.30.0030.05612.00
5.4.20.0090.04812.00
5.4.10.0080.04811.99
5.4.00.0140.06411.48
5.3.290.0060.03912.80
5.3.280.0110.03812.70
5.3.270.0070.04512.72
5.3.260.0060.04812.71
5.3.250.0110.04212.72
5.3.240.0080.04412.72
5.3.230.0070.03712.71
5.3.220.0040.04212.68
5.3.210.0050.04112.68
5.3.200.0060.03712.68
5.3.190.0070.04212.68
5.3.180.0070.04412.67
5.3.170.0050.03812.67
5.3.160.0040.04012.67
5.3.150.0030.04112.67
5.3.140.0050.03912.66
5.3.130.0050.04012.66
5.3.120.0080.03712.65
5.3.110.0040.04112.66
5.3.100.0070.03712.14
5.3.90.0080.04312.12
5.3.80.0100.03412.11
5.3.70.0040.03812.11
5.3.60.0050.03812.09
5.3.50.0090.03312.04
5.3.40.0060.03712.04
5.3.30.0070.03412.00
5.3.20.0070.03711.78
5.3.10.0070.04211.75
5.3.00.0080.03511.73
5.2.170.0050.0309.22
5.2.160.0070.0279.22
5.2.150.0060.0419.23
5.2.140.0030.0449.22
5.2.130.0070.0399.18
5.2.120.0040.0419.18
5.2.110.0080.0339.19
5.2.100.0030.0399.18
5.2.90.0080.0349.19
5.2.80.0070.0349.18
5.2.70.0090.0469.18
5.2.60.0090.0369.13
5.2.50.0120.0369.10
5.2.40.0100.0359.07
5.2.30.0050.0429.05
5.2.20.0100.0379.04
5.2.10.0040.0348.95
5.2.00.0050.0358.82
5.1.60.0080.0208.09
5.1.50.0060.0258.09
5.1.40.0030.0298.08
5.1.30.0060.0348.43
5.1.20.0070.0338.45
5.1.10.0070.0358.17
5.1.00.0090.0428.16
5.0.50.0080.0206.65
5.0.40.0060.0286.51
5.0.30.0040.0356.32
5.0.20.0050.0266.28
5.0.10.0060.0226.26
5.0.00.0030.0336.26
4.4.90.0020.0174.78
4.4.80.0050.0174.75
4.4.70.0060.0154.76
4.4.60.0030.0214.75
4.4.50.0040.0224.77
4.4.40.0030.0444.71
4.4.30.0030.0224.76
4.4.20.0020.0214.84
4.4.10.0070.0154.84
4.4.00.0020.0284.76
4.3.110.0050.0134.67
4.3.100.0030.0154.66
4.3.90.0040.0134.64
4.3.80.0030.0244.59
4.3.70.0050.0124.63
4.3.60.0020.0184.63
4.3.50.0020.0204.62
4.3.40.0010.0304.53
4.3.30.0040.0173.30
4.3.20.0020.0193.27
4.3.10.0050.0163.23
4.3.00.0070.02015.97

preferences:
45.28 ms | 400 KiB | 5 Q