3v4l.org

run code in 300+ PHP versions simultaneously
<?php class InCommon { private $baz = 'foo'; public function out($pref){ echo "\n".$pref.'::$baz = '.$this->baz; } } class Foo extends InCommon {} class Bar extends InCommon { public function peek($target, $label){ echo "\n".'peek @'.$label.'::$baz = '.$target->baz; // we see the effects of our modification } public function mess($target){ $target->baz = 'cats'; // "private" isn't private? } } $foo = new Foo(); $bar = new Bar(); $bar->mess($foo); // why does this throw an error about modifying a private? $bar->peek($foo, 'Foo'); // this is cats... so I access a private, and it has the value I changed it to $foo->out('Foo'); // echoing its own $baz, should be "cats", but it isn't

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.0120.00318.72
8.3.30.0140.00019.07
8.3.20.0040.00420.31
8.3.10.0060.00320.52
8.3.00.0030.00619.38
8.2.170.0150.00022.96
8.2.160.0070.00720.43
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00422.06
8.2.110.0050.00522.20
8.2.100.0080.00317.72
8.2.90.0050.00319.05
8.2.80.0000.00817.97
8.2.70.0060.00317.50
8.2.60.0050.00318.04
8.2.50.0030.00618.07
8.2.40.0000.00818.16
8.2.30.0040.00419.32
8.2.20.0040.00417.61
8.2.10.0050.00318.11
8.2.00.0030.00517.73
8.1.270.0080.00023.84
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0030.00623.81
8.1.230.0040.00721.00
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0100.00017.35
8.1.190.0000.00817.35
8.1.180.0050.00318.10
8.1.170.0090.00218.59
8.1.160.0060.00321.98
8.1.150.0000.00718.89
8.1.140.0060.00317.45
8.1.130.0070.00017.77
8.1.120.0000.00817.48
8.1.110.0030.00517.43
8.1.100.0040.00417.35
8.1.90.0000.01017.51
8.1.80.0000.00717.50
8.1.70.0000.00717.40
8.1.60.0040.00417.60
8.1.50.0030.00517.43
8.1.40.0060.00317.43
8.1.30.0050.00317.57
8.1.20.0020.00517.72
8.1.10.0040.00417.44
8.1.00.0060.00317.52
8.0.300.0040.00418.77
8.0.290.0000.00716.63
8.0.280.0040.00418.51
8.0.270.0030.00317.25
8.0.260.0030.00317.30
8.0.250.0030.00317.02
8.0.240.0040.00416.79
8.0.230.0030.00316.92
8.0.220.0050.00216.84
8.0.210.0030.00316.92
8.0.200.0030.00316.86
8.0.190.0040.00416.95
8.0.180.0030.00516.88
8.0.170.0000.00916.81
8.0.160.0030.00316.92
8.0.150.0000.00716.71
8.0.140.0040.00416.75
8.0.130.0050.00013.31
8.0.120.0030.00516.75
8.0.110.0040.00416.92
8.0.100.0000.00716.90
8.0.90.0040.00416.70
8.0.80.0120.00916.95
8.0.70.0000.00716.96
8.0.60.0040.00416.84
8.0.50.0070.00016.85
8.0.30.0070.01217.19
8.0.20.0110.01417.40
8.0.10.0040.00416.82
8.0.00.0000.01916.66
7.4.330.0020.00215.10
7.4.320.0000.00616.54
7.4.300.0030.00516.60
7.4.290.0030.00316.59
7.4.280.0040.00716.58
7.4.270.0070.00016.44
7.4.260.0030.00316.63
7.4.250.0000.00716.40
7.4.240.0040.00416.60
7.4.230.0000.00716.50
7.4.220.0150.00616.67
7.4.210.0050.00916.61
7.4.200.0000.00716.36
7.4.160.0050.01016.44
7.4.150.0070.01417.40
7.4.140.0130.00717.86
7.4.130.0110.01016.62
7.4.120.0090.01016.61
7.4.110.0030.01316.66
7.4.100.0030.01316.39
7.4.90.0050.01316.39
7.4.80.0070.01519.37
7.4.70.0130.01116.50
7.4.60.0120.00616.58
7.4.50.0040.00016.37
7.4.40.0100.01016.23
7.4.30.0150.00916.48
7.4.00.0060.00614.90
7.3.330.0030.00313.31
7.3.320.0000.00513.20
7.3.310.0030.00316.20
7.3.300.0000.00616.32
7.3.290.0110.00316.33
7.3.280.0050.01216.30
7.3.270.0160.00917.40
7.3.260.0140.00416.35
7.3.250.0090.00816.46
7.3.240.0160.00316.43
7.3.230.0110.00616.39
7.3.210.0140.00316.48
7.3.200.0120.00619.39
7.3.190.0120.00616.37
7.3.180.0080.00816.24
7.3.170.0100.00716.56
7.3.160.0170.00716.61
7.3.10.0120.00316.28
7.3.00.0080.00415.89
7.2.330.0180.00316.61
7.2.320.0150.00416.75
7.2.310.0030.01416.80
7.2.300.0030.01716.73
7.2.290.0050.01116.78
7.2.130.0030.01216.44
7.2.120.0060.00616.34
7.2.110.0040.00416.51
7.2.100.0150.00016.41
7.2.90.0090.01217.06
7.2.80.0100.01616.47
7.2.70.0060.01416.33
7.2.60.0160.00416.56
7.2.50.0210.01016.48
7.2.40.0150.01116.75
7.2.30.0390.00416.59
7.2.20.0100.01016.70
7.2.10.0280.00816.66
7.2.00.0090.01018.25
7.1.250.0100.00315.25
7.1.200.0090.00315.72
7.1.100.0070.00318.15
7.1.70.0040.00417.28
7.1.60.0040.01519.32
7.1.50.0070.01516.97
7.1.00.0000.07722.41
7.0.200.0080.00316.84
7.0.140.0000.07022.09
7.0.60.0030.07020.03
7.0.50.0070.08017.82
7.0.40.0100.04720.21
7.0.30.0370.06720.17
7.0.20.0170.08320.24
7.0.10.0100.07720.07
7.0.00.0070.06020.27
5.6.280.0000.07720.98
5.6.210.0100.05320.72
5.6.200.0130.06318.22
5.6.190.0030.09020.63
5.6.180.0430.06320.55
5.6.170.0270.05020.41
5.6.160.0000.07020.54
5.6.150.0000.04318.16
5.6.140.0070.07018.26
5.6.130.0100.07718.18
5.6.120.0100.07320.80
5.6.110.0030.07721.13
5.6.100.0170.07721.14
5.6.90.0070.08021.13
5.6.80.0030.07720.43
5.5.350.0100.03320.41
5.5.340.0070.06317.95
5.5.330.0130.07320.33
5.5.320.0370.07720.38
5.5.310.0200.05020.30
5.5.300.0130.07318.02
5.5.290.0000.04717.92
5.5.280.0070.06020.81
5.5.270.0000.04320.84
5.5.260.0070.07320.77
5.5.250.0030.09020.59
5.5.240.0370.03020.07
5.4.450.0170.03719.31
5.4.440.0870.05719.33
5.4.430.0970.05319.16
5.4.420.0670.00019.51
5.4.410.0770.00019.46
5.4.400.0630.00019.25
5.4.390.0630.00019.12
5.4.380.0600.05718.61
5.4.370.0300.05018.80
5.4.360.0270.06018.61
5.4.350.0430.05018.54
5.4.340.0330.06318.86
5.4.320.0060.03712.50
5.4.310.0050.03912.50
5.4.300.0070.03512.50
5.4.290.0060.03712.50
5.4.280.0090.03212.40
5.4.270.0070.03512.40
5.4.260.0050.03812.39
5.4.250.0070.03412.40
5.4.240.0080.03312.40
5.4.230.0070.03612.39
5.4.220.0070.03512.39
5.4.210.0020.03912.39
5.4.200.0060.03912.39
5.4.190.0060.03612.38
5.4.180.0080.03912.39
5.4.170.0060.03512.39
5.4.160.0080.03912.39
5.4.150.0060.03712.39
5.4.140.0050.03812.07
5.4.130.0050.04012.07
5.4.120.0060.03512.02
5.4.110.0040.03712.02
5.4.100.0080.03212.02
5.4.90.0070.03512.02
5.4.80.0090.04012.02
5.4.70.0060.04012.01
5.4.60.0070.03212.01
5.4.50.0070.03312.02
5.4.40.0050.04112.00
5.4.30.0060.03612.00
5.4.20.0050.03612.00
5.4.10.0060.03612.00
5.4.00.0070.03811.49
5.3.290.0070.04112.80
5.3.280.0120.03412.71
5.3.270.0120.04012.73
5.3.260.0080.04012.72
5.3.250.0060.03712.72
5.3.240.0060.04512.72
5.3.230.0080.03512.71
5.3.220.0060.04312.68
5.3.210.0080.03612.68
5.3.200.0050.03712.68
5.3.190.0060.04312.67
5.3.180.0070.03512.67
5.3.170.0060.03712.66
5.3.160.0060.03512.68
5.3.150.0040.03812.67
5.3.140.0070.03512.66
5.3.130.0030.04112.66
5.3.120.0050.03912.66
5.3.110.0090.03612.65
5.3.100.0060.03612.13
5.3.90.0060.03712.11
5.3.80.0090.03212.09
5.3.70.0090.03812.09
5.3.60.0100.03312.08
5.3.50.0100.03312.03
5.3.40.0050.04012.03
5.3.30.0100.03311.99
5.3.20.0110.04111.77
5.3.10.0100.03711.73
5.3.00.0090.03811.72
5.2.170.0030.0369.22
5.2.160.0060.0299.23
5.2.150.0080.0349.22
5.2.140.0060.0379.22
5.2.130.0050.0299.18
5.2.120.0070.0269.18
5.2.110.0050.0299.20
5.2.100.0050.0279.19
5.2.90.0060.0299.19
5.2.80.0030.0319.19
5.2.70.0050.0309.19
5.2.60.0020.0329.13
5.2.50.0050.0299.10
5.2.40.0050.0349.07
5.2.30.0070.0269.06
5.2.20.0050.0289.05
5.2.10.0060.0268.95
5.2.00.0060.0288.82
5.1.60.0030.0258.09
5.1.50.0030.0268.09
5.1.40.0030.0258.07
5.1.30.0090.0208.43
5.1.20.0080.0228.44
5.1.10.0050.0258.17
5.1.00.0050.0258.18
5.0.50.0070.0266.65
5.0.40.0050.0206.51
5.0.30.0030.0326.32
5.0.20.0020.0206.29
5.0.10.0050.0176.27
5.0.00.0030.0306.26
4.4.90.0030.0204.78
4.4.80.0060.0164.75
4.4.70.0040.0154.75
4.4.60.0030.0144.76
4.4.50.0030.0144.77
4.4.40.0040.0234.70
4.4.30.0020.0164.76
4.4.20.0050.0124.84
4.4.10.0030.0144.85
4.4.00.0050.0224.76
4.3.110.0020.0164.67
4.3.100.0050.0134.67
4.3.90.0020.0154.64
4.3.80.0050.0224.59
4.3.70.0030.0144.63
4.3.60.0040.0134.63
4.3.50.0040.0144.63
4.3.40.0040.0234.54
4.3.30.0030.0143.30
4.3.20.0010.0173.28
4.3.10.0020.0153.24
4.3.00.0030.0137.92

preferences:
39.46 ms | 400 KiB | 5 Q