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 = 3; $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.0030.01016.75
8.3.50.0100.00522.92
8.3.40.0070.00718.67
8.3.30.0170.00319.27
8.3.20.0040.00420.19
8.3.10.0040.00423.70
8.3.00.0030.00519.38
8.2.180.0080.00816.63
8.2.170.0090.00622.96
8.2.160.0090.00420.43
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00820.97
8.2.110.0060.00322.20
8.2.100.0030.01019.63
8.2.90.0050.00319.17
8.2.80.0090.00017.97
8.2.70.0050.00317.63
8.2.60.0060.00318.04
8.2.50.0050.00318.07
8.2.40.0030.00518.22
8.2.30.0050.00218.04
8.2.20.0000.00717.88
8.2.10.0050.00318.20
8.2.00.0000.00717.82
8.1.280.0000.01425.92
8.1.270.0060.00323.67
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0030.00723.93
8.1.230.0000.01119.17
8.1.220.0000.00817.77
8.1.210.0090.00018.77
8.1.200.0000.00817.35
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0080.00018.65
8.1.160.0040.00421.95
8.1.150.0040.00418.82
8.1.140.0040.00417.47
8.1.130.0070.00017.78
8.1.120.0000.00717.49
8.1.110.0050.00317.44
8.1.100.0000.00717.51
8.1.90.0050.00217.38
8.1.80.0030.00417.45
8.1.70.0040.00417.42
8.1.60.0030.00517.60
8.1.50.0000.00917.52
8.1.40.0040.00417.45
8.1.30.0090.00017.61
8.1.20.0000.00817.68
8.1.10.0030.00617.57
8.1.00.0040.00417.50
8.0.300.0000.00718.77
8.0.290.0000.00716.63
8.0.280.0030.00318.33
8.0.270.0000.00717.31
8.0.260.0000.00717.19
8.0.250.0070.00016.89
8.0.240.0030.00616.93
8.0.230.0000.00716.93
8.0.220.0030.00316.90
8.0.210.0050.00216.88
8.0.200.0000.00716.95
8.0.190.0100.00016.96
8.0.180.0020.00516.80
8.0.170.0040.00416.82
8.0.160.0040.00416.93
8.0.150.0000.00716.82
8.0.140.0040.00416.86
8.0.130.0030.00313.30
8.0.120.0000.00816.78
8.0.110.0040.00416.86
8.0.100.0070.00016.77
8.0.90.0040.00416.96
8.0.80.0060.00916.90
8.0.70.0000.00816.78
8.0.60.0050.00316.97
8.0.50.0000.00716.83
8.0.30.0140.01117.12
8.0.20.0090.00917.40
8.0.10.0030.00517.07
8.0.00.0100.00916.84
7.4.330.0050.00015.09
7.4.320.0070.00016.60
7.4.300.0030.00316.46
7.4.290.0070.00016.60
7.4.280.0000.00816.64
7.4.270.0000.00716.50
7.4.260.0030.00316.49
7.4.250.0000.00716.50
7.4.240.0070.00016.55
7.4.230.0000.00816.43
7.4.220.0140.00416.68
7.4.210.0060.00916.51
7.4.200.0000.00816.71
7.4.160.0120.00416.62
7.4.150.0170.00917.40
7.4.140.0160.00517.86
7.4.130.0050.01216.53
7.4.120.0070.01016.56
7.4.110.0120.00616.43
7.4.100.0090.00916.55
7.4.90.0180.00316.47
7.4.80.0030.01719.39
7.4.70.0080.01116.52
7.4.60.0070.01016.33
7.4.50.0000.00816.55
7.4.40.0110.00616.60
7.4.30.0060.01816.50
7.4.00.0060.00914.98
7.3.330.0050.00013.33
7.3.320.0030.00313.29
7.3.310.0030.00316.37
7.3.300.0000.00716.27
7.3.290.0030.01716.36
7.3.280.0130.00716.34
7.3.270.0160.00317.40
7.3.260.0070.01116.43
7.3.250.0130.00516.43
7.3.240.0100.00716.48
7.3.230.0120.00616.42
7.3.210.0110.00816.55
7.3.200.0170.00719.39
7.3.190.0140.00716.39
7.3.180.0130.00316.41
7.3.170.0100.00616.44
7.3.160.0090.00616.44
7.3.10.0160.01016.19
7.3.00.0080.00816.61
7.2.330.0120.00616.79
7.2.320.0110.01216.77
7.2.310.0100.00716.62
7.2.300.0060.01216.87
7.2.290.0000.01716.79
7.2.130.0190.00716.48
7.2.120.0080.01316.63
7.2.110.0130.01116.84
7.2.100.0130.01016.58
7.2.90.0140.00716.62
7.2.80.0110.00916.97
7.2.70.0110.00716.66
7.2.60.0140.00816.77
7.2.50.0090.00716.73
7.2.40.0100.00616.86
7.2.30.0070.00816.60
7.2.20.0090.00516.59
7.2.10.0080.00816.48
7.2.00.0060.00917.62
7.1.250.0050.01215.57
7.1.200.0080.00415.61
7.1.100.0060.00618.16
7.1.70.0050.00317.26
7.1.60.0090.00619.40
7.1.50.0130.01016.63
7.1.00.0070.07322.40
7.0.200.0030.00716.84
7.0.140.0100.06722.15
7.0.60.0100.05020.05
7.0.50.0030.08317.85
7.0.40.0070.05320.24
7.0.30.0270.07020.30
7.0.20.0170.04320.27
7.0.10.0130.08320.10
7.0.00.0100.07320.15
5.6.280.0070.07020.87
5.6.210.0130.07020.67
5.6.200.0100.03718.29
5.6.190.0030.09020.79
5.6.180.0330.08020.63
5.6.170.0170.04320.55
5.6.160.0130.06320.43
5.6.150.0100.05018.19
5.6.140.0070.06018.27
5.6.130.0000.06718.28
5.6.120.0030.04321.13
5.6.110.0270.06720.98
5.6.100.0100.07021.11
5.6.90.0130.08021.00
5.6.80.0130.07320.41
5.5.350.0300.07320.50
5.5.340.0070.06718.11
5.5.330.0030.04320.42
5.5.320.0170.04720.36
5.5.310.0370.07020.34
5.5.300.0100.07718.02
5.5.290.0070.08017.97
5.5.280.0070.07020.89
5.5.270.0030.07020.85
5.5.260.0200.07020.76
5.5.250.0100.07720.77
5.5.240.0100.06720.28
5.4.450.0770.05019.21
5.4.440.0970.05719.48
5.4.430.0830.05719.20
5.4.420.0970.05719.53
5.4.410.0770.04319.15
5.4.400.0730.05719.07
5.4.390.0730.06019.28
5.4.380.0270.04318.71
5.4.370.0170.04718.78
5.4.360.0100.05318.68
5.4.350.0090.03512.03
5.4.340.0060.03812.02
5.4.320.0100.03312.50
5.4.310.0120.03212.50
5.4.300.0060.03912.51
5.4.290.0060.03812.50
5.4.280.0080.03212.40
5.4.270.0070.03512.40
5.4.260.0080.03712.39
5.4.250.0060.03712.40
5.4.240.0070.03512.40
5.4.230.0070.03612.39
5.4.220.0070.03712.39
5.4.210.0040.03712.39
5.4.200.0060.03612.39
5.4.190.0060.04012.39
5.4.180.0050.03712.39
5.4.170.0030.03812.40
5.4.160.0060.03812.39
5.4.150.0090.04012.39
5.4.140.0060.03712.07
5.4.130.0060.03412.07
5.4.120.0050.04012.02
5.4.110.0090.03212.01
5.4.100.0040.04112.01
5.4.90.0030.04012.02
5.4.80.0070.03412.01
5.4.70.0050.03412.01
5.4.60.0060.03512.02
5.4.50.0060.04112.01
5.4.40.0050.03412.00
5.4.30.0020.03812.00
5.4.20.0060.03612.00
5.4.10.0040.03912.00
5.4.00.0030.03711.49
5.3.290.0060.03812.80
5.3.280.0040.05012.71
5.3.270.0080.03812.72
5.3.260.0090.04312.72
5.3.250.0040.04912.72
5.3.240.0110.03712.72
5.3.230.0040.03912.71
5.3.220.0080.03512.68
5.3.210.0090.04712.68
5.3.200.0080.04512.68
5.3.190.0060.04312.67
5.3.180.0080.04312.67
5.3.170.0090.04512.67
5.3.160.0040.03912.67
5.3.150.0080.03912.67
5.3.140.0050.03812.66
5.3.130.0050.04012.66
5.3.120.0050.04012.66
5.3.110.0070.04112.66
5.3.100.0080.03312.14
5.3.90.0030.04012.12
5.3.80.0030.03912.11
5.3.70.0050.03712.11
5.3.60.0050.03712.10
5.3.50.0070.03512.04
5.3.40.0070.03412.04
5.3.30.0060.03912.00
5.3.20.0070.03811.78
5.3.10.0080.03611.75
5.3.00.0060.04011.73
5.2.170.0100.0359.23
5.2.160.0090.0339.23
5.2.150.0080.0299.22
5.2.140.0050.0419.22
5.2.130.0060.0399.19
5.2.120.0040.0299.18
5.2.110.0090.0309.19
5.2.100.0030.0379.18
5.2.90.0080.0339.18
5.2.80.0030.0379.18
5.2.70.0050.0329.18
5.2.60.0050.0359.13
5.2.50.0030.0389.10
5.2.40.0080.0369.07
5.2.30.0020.0439.05
5.2.20.0070.0319.05
5.2.10.0070.0358.95
5.2.00.0100.0278.82
5.1.60.0010.0278.10
5.1.50.0040.0278.09
5.1.40.0060.0258.08
5.1.30.0050.0258.42
5.1.20.0050.0258.45
5.1.10.0030.0278.17
5.1.00.0020.0288.17
5.0.50.0050.0196.65
5.0.40.0040.0196.51
5.0.30.0030.0326.32
5.0.20.0020.0216.28
5.0.10.0060.0206.27
5.0.00.0020.0326.25
4.4.90.0030.0164.78
4.4.80.0050.0134.75
4.4.70.0040.0144.75
4.4.60.0030.0154.76
4.4.50.0050.0134.77
4.4.40.0030.0254.71
4.4.30.0010.0174.76
4.4.20.0040.0184.85
4.4.10.0030.0154.85
4.4.00.0040.0244.76
4.3.110.0040.0144.67
4.3.100.0040.0144.67
4.3.90.0050.0124.63
4.3.80.0020.0254.59
4.3.70.0050.0194.63
4.3.60.0030.0184.63
4.3.50.0030.0154.63
4.3.40.0010.0264.54
4.3.30.0010.0173.30
4.3.20.0030.0153.28
4.3.10.0050.0133.23
4.3.00.0130.0237.13

preferences:
46.58 ms | 401 KiB | 5 Q