3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Node { private $nodes = []; public function __construct(array $nodes = []) { $this->nodes = $nodes; } public function getCount() { return count($this->nodes); } public function getCountRecursive() { $count = 0; foreach ($this->nodes as $node) { $count += ($node->getCountRecursive() + 1); } return $count; } } $node = new Node([ new Node([ new Node([ new Node([ new Node(), new Node(), new Node(), ]). new Node(), new Node(), ]). new Node(), new Node(), ]). new Node(), ]); var_dump($node->getCount(), $node->getCountRecursive());

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.00318.68
8.3.50.0120.00622.99
8.3.40.0070.00718.83
8.3.30.0070.00719.18
8.3.20.0050.00220.16
8.3.10.0000.00823.63
8.3.00.0050.00319.51
8.2.180.0080.00816.35
8.2.170.0080.00622.96
8.2.160.0100.00320.16
8.2.150.0050.00224.18
8.2.140.0040.01124.66
8.2.130.0080.00026.16
8.2.120.0080.00021.04
8.2.110.0000.01022.30
8.2.100.0060.00617.91
8.2.90.0000.00819.28
8.2.80.0060.00317.97
8.2.70.0000.00817.63
8.2.60.0030.00617.91
8.2.50.0050.00318.07
8.2.40.0040.00420.01
8.2.30.0000.00718.01
8.2.20.0040.00417.74
8.2.10.0000.00718.05
8.2.00.0030.00617.67
8.1.280.0070.00725.92
8.1.270.0080.00024.02
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00323.85
8.1.230.0050.00519.10
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0140.00017.35
8.1.190.0050.00317.22
8.1.180.0030.00618.10
8.1.170.0080.00018.49
8.1.160.0000.00921.90
8.1.150.0070.00018.85
8.1.140.0070.00017.46
8.1.130.0030.00517.78
8.1.120.0000.00717.44
8.1.110.0060.00317.40
8.1.100.0050.00617.51
8.1.90.0030.00317.35
8.1.80.0040.00417.46
8.1.70.0080.00017.41
8.1.60.0000.00817.63
8.1.50.0040.00417.45
8.1.40.0040.00417.41
8.1.30.0000.00817.50
8.1.20.0060.00317.56
8.1.10.0040.00417.54
8.1.00.0040.00417.55
8.0.300.0000.00818.77
8.0.290.0000.00716.75
8.0.280.0030.00318.33
8.0.270.0040.00417.32
8.0.260.0030.00317.32
8.0.250.0030.00317.02
8.0.240.0070.00017.04
8.0.230.0000.00716.91
8.0.220.0000.00717.01
8.0.210.0000.00816.99
8.0.200.0040.00416.97
8.0.190.0050.00316.89
8.0.180.0000.00816.89
8.0.170.0050.00317.04
8.0.160.0040.00416.97
8.0.150.0000.01116.89
8.0.140.0040.00416.88
8.0.130.0030.00313.41
8.0.120.0040.00416.97
8.0.110.0050.00316.87
8.0.100.0070.00017.00
8.0.90.0040.00416.91
8.0.80.0060.01016.89
8.0.70.0000.00716.84
8.0.60.0070.00016.84
8.0.50.0090.00017.02
8.0.30.0130.00617.28
8.0.20.0070.01317.40
8.0.10.0040.00717.11
8.0.00.0070.01016.62
7.4.330.0030.00315.00
7.4.320.0000.00616.45
7.4.300.0030.00316.37
7.4.290.0040.00416.46
7.4.280.0050.00216.35
7.4.270.0000.00716.44
7.4.260.0000.00716.52
7.4.250.0050.00216.53
7.4.240.0060.00116.51
7.4.230.0080.00016.65
7.4.220.0070.01516.38
7.4.210.0060.00916.51
7.4.200.0080.00016.34
7.4.160.0040.01416.50
7.4.150.0170.00617.40
7.4.140.0090.00917.86
7.4.130.0110.01116.54
7.4.120.0060.01216.47
7.4.110.0140.00616.57
7.4.100.0100.00716.66
7.4.90.0150.00316.74
7.4.80.0030.01719.39
7.4.70.0080.01216.37
7.4.60.0100.00716.64
7.4.50.0000.00816.59
7.4.40.0130.00316.28
7.4.30.0080.00816.56
7.4.00.0080.00714.98
7.3.330.0000.00713.19
7.3.320.0050.00013.38
7.3.310.0040.00416.29
7.3.300.0030.00316.41
7.3.290.0130.00616.38
7.3.280.0100.00616.34
7.3.270.0110.00717.40
7.3.260.0140.00316.37
7.3.240.0070.01016.47
7.3.230.0060.01216.53
7.3.210.0030.01416.42
7.3.200.0060.01319.39
7.3.190.0160.00016.57
7.3.180.0060.01016.45
7.3.170.0060.01016.53
7.3.160.0140.00716.53
7.3.120.0040.01214.59
7.3.110.0100.00714.39
7.3.100.0060.00914.62
7.3.90.0130.00314.52
7.3.80.0060.01114.58
7.3.70.0000.01114.60
7.3.60.0000.01514.56
7.3.50.0110.00414.79
7.3.40.0100.00714.71
7.3.30.0000.00814.63
7.3.20.0040.01116.60
7.3.10.0040.00716.29
7.3.00.0000.01216.58
7.2.330.0120.00616.20
7.2.320.0070.01416.72
7.2.310.0110.01116.62
7.2.300.0160.02416.72
7.2.290.0040.01116.49
7.2.240.0030.01514.68
7.2.230.0080.00414.79
7.2.220.0000.01814.71
7.2.210.0060.00315.02
7.2.200.0090.00414.41
7.2.190.0070.01114.79
7.2.180.0030.01214.79
7.2.170.0100.00715.05
7.2.160.0060.00914.66
7.2.150.0030.01716.74
7.2.140.0070.00716.62
7.2.130.0040.01116.55
7.2.120.0090.00616.56
7.2.110.0090.00916.76
7.2.100.0090.00916.70
7.2.90.0070.01016.39
7.2.80.0070.00716.82
7.2.70.0080.00416.71
7.2.60.0130.01116.54
7.2.50.0040.01116.53
7.2.40.0030.01016.58
7.2.30.0000.01416.82
7.2.20.0100.00716.75
7.2.10.0080.00416.55
7.2.00.0070.00716.71
7.1.330.0090.00615.53
7.1.320.0090.00415.36
7.1.310.0070.00715.54
7.1.300.0060.00315.59
7.1.290.0040.00815.65
7.1.280.0040.01115.43
7.1.270.0030.00615.63
7.1.260.0030.00715.70
7.1.250.0030.01015.58
7.1.200.0100.00315.87
7.1.100.0100.00018.06
7.1.70.0030.00616.82
7.1.60.0130.00919.40
7.1.50.0070.01716.52
7.1.00.0030.07722.51
7.0.200.0070.00714.68
7.0.140.0030.07322.09
7.0.60.0130.06019.97
7.0.50.0000.06717.88
7.0.40.0000.04720.11
7.0.30.0370.07320.26
7.0.20.0300.05720.16
7.0.10.0030.07320.07
7.0.00.0100.07720.07
5.6.280.0100.06720.99
5.6.210.0070.06320.77
5.6.200.0130.07018.22
5.6.190.0030.04720.47
5.6.180.0200.06320.48
5.6.170.0170.04020.57
5.6.160.0170.08020.45
5.6.150.0070.04318.21
5.6.140.0070.07018.14
5.6.130.0100.04318.24
5.6.120.0070.07721.14
5.6.110.0030.04321.11
5.6.100.0070.04721.00
5.6.90.0170.07320.98
5.6.80.0130.07020.52
5.5.350.0330.07020.47
5.5.340.0030.07317.98
5.5.330.0030.09020.21
5.5.320.0400.06320.30
5.5.310.0170.04020.30
5.5.300.0170.04317.94
5.5.290.0130.07317.94
5.5.280.0200.07320.77
5.5.270.0000.08720.73
5.5.260.0230.07020.89
5.5.250.0070.04020.59
5.5.240.0070.07320.26
5.4.450.0870.05019.61
5.4.440.0130.05019.47
5.4.430.0570.06019.56
5.4.420.0370.05019.57
5.4.410.0030.05718.70
5.4.400.0330.05318.79
5.4.390.0400.04318.60
5.4.380.0100.06018.80
5.4.370.0270.04318.52
5.4.360.0200.04718.57
5.4.350.0070.04012.03
5.4.340.0080.03812.02
5.4.320.0040.03912.51
5.4.310.0050.04112.50
5.4.300.0100.03812.50
5.4.290.0080.03912.50
5.4.280.0100.04712.40
5.4.270.0030.04412.39
5.4.260.0100.04012.40
5.4.250.0060.03812.39
5.4.240.0030.04012.40
5.4.230.0070.03612.39
5.4.220.0060.03612.39
5.4.210.0050.03712.39
5.4.200.0030.04912.39
5.4.190.0040.03912.38
5.4.180.0090.03712.39
5.4.170.0110.04112.40
5.4.160.0090.03912.39
5.4.150.0130.05512.39
5.4.140.0080.05312.07
5.4.130.0050.03912.06
5.4.120.0060.03512.02
5.4.110.0050.03812.02
5.4.100.0070.04712.02
5.4.90.0120.04312.02
5.4.80.0120.04712.02
5.4.70.0120.04412.02
5.4.60.0070.04412.01
5.4.50.0060.03612.01
5.4.40.0090.03612.00
5.4.30.0050.03811.99
5.4.20.0070.03612.00
5.4.10.0070.03512.00
5.4.00.0090.03311.49
5.3.290.0050.04612.80
5.3.280.0070.03912.71
5.3.270.0070.04312.72
5.3.260.0110.03712.71
5.3.250.0060.04312.72
5.3.240.0080.04012.72
5.3.230.0080.03812.71
5.3.220.0080.04112.68
5.3.210.0050.04412.68
5.3.200.0040.04012.68
5.3.190.0070.03712.68
5.3.180.0080.03612.68
5.3.170.0090.03412.67
5.3.160.0040.03812.67
5.3.150.0070.03812.67
5.3.140.0060.03712.66
5.3.130.0100.04212.66
5.3.120.0070.03912.65
5.3.110.0090.03812.66
5.3.100.0100.03412.12
5.3.90.0070.03812.12
5.3.80.0090.04312.09
5.3.70.0120.04112.09
5.3.60.0070.04012.08
5.3.50.0070.03612.02
5.3.40.0040.03812.02
5.3.30.0060.03611.98
5.3.20.0080.03411.75
5.3.10.0050.03811.73
5.3.00.0040.03811.71
5.2.170.0020.0339.21
5.2.160.0050.0299.21
5.2.150.0050.0309.21
5.2.140.0060.0299.20
5.2.130.0040.0299.16
5.2.120.0020.0379.17
5.2.110.0070.0269.18
5.2.100.0030.0339.18
5.2.90.0040.0329.17
5.2.80.0070.0389.17
5.2.70.0070.0429.17
5.2.60.0070.0299.13
5.2.50.0080.0299.10
5.2.40.0080.0279.07
5.2.30.0050.0359.04
5.2.20.0060.0289.04
5.2.10.0040.0288.94
5.2.00.0040.0308.80
5.1.60.0060.0228.08
5.1.50.0040.0248.09
5.1.40.0040.0248.07
5.1.30.0010.0298.41
5.1.20.0060.0268.43
5.1.10.0030.0288.16
5.1.00.0070.0308.16
5.0.50.0030.0216.64
5.0.40.0060.0216.50
5.0.30.0040.0396.30
5.0.20.0030.0266.27
5.0.10.0060.0186.26
5.0.00.0030.0376.25
4.4.90.0040.0144.78
4.4.80.0020.0184.75
4.4.70.0020.0204.75
4.4.60.0020.0164.75
4.4.50.0030.0204.77
4.4.40.0030.0314.71
4.4.30.0060.0134.76
4.4.20.0020.0174.85
4.4.10.0020.0204.85
4.4.00.0030.0264.76
4.3.110.0030.0164.66
4.3.100.0030.0144.66
4.3.90.0030.0154.63
4.3.80.0030.0294.58
4.3.70.0010.0204.63
4.3.60.0060.0244.63
4.3.50.0030.0164.63
4.3.40.0030.0314.54
4.3.30.0020.0163.30
4.3.20.0030.0233.28
4.3.10.0030.0163.24
4.3.00.0000.0237.13

preferences:
36.98 ms | 401 KiB | 5 Q