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.'; } } class Test2 { public function baz(Test $other) { // We can change the private property: $other->foo = 'hello'; var_dump($other->foo); // We can also call the private method: $other->bar(); } } $test = new Test('test'); $test->baz(new Test('other'));

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.0090.00916.63
8.3.50.0090.01321.28
8.3.40.0060.00918.79
8.3.30.0110.00419.02
8.3.20.0050.00320.16
8.3.10.0040.00421.80
8.3.00.0040.00423.50
8.2.180.0100.00616.59
8.2.170.0170.00322.96
8.2.160.0130.00020.32
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00019.76
8.2.120.0040.00426.35
8.2.110.0050.00522.25
8.2.100.0060.00617.91
8.2.90.0030.00518.91
8.2.80.0050.00317.97
8.2.70.0030.00617.38
8.2.60.0000.00717.92
8.2.50.0050.00318.07
8.2.40.0000.00822.34
8.2.30.0000.00719.26
8.2.20.0000.00817.68
8.2.10.0050.00317.87
8.2.00.0050.00217.87
8.1.280.0100.01025.92
8.1.270.0040.00424.01
8.1.260.0080.00028.09
8.1.250.0070.00028.09
8.1.240.0080.00022.06
8.1.230.0100.00019.04
8.1.220.0080.00017.74
8.1.210.0080.00018.77
8.1.200.0040.00417.35
8.1.190.0050.00317.22
8.1.180.0070.00018.10
8.1.170.0040.00418.57
8.1.160.0000.00720.68
8.1.150.0050.00218.76
8.1.140.0040.00819.51
8.1.130.0040.00417.56
8.1.120.0040.00417.29
8.1.110.0000.00817.27
8.1.100.0060.00317.37
8.1.90.0000.00717.43
8.1.80.0040.00417.32
8.1.70.0030.00317.41
8.1.60.0080.00017.64
8.1.50.0110.00017.49
8.1.40.0000.00817.55
8.1.30.0000.00817.69
8.1.20.0040.00417.63
8.1.10.0000.00917.59
8.1.00.0080.00017.52
8.0.300.0000.00718.77
8.0.290.0050.00316.75
8.0.280.0070.00018.38
8.0.270.0050.00317.11
8.0.260.0040.00417.18
8.0.250.0000.00617.00
8.0.240.0040.00416.84
8.0.230.0030.00316.95
8.0.220.0000.00716.85
8.0.210.0040.00416.86
8.0.200.0000.00616.82
8.0.190.0080.00016.95
8.0.180.0050.00216.81
8.0.170.0040.00416.93
8.0.160.0040.00416.85
8.0.150.0000.00716.93
8.0.140.0020.00516.85
8.0.130.0000.00513.30
8.0.120.0040.00416.87
8.0.110.0040.00416.92
8.0.100.0000.00716.84
8.0.90.0080.00016.87
8.0.80.0090.00616.80
8.0.70.0040.00416.88
8.0.60.0000.00816.70
8.0.50.0040.00416.84
8.0.30.0090.01117.04
8.0.20.0170.00317.40
8.0.10.0030.00516.83
8.0.00.0130.00616.95
7.4.330.0030.00316.84
7.4.320.0060.00016.59
7.4.300.0050.00316.49
7.4.290.0050.00216.59
7.4.280.0080.00016.51
7.4.270.0070.00016.52
7.4.260.0040.00416.54
7.4.250.0070.00016.48
7.4.240.0000.00816.54
7.4.230.0030.00316.40
7.4.220.0100.01316.43
7.4.210.0110.00316.51
7.4.200.0030.00316.48
7.4.160.0100.00616.54
7.4.150.0120.00617.40
7.4.140.0100.00817.86
7.4.130.0070.01616.57
7.4.120.0080.01016.64
7.4.110.0060.01616.43
7.4.100.0070.01016.62
7.4.90.0090.00916.40
7.4.80.0070.01419.39
7.4.70.0140.00316.43
7.4.60.0130.00316.57
7.4.50.0060.00916.48
7.4.40.0030.01416.70
7.4.30.0100.01316.64
7.4.00.0060.01014.93
7.3.330.0000.00513.10
7.3.320.0050.00313.19
7.3.310.0000.00716.27
7.3.300.0040.00416.35
7.3.290.0120.00616.35
7.3.280.0130.00616.36
7.3.270.0100.00717.40
7.3.260.0170.00016.62
7.3.250.0090.00816.27
7.3.240.0080.01416.41
7.3.230.0030.01316.39
7.3.210.0030.01316.60
7.3.200.0100.00719.39
7.3.190.0100.00716.45
7.3.180.0120.00616.45
7.3.170.0080.00816.40
7.3.160.0040.01116.30
7.3.120.0060.01114.96
7.3.110.0030.01314.76
7.3.100.0090.00714.93
7.3.90.0040.00814.83
7.3.80.0070.00614.72
7.3.70.0080.00514.89
7.3.60.0020.01014.83
7.3.50.0060.00514.86
7.3.40.0060.00614.73
7.3.30.0050.00514.78
7.3.20.0090.00316.77
7.3.10.0040.00916.46
7.3.00.0030.00816.53
7.2.330.0190.00716.64
7.2.320.0070.01016.45
7.2.310.0200.00416.36
7.2.300.0070.01416.39
7.2.290.0090.00816.61
7.2.250.0060.01314.95
7.2.240.0060.01314.92
7.2.230.0090.00815.02
7.2.220.0040.00815.09
7.2.210.0070.00714.85
7.2.200.0040.01114.90
7.2.190.0040.01114.76
7.2.180.0020.01215.07
7.2.170.0060.00814.93
7.2.130.0120.00316.60
7.2.120.0030.00916.76
7.2.110.0060.00916.80
7.2.100.0070.00716.65
7.2.90.0110.00416.64
7.2.80.0100.00716.80
7.2.70.0030.01016.88
7.2.60.0030.01016.79
7.2.50.0040.01116.74
7.2.40.0030.01216.92
7.2.30.0100.00616.82
7.2.20.0070.00416.84
7.2.10.0100.00616.78
7.2.00.0010.01217.96
7.1.330.0050.00915.66
7.1.320.0020.00815.61
7.1.310.0030.01015.79
7.1.300.0060.00615.74
7.1.290.0060.00815.70
7.1.280.0060.00915.70
7.1.270.0030.00815.61
7.1.260.0010.00915.60
7.1.250.0060.00615.41
7.1.200.0000.01215.59
7.1.100.0060.00618.17
7.1.70.0030.01316.75
7.1.60.0070.01319.30
7.1.50.0030.01016.80
7.1.00.0070.07322.28
7.0.200.0000.00816.88
7.0.60.0070.03721.73
7.0.50.0100.07017.96
7.0.40.0070.08020.16
7.0.30.0230.05320.08
7.0.20.0270.09020.12
7.0.10.0030.04320.23
7.0.00.0030.05720.27
5.6.280.0000.03321.00
5.6.210.0130.06320.70
5.6.200.0030.05018.29
5.6.190.0070.04320.63
5.6.180.0570.05720.68
5.6.170.0370.07020.50
5.6.160.0130.06320.54
5.6.150.0100.07718.13
5.6.140.0070.03718.18
5.6.130.0000.06018.19
5.6.120.0100.08721.05
5.6.110.0000.07721.14
5.6.100.0030.06020.99
5.6.90.0130.08021.13
5.6.80.0100.08020.44
5.5.350.0130.08320.35
5.5.340.0070.07317.98
5.5.330.0000.04720.27
5.5.320.0670.07320.36
5.5.310.0270.07720.31
5.5.300.0030.08718.04
5.5.290.0100.08317.95
5.5.280.0170.07320.68
5.5.270.0130.04020.76
5.5.260.0200.04320.65
5.5.250.0070.07020.54
5.5.240.0230.05720.07

preferences:
76.66 ms | 401 KiB | 5 Q