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.0140.00718.39
8.3.50.0170.00319.73
8.3.40.0110.00418.84
8.3.30.0100.00319.22
8.3.20.0040.00420.39
8.3.10.0080.00023.48
8.3.00.0080.00019.26
8.2.180.0100.01025.92
8.2.170.0130.01018.83
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00421.00
8.2.110.0100.00021.93
8.2.100.0060.00618.03
8.2.90.0050.00519.19
8.2.80.0000.00817.97
8.2.70.0000.00917.50
8.2.60.0050.00217.93
8.2.50.0050.00318.07
8.2.40.0000.00820.01
8.2.30.0000.00718.14
8.2.20.0040.00417.66
8.2.10.0000.00718.07
8.2.00.0000.00917.63
8.1.270.0060.00324.66
8.1.260.0030.00526.35
8.1.250.0000.00828.09
8.1.240.0030.00723.92
8.1.230.0040.00819.10
8.1.220.0050.00317.79
8.1.210.0000.00818.77
8.1.200.0030.00617.48
8.1.190.0040.00417.25
8.1.180.0030.00518.10
8.1.170.0060.00318.66
8.1.160.0020.00522.02
8.1.150.0040.00418.95
8.1.140.0070.00017.51
8.1.130.0030.00317.84
8.1.120.0020.00517.52
8.1.110.0040.00417.43
8.1.100.0030.00617.48
8.1.90.0040.00417.30
8.1.80.0000.00717.49
8.1.70.0000.00717.34
8.1.60.0000.00817.52
8.1.50.0000.00817.41
8.1.40.0000.00817.55
8.1.30.0040.00417.60
8.1.20.0040.00417.61
8.1.10.0060.00317.52
8.1.00.0000.00817.50
8.0.300.0000.00718.77
8.0.290.0000.00816.75
8.0.280.0000.00718.38
8.0.270.0000.00717.27
8.0.260.0000.00717.28
8.0.250.0070.00016.93
8.0.240.0070.00016.97
8.0.230.0070.00316.95
8.0.220.0070.00016.91
8.0.210.0000.00716.90
8.0.200.0000.00716.94
8.0.190.0050.00316.97
8.0.180.0030.00316.97
8.0.170.0000.00816.88
8.0.160.0020.00516.84
8.0.150.0040.00416.84
8.0.140.0030.00616.86
8.0.130.0000.00513.38
8.0.120.0040.00416.85
8.0.110.0000.00716.91
8.0.100.0000.00816.85
8.0.90.0030.00316.93
8.0.80.0090.00616.91
8.0.70.0040.00416.73
8.0.60.0000.00716.78
8.0.50.0040.00416.94
8.0.30.0110.01117.01
8.0.20.0150.00817.40
8.0.10.0060.00316.87
8.0.00.0050.01216.65
7.4.330.0000.00515.00
7.4.320.0000.00616.42
7.4.300.0000.00616.52
7.4.290.0000.00816.60
7.4.280.0040.00416.62
7.4.270.0000.00716.53
7.4.260.0050.00216.50
7.4.250.0060.00316.58
7.4.240.0060.00216.60
7.4.230.0080.00016.46
7.4.220.0080.01916.62
7.4.210.0030.01016.62
7.4.200.0040.00416.41
7.4.160.0100.00616.75
7.4.150.0070.01117.40
7.4.140.0110.00817.86
7.4.130.0130.00716.42
7.4.120.0140.00416.63
7.4.110.0060.01016.70
7.4.100.0060.01516.45
7.4.90.0100.01016.52
7.4.80.0060.01819.39
7.4.70.0070.01116.37
7.4.60.0000.01616.48
7.4.50.0000.00816.30
7.4.40.0070.01016.48
7.4.30.0080.00816.61
7.4.00.0060.01014.90
7.3.330.0060.00013.27
7.3.320.0050.00013.17
7.3.310.0030.00316.38
7.3.300.0070.00016.32
7.3.290.0070.01016.21
7.3.280.0100.00916.25
7.3.270.0070.01017.40
7.3.260.0130.01016.39
7.3.250.0090.00916.38
7.3.240.0090.00916.50
7.3.230.0060.01516.57
7.3.210.0000.01816.34
7.3.200.0090.00616.38
7.3.190.0060.00916.36
7.3.180.0000.01716.35
7.3.170.0070.01016.56
7.3.160.0130.00316.49
7.3.120.0130.00614.73
7.3.110.0070.01115.01
7.3.100.0060.00614.75
7.3.90.0100.00315.03
7.3.80.0150.00014.72
7.3.70.0150.00314.88
7.3.60.0040.01114.79
7.3.50.0030.01014.67
7.3.40.0080.00414.56
7.3.30.0090.00014.47
7.3.20.0120.00416.75
7.3.10.0060.00816.61
7.3.00.0100.00316.70
7.2.330.0090.00916.56
7.2.320.0110.00616.44
7.2.310.0100.00716.62
7.2.300.0240.02016.75
7.2.290.0140.00316.83
7.2.250.0030.01715.29
7.2.240.0130.00315.34
7.2.230.0060.00915.09
7.2.220.0120.00414.94
7.2.210.0000.01515.05
7.2.200.0030.01615.19
7.2.190.0040.01115.16
7.2.180.0000.01415.07
7.2.170.0070.00715.29
7.2.60.0060.00317.05
7.1.330.0040.00815.76
7.1.320.0100.00315.65
7.1.310.0100.00715.96
7.1.300.0070.00415.61
7.1.290.0110.00415.64
7.1.280.0040.00815.58
7.1.270.0070.00715.88
7.1.260.0040.00415.82
7.1.200.0140.00015.80
7.1.70.0030.00617.01
7.1.60.0060.01919.40
7.1.50.0090.01516.97
7.1.00.0070.07322.44
7.0.200.0130.00714.91
7.0.140.0000.07721.95
7.0.60.0370.06019.99
7.0.50.0070.05717.90
7.0.40.0030.05020.20
7.0.30.0270.04320.13
7.0.20.0330.06720.24
7.0.10.0100.07720.33
7.0.00.0130.03720.29
5.6.280.0000.07721.05
5.6.210.0070.03720.62
5.6.200.0130.07718.19
5.6.190.0000.04720.48
5.6.180.0200.08020.50
5.6.170.0130.07020.46
5.6.160.0030.07020.45
5.6.150.0030.05718.16
5.6.140.0070.08018.29
5.6.130.0070.07718.15
5.6.120.0070.08721.00
5.6.110.0030.07321.14
5.6.100.0100.04721.05
5.6.90.0100.05320.99
5.6.80.0100.05320.49
5.5.350.0270.07020.45
5.5.340.0000.04317.98
5.5.330.0070.07720.43
5.5.320.0200.04320.28
5.5.310.0100.04720.28
5.5.300.0030.05017.98
5.5.290.0030.05017.98
5.5.280.0100.04020.98
5.5.270.0030.09020.96
5.5.260.0100.06720.96
5.5.250.0100.07020.66
5.5.240.0230.07020.16
5.4.450.0770.05319.48
5.4.440.0530.05319.39
5.4.430.0030.06319.38
5.4.420.0600.06019.59
5.4.410.0070.05718.97
5.4.400.0330.05018.84
5.4.390.0270.05018.47
5.4.380.0100.05018.48
5.4.370.0130.05018.76
5.4.360.0270.04318.73
5.4.350.0100.03512.03
5.4.340.0060.03712.02
5.4.320.0020.03912.51
5.4.310.0040.04012.50
5.4.300.0040.03912.50
5.4.290.0020.04212.50
5.4.280.0050.03712.39
5.4.270.0090.04112.39
5.4.260.0050.04212.40
5.4.250.0110.03112.40
5.4.240.0080.03312.40
5.4.230.0050.04012.39
5.4.220.0080.03512.39
5.4.210.0060.03712.39
5.4.200.0090.04512.39
5.4.190.0050.03612.39
5.4.180.0060.04012.38
5.4.170.0030.03812.40
5.4.160.0120.03512.39
5.4.150.0090.03512.39
5.4.140.0070.04612.07
5.4.130.0080.03812.06
5.4.120.0080.04112.02
5.4.110.0090.04612.02
5.4.100.0080.04112.01
5.4.90.0070.03712.02
5.4.80.0110.04012.02
5.4.70.0050.03812.01
5.4.60.0080.04112.02
5.4.50.0070.04012.02
5.4.40.0060.03912.00
5.4.30.0040.04112.00
5.4.20.0040.03612.00
5.4.10.0070.04712.00
5.4.00.0080.03411.48
5.3.290.0070.05412.80
5.3.280.0070.04312.71
5.3.270.0090.04512.72
5.3.260.0080.04912.72
5.3.250.0070.03512.72
5.3.240.0110.03712.72
5.3.230.0080.04412.71
5.3.220.0030.04012.68
5.3.210.0080.05512.68
5.3.200.0110.03912.68
5.3.190.0060.04512.68
5.3.180.0050.03812.67
5.3.170.0070.04412.67
5.3.160.0090.05312.68
5.3.150.0120.03812.68
5.3.140.0050.03612.66
5.3.130.0080.04812.65
5.3.120.0070.03712.66
5.3.110.0050.03912.66
5.3.100.0080.04912.12
5.3.90.0070.04712.10
5.3.80.0070.04312.09
5.3.70.0080.06112.09
5.3.60.0040.03912.07
5.3.50.0060.03412.02
5.3.40.0100.03112.02
5.3.30.0060.03411.98
5.3.20.0040.03511.75
5.3.10.0040.03511.73
5.3.00.0060.03511.71
5.2.170.0060.0329.21
5.2.160.0060.0399.21
5.2.150.0060.0309.21
5.2.140.0050.0299.21
5.2.130.0050.0289.17
5.2.120.0120.0249.17
5.2.110.0050.0439.18
5.2.100.0020.0369.17
5.2.90.0050.0399.17
5.2.80.0020.0329.17
5.2.70.0060.0289.17
5.2.60.0070.0469.13
5.2.50.0060.0299.09
5.2.40.0070.0299.07
5.2.30.0060.0389.05
5.2.20.0070.0289.04
5.2.10.0050.0298.94
5.2.00.0070.0278.80
5.1.60.0050.0238.09
5.1.50.0050.0248.08
5.1.40.0060.0238.06
5.1.30.0060.0248.41
5.1.20.0060.0258.43
5.1.10.0100.0228.16
5.1.00.0030.0268.16
5.0.50.0010.0246.64
5.0.40.0040.0196.50
5.0.30.0040.0306.31
5.0.20.0040.0186.27
5.0.10.0040.0206.26
5.0.00.0070.0356.25
4.4.90.0030.0204.78
4.4.80.0020.0164.75
4.4.70.0050.0144.75
4.4.60.0010.0184.75
4.4.50.0000.0194.77
4.4.40.0040.0244.71
4.4.30.0040.0164.75
4.4.20.0000.0194.84
4.4.10.0030.0164.85
4.4.00.0030.0254.76
4.3.110.0040.0144.67
4.3.100.0070.0174.66
4.3.90.0040.0194.63
4.3.80.0030.0264.58
4.3.70.0050.0124.63
4.3.60.0040.0194.63
4.3.50.0020.0174.62
4.3.40.0050.0224.54
4.3.30.0000.0183.30
4.3.20.0020.0163.28
4.3.10.0030.0153.24
4.3.00.0100.0207.13

preferences:
64.52 ms | 400 KiB | 5 Q