3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $foo; public function __construct($foo) { $this->foo = $foo; } private function bar() { echo 'Accessed the private method.'; } public function baz(Test $other) { // We can change the private property: $other->foo = 'hello'; echo $other->foo; // We can also call the private method: $other->bar(); } private function getFoo(){ return $this->foo; } } $test = new Test('test'); $test->baz(new Test('other')); echo $test->getFoo(); ?>

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.00418.68
8.3.50.0270.00321.95
8.3.40.0110.00418.78
8.3.30.0110.00419.07
8.3.20.0040.00420.00
8.3.10.0050.00322.13
8.3.00.0040.00422.46
8.2.180.0110.00716.75
8.2.170.0070.00722.96
8.2.160.0100.00321.04
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0000.00817.75
8.2.110.0060.00322.07
8.2.100.0080.00417.78
8.2.90.0000.00819.28
8.2.80.0050.00317.97
8.2.70.0090.00617.25
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0000.00818.16
8.2.30.0000.00817.91
8.2.20.0040.00417.80
8.2.10.0090.00019.45
8.2.00.0040.00417.57
8.1.280.0140.00025.92
8.1.270.0040.00421.91
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00023.96
8.1.230.0080.00319.11
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0090.00017.23
8.1.190.0040.00417.41
8.1.180.0000.00818.10
8.1.170.0030.00618.71
8.1.160.0030.00521.96
8.1.150.0000.00818.57
8.1.140.0050.00317.32
8.1.130.0000.00717.84
8.1.120.0040.00417.45
8.1.110.0000.00717.37
8.1.100.0080.00017.42
8.1.90.0040.00417.34
8.1.80.0030.00517.39
8.1.70.0070.00017.34
8.1.60.0040.00417.62
8.1.50.0040.00417.55
8.1.40.0050.00317.54
8.1.30.0000.00817.66
8.1.20.0000.00817.55
8.1.10.0070.00017.63
8.1.00.0030.00617.58
8.0.300.0000.00718.77
8.0.290.0050.00217.18
8.0.280.0120.00318.33
8.0.270.0040.00417.23
8.0.260.0030.00316.98
8.0.250.0000.00717.08
8.0.240.0000.01017.05
8.0.230.0030.00316.87
8.0.220.0070.00016.88
8.0.210.0000.00716.84
8.0.200.0060.00016.93
8.0.190.0050.00216.92
8.0.180.0000.00916.84
8.0.170.0000.00716.94
8.0.160.0050.00316.88
8.0.150.0050.00216.89
8.0.140.0040.00416.89
8.0.130.0050.00313.42
8.0.120.0040.00416.88
8.0.110.0000.00816.79
8.0.100.0030.00516.71
8.0.90.0000.00716.89
8.0.80.0080.00816.96
8.0.70.0040.00416.87
8.0.60.0080.00016.91
8.0.50.0040.00416.85
8.0.30.0130.01017.11
8.0.20.0120.01217.40
8.0.10.0040.00417.09
8.0.00.0100.00816.75
7.4.330.0000.00515.06
7.4.320.0030.00316.34
7.4.300.0030.00316.56
7.4.290.0000.00716.49
7.4.280.0080.00016.41
7.4.270.0030.00316.59
7.4.260.0040.00416.64
7.4.250.0000.00716.57
7.4.240.0040.00416.61
7.4.230.0080.00016.59
7.4.220.0090.00916.57
7.4.210.0050.01016.52
7.4.200.0040.00416.35
7.4.190.0070.00016.46
7.4.160.0070.01016.60
7.4.150.0140.00317.40
7.4.140.0140.01117.86
7.4.130.0050.01316.54
7.4.120.0060.01216.44
7.4.110.0150.00316.41
7.4.100.0180.00416.49
7.4.90.0070.01016.70
7.4.80.0130.00419.39
7.4.70.0000.01716.70
7.4.60.0030.01316.67
7.4.50.0000.00916.43
7.4.40.0110.00422.77
7.4.30.0100.00616.52
7.4.00.0070.01015.10
7.3.330.0050.00013.38
7.3.320.0030.00313.38
7.3.310.0030.00316.37
7.3.300.0000.00716.40
7.3.290.0070.00716.40
7.3.280.0080.01116.38
7.3.270.0060.01617.40
7.3.260.0120.00916.37
7.3.250.0110.00816.46
7.3.240.0080.00816.47
7.3.230.0100.00716.39
7.3.210.0110.00616.35
7.3.200.0070.01019.39
7.3.190.0120.00616.50
7.3.180.0160.00316.31
7.3.170.0030.01416.29
7.3.160.0150.00016.61
7.3.120.0000.01414.83
7.3.10.0070.00716.56
7.3.00.0000.01016.41
7.2.330.0080.00916.67
7.2.320.0070.01316.48
7.2.310.0190.00316.40
7.2.300.0170.00016.48
7.2.290.0090.00916.70
7.2.130.0000.01217.16
7.2.120.0110.00316.71
7.2.110.0080.00317.09
7.2.100.0100.00016.82
7.2.90.0040.00816.86
7.2.80.0070.00716.83
7.2.70.0000.01517.01
7.2.60.0030.00816.82
7.2.50.0080.00316.97
7.2.40.0030.01116.54
7.2.30.0060.00916.84
7.2.20.0030.01316.64
7.2.10.0090.00616.88
7.2.00.0070.00618.23
7.1.250.0030.00815.70
7.1.200.0000.01515.79
7.1.100.0060.00617.99
7.1.70.0020.00517.02
7.1.60.0100.01419.82
7.1.50.0070.01516.89
7.1.00.0100.07022.27
7.0.200.0050.01016.79
7.0.140.0070.07021.99
7.0.60.0130.07719.80
7.0.50.0200.07317.86
7.0.40.0070.04320.26
7.0.30.0400.07320.23
7.0.20.0330.07020.23
7.0.10.0030.09020.12
7.0.00.0030.05720.09
5.6.280.0070.06721.11
5.6.210.0070.07720.51
5.6.200.0130.07718.14
5.6.190.0200.07320.59
5.6.180.0030.04320.42
5.6.170.0270.06720.44
5.6.160.0070.07720.50
5.6.150.0000.09018.18
5.6.140.0070.05318.18
5.6.130.0070.06018.21
5.6.120.0100.05021.12
5.6.110.0100.07721.02
5.6.100.0130.05721.14
5.6.90.0100.04021.11
5.6.80.0000.06320.57
5.5.350.0100.07020.42
5.5.340.0070.08018.08
5.5.330.0000.04320.19
5.5.320.0230.03720.27
5.5.310.0230.04020.30
5.5.300.0130.06017.95
5.5.290.0000.04318.01
5.5.280.0170.07320.66
5.5.270.0030.08020.79
5.5.260.0030.04020.98
5.5.250.0100.08320.59
5.5.240.0100.05320.16
5.4.450.0400.04319.55
5.4.440.0030.05319.41
5.4.430.0370.04019.55
5.4.420.0430.04019.21
5.4.410.0100.05319.07
5.4.400.0070.05318.80
5.4.390.0070.05318.62
5.4.380.0200.05718.70
5.4.370.0170.05318.72
5.4.360.0170.05018.77
5.4.350.0130.06318.77
5.4.340.0300.04318.80
5.4.320.0060.03612.50
5.4.310.0090.04012.50
5.4.300.0080.03612.50
5.4.290.0110.03412.50
5.4.280.0060.03612.40
5.4.270.0030.03712.37
5.4.260.0020.04012.37
5.4.250.0050.03712.37
5.4.240.0050.04012.36
5.4.230.0050.03712.36
5.4.220.0050.03512.36
5.4.210.0090.03312.36
5.4.200.0050.03612.36
5.4.190.0080.03612.36
5.4.180.0040.04112.35
5.4.170.0050.03612.36
5.4.160.0090.03812.36
5.4.150.0070.03312.35
5.4.140.0040.03812.04
5.4.130.0060.03412.02
5.4.120.0040.03611.98
5.4.110.0040.03711.98
5.4.100.0080.03311.98
5.4.90.0060.03611.98
5.4.80.0060.03711.98
5.4.70.0020.04011.97
5.4.60.0060.03611.98
5.4.50.0070.03311.98
5.4.40.0030.03611.96
5.4.30.0040.03711.96
5.4.20.0050.03511.96
5.4.10.0060.03411.96
5.4.00.0050.03611.45
5.3.290.0090.04012.80
5.3.280.0100.03312.71
5.3.270.0050.03912.72
5.3.260.0050.03912.72
5.3.250.0050.03712.72
5.3.240.0060.03612.72
5.3.230.0030.04012.71
5.3.220.0050.04112.68
5.3.210.0070.03612.68
5.3.200.0060.03412.68
5.3.190.0090.04312.68
5.3.180.0060.03512.67
5.3.170.0080.03512.67
5.3.160.0030.03812.67
5.3.150.0030.04412.68
5.3.140.0060.04712.66
5.3.130.0050.03912.66
5.3.120.0080.04312.66
5.3.110.0060.04512.65
5.3.100.0050.04312.12
5.3.90.0060.03512.08
5.3.80.0070.03512.07
5.3.70.0030.03812.08
5.3.60.0090.03212.06
5.3.50.0050.03512.00
5.3.40.0090.03612.00
5.3.30.0080.03111.96
5.3.20.0080.03211.73
5.3.10.0100.03511.71
5.3.00.0100.03611.69
5.2.170.0020.0329.19
5.2.160.0040.0299.19
5.2.150.0060.0289.19
5.2.140.0050.0349.19
5.2.130.0040.0289.14
5.2.120.0040.0279.14
5.2.110.0020.0319.16
5.2.100.0050.0279.15
5.2.90.0060.0319.15
5.2.80.0040.0299.14
5.2.70.0030.0339.14
5.2.60.0030.0379.11
5.2.50.0030.0309.07
5.2.40.0050.0279.05
5.2.30.0010.0329.02
5.2.20.0000.0329.02
5.2.10.0030.0338.93
5.2.00.0050.0318.77
5.1.60.0010.0278.06
5.1.50.0040.0288.06
5.1.40.0070.0258.05
5.1.30.0020.0398.39
5.1.20.0040.0338.42
5.1.10.0030.0268.14
5.1.00.0070.0308.14
5.0.50.0030.0206.62
5.0.40.0100.0206.48
5.0.30.0000.0346.29
5.0.20.0020.0206.26
5.0.10.0030.0206.24
5.0.00.0040.0376.23
4.4.90.0030.0144.78
4.4.80.0050.0124.75
4.4.70.0010.0164.75
4.4.60.0030.0144.76
4.4.50.0010.0164.77
4.4.40.0000.0274.71
4.4.30.0020.0164.76
4.4.20.0030.0144.84
4.4.10.0020.0164.84
4.4.00.0030.0244.76
4.3.110.0040.0144.67
4.3.100.0020.0154.66
4.3.90.0000.0174.64
4.3.80.0040.0234.59
4.3.70.0040.0134.63
4.3.60.0010.0164.63
4.3.50.0030.0154.63
4.3.40.0020.0244.54
4.3.30.0040.0143.29
4.3.20.0030.0143.27
4.3.10.0030.0143.23
4.3.00.0130.01315.07

preferences:
44.45 ms | 401 KiB | 5 Q