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 Test2('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.40.0090.00619.09
8.3.30.0110.00418.78
8.3.20.0050.00320.38
8.3.10.0040.00421.91
8.3.00.0070.00023.51
8.2.170.0070.00722.96
8.2.160.0070.00720.53
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0080.00019.64
8.2.120.0030.00526.35
8.2.110.0090.00022.30
8.2.100.0040.00717.91
8.2.90.0040.00419.05
8.2.80.0050.00318.03
8.2.70.0030.00617.38
8.2.60.0000.00817.91
8.2.50.0050.00318.07
8.2.40.0030.00522.36
8.2.30.0000.00719.25
8.2.20.0040.00417.56
8.2.10.0020.00517.87
8.2.00.0000.00717.98
8.1.270.0080.00023.91
8.1.260.0080.00028.09
8.1.250.0070.00028.09
8.1.240.0060.00322.11
8.1.230.0070.00419.05
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0060.00317.22
8.1.190.0040.00417.23
8.1.180.0000.00718.10
8.1.170.0000.00818.59
8.1.160.0030.00520.63
8.1.150.0000.00818.78
8.1.140.0030.00719.45
8.1.130.0040.00417.64
8.1.120.0030.00317.29
8.1.110.0040.00417.36
8.1.100.0030.00517.29
8.1.90.0040.00417.30
8.1.80.0040.00417.28
8.1.70.0070.00017.40
8.1.60.0080.00017.54
8.1.50.0060.00517.55
8.1.40.0040.00417.53
8.1.30.0050.00317.55
8.1.20.0060.00317.57
8.1.10.0040.00417.48
8.1.00.0040.00417.53
8.0.300.0080.00018.77
8.0.290.0040.00416.63
8.0.280.0070.00018.49
8.0.270.0000.00717.11
8.0.260.0030.00317.19
8.0.250.0000.00816.86
8.0.240.0070.00016.82
8.0.230.0080.00016.96
8.0.220.0040.00416.90
8.0.210.0030.00316.89
8.0.200.0030.00316.88
8.0.190.0000.00916.96
8.0.180.0070.00016.97
8.0.170.0000.00816.92
8.0.160.0030.00616.95
8.0.150.0030.00316.74
8.0.140.0040.00416.68
8.0.130.0040.00413.31
8.0.120.0040.00416.90
8.0.110.0000.00716.80
8.0.100.0000.00716.89
8.0.90.0040.00416.75
8.0.80.0070.01116.87
8.0.70.0040.00416.75
8.0.60.0040.00416.84
8.0.50.0060.00317.00
8.0.30.0080.01017.19
8.0.20.0100.01017.42
8.0.10.0000.00716.85
8.0.00.0100.00916.66
7.4.330.0050.00016.78
7.4.320.0030.00316.46
7.4.300.0060.00016.50
7.4.290.0000.00716.52
7.4.280.0030.00516.54
7.4.270.0030.00316.57
7.4.260.0000.00716.57
7.4.250.0070.00016.37
7.4.240.0050.00216.56
7.4.230.0030.00316.46
7.4.220.0100.00716.45
7.4.210.0110.00916.59
7.4.200.0030.00316.34
7.4.160.0030.01216.30
7.4.150.0080.01117.40
7.4.140.0080.01017.86
7.4.130.0150.00616.65
7.4.120.0080.00816.51
7.4.110.0120.00616.46
7.4.100.0100.00716.46
7.4.90.0070.01016.43
7.4.80.0090.00619.39
7.4.70.0040.01416.57
7.4.60.0080.00816.47
7.4.50.0070.01016.64
7.4.40.0070.01016.64
7.4.30.0140.00516.46
7.4.00.0070.01114.93
7.3.330.0000.00513.39
7.3.320.0070.00013.27
7.3.310.0000.00716.27
7.3.300.0030.00316.23
7.3.290.0100.00616.37
7.3.280.0100.00816.32
7.3.270.0100.00617.40
7.3.260.0090.00916.63
7.3.250.0130.00716.33
7.3.240.0060.01416.52
7.3.230.0090.00616.40
7.3.210.0130.00316.43
7.3.200.0100.01319.39
7.3.190.0120.00416.27
7.3.180.0100.00716.55
7.3.170.0070.01416.36
7.3.160.0100.00716.39
7.2.330.0120.00916.65
7.2.320.0030.01816.61
7.2.310.0160.00516.77
7.2.300.0160.00616.41
7.2.290.0110.00716.73
7.2.60.0100.00316.88
7.2.00.0120.00019.26
7.1.200.0070.00715.51
7.1.100.0080.00317.81
7.1.70.0040.00417.13
7.1.60.0130.01319.30
7.1.50.0030.01716.93
7.1.00.0000.08022.31
7.0.200.0000.00716.79
7.0.60.0100.06321.84
7.0.50.0070.08017.88
7.0.40.0030.05320.02
7.0.30.0330.04720.21
7.0.20.0330.07720.04
7.0.10.0030.04320.19
7.0.00.0030.05020.16
5.6.280.0030.03020.91
5.6.210.0200.06320.76
5.6.200.0100.07718.18
5.6.190.0070.06020.67
5.6.180.0430.04320.60
5.6.170.0400.06320.48
5.6.160.0070.08320.50
5.6.150.0000.04318.15
5.6.140.0070.07018.18
5.6.130.0100.06318.14
5.6.120.0070.08721.01
5.6.110.0170.08021.01
5.6.100.0170.06720.89
5.6.90.0130.09320.98
5.6.80.0030.05720.54
5.5.350.0230.07320.38
5.5.340.0030.04017.98
5.5.330.0000.04320.40
5.5.320.0300.04020.52
5.5.310.0370.07320.24
5.5.300.0070.08018.03
5.5.290.0070.07718.08
5.5.280.0130.05720.81
5.5.270.0030.04020.98
5.5.260.0200.06720.73
5.5.250.0070.04020.66
5.5.240.0130.07720.27

preferences:
51.78 ms | 400 KiB | 5 Q