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 NOT throw an error about modifying a private? $bar->peek($foo, 'Foo'); // this is cats... so I access a private (again, no error), 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.00619.02
8.3.30.0110.00419.10
8.3.20.0040.00420.39
8.3.10.0040.00420.52
8.3.00.0000.00819.38
8.2.170.0120.00319.08
8.2.160.0090.00622.96
8.2.150.0050.00225.66
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0070.00021.00
8.2.110.0040.00422.11
8.2.100.0080.00417.72
8.2.90.0040.00419.05
8.2.80.0050.00317.97
8.2.70.0060.00317.63
8.2.60.0040.00717.90
8.2.50.0040.00418.07
8.2.40.0070.00018.28
8.2.30.0060.00319.20
8.2.20.0040.00417.69
8.2.10.0040.00417.97
8.2.00.0020.00517.79
8.1.270.0040.00424.66
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0040.00423.91
8.1.230.0040.00719.09
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0100.00017.35
8.1.190.0030.00517.00
8.1.180.0030.00518.10
8.1.170.0040.00418.41
8.1.160.0050.00221.96
8.1.150.0040.00418.90
8.1.140.0000.00717.36
8.1.130.0030.00317.82
8.1.120.0040.00417.49
8.1.110.0040.00417.43
8.1.100.0030.00517.47
8.1.90.0070.00317.48
8.1.80.0000.00717.39
8.1.70.0030.00317.46
8.1.60.0030.00517.60
8.1.50.0040.00417.40
8.1.40.0000.00817.54
8.1.30.0060.00317.64
8.1.20.0000.00717.62
8.1.10.0050.00217.58
8.1.00.0050.00217.51
8.0.300.0040.00418.77
8.0.290.0070.00016.75
8.0.280.0000.00718.45
8.0.270.0030.00317.24
8.0.260.0000.00617.25
8.0.250.0030.00316.85
8.0.240.0030.00316.84
8.0.230.0000.00616.93
8.0.220.0000.00716.80
8.0.210.0000.00716.88
8.0.200.0030.00316.93
8.0.190.0030.00316.79
8.0.180.0040.00416.90
8.0.170.0080.00016.96
8.0.160.0000.00716.89
8.0.150.0040.00416.72
8.0.140.0000.00716.75
8.0.130.0000.00613.36
8.0.120.0030.00516.87
8.0.110.0040.00416.73
8.0.100.0000.00716.78
8.0.90.0050.00216.78
8.0.80.0070.01416.95
8.0.70.0080.00016.75
8.0.60.0000.00716.68
8.0.50.0040.00416.77
8.0.30.0080.01217.04
8.0.20.0100.01217.40
8.0.10.0040.00416.75
8.0.00.0090.00816.96
7.4.330.0060.00015.00
7.4.320.0060.00016.61
7.4.300.0060.00016.65
7.4.290.0000.00616.59
7.4.280.0070.00316.62
7.4.270.0030.00316.54
7.4.260.0000.00716.52
7.4.250.0000.00716.61
7.4.240.0000.00716.43
7.4.230.0030.00316.70
7.4.220.0100.01016.56
7.4.210.0030.01216.52
7.4.200.0030.00416.41
7.4.160.0150.00616.53
7.4.150.0120.00717.40
7.4.140.0150.00217.86
7.4.130.0070.01016.47
7.4.120.0070.01016.68
7.4.110.0130.00316.59
7.4.100.0100.00716.35
7.4.90.0120.01216.59
7.4.80.0090.00919.37
7.4.70.0030.02216.55
7.4.60.0130.00316.60
7.4.50.0020.00216.32
7.4.40.0050.01416.67
7.4.30.0040.01716.54
7.4.00.0070.01015.00
7.3.330.0050.00013.14
7.3.320.0030.00313.29
7.3.310.0030.00316.15
7.3.300.0000.00716.34
7.3.290.0100.01016.36
7.3.280.0080.00916.31
7.3.270.0190.00017.40
7.3.260.0080.01916.44
7.3.250.0120.00716.35
7.3.240.0080.00916.46
7.3.230.0060.01016.44
7.3.210.0100.00716.52
7.3.200.0040.01819.39
7.3.190.0110.00716.37
7.3.180.0150.00016.32
7.3.170.0000.01616.36
7.3.160.0100.01016.48
7.2.330.0030.01416.47
7.2.320.0100.00716.51
7.2.310.0120.00416.86
7.2.300.0060.01516.87
7.2.290.0090.00916.51
7.2.60.0100.00316.88
7.2.00.0040.00819.09
7.1.200.0030.00715.50
7.1.100.0000.01118.19
7.1.70.0070.00717.19
7.1.60.0130.01319.32
7.1.50.0070.01416.95
7.1.00.0030.07322.41
7.0.200.0030.00716.44
7.0.140.0030.07322.05
7.0.60.0130.06719.84
7.0.50.0130.07017.95
7.0.40.0070.08720.05
7.0.30.0270.08020.23
7.0.20.0300.04320.19
7.0.10.0030.05020.07
7.0.00.0000.06320.20
5.6.280.0130.06321.03
5.6.210.0070.04320.62
5.6.200.0070.07718.25
5.6.190.0030.08320.61
5.6.180.0330.04720.40
5.6.170.0230.08020.47
5.6.160.0070.07720.57
5.6.150.0070.07318.22
5.6.140.0030.05018.23
5.6.130.0130.05318.23
5.6.120.0070.07021.15
5.6.110.0070.08021.02
5.6.100.0100.06020.96
5.6.90.0100.08021.00
5.6.80.0030.04020.48
5.5.350.0070.08720.34
5.5.340.0030.03718.05
5.5.330.0130.06720.41
5.5.320.0030.04020.38
5.5.310.0300.06020.51
5.5.300.0100.07317.95
5.5.290.0100.08017.97
5.5.280.0070.08320.77
5.5.270.0070.04320.88
5.5.260.0030.04020.64
5.5.250.0100.05320.62
5.5.240.0230.07720.20
5.4.450.1600.04319.32
5.4.440.1730.04719.55
5.4.430.1930.05019.41
5.4.420.1830.03719.56
5.4.410.1800.04319.19
5.4.400.1630.04018.95
5.4.390.1630.04019.15
5.4.380.0070.04319.15
5.4.370.0000.04019.00
5.4.360.1370.03719.08
5.4.350.0470.05019.15
5.4.340.0030.03719.17
5.4.320.0430.03719.23
5.4.310.1730.03719.26
5.4.300.0030.07719.21
5.4.290.0070.06319.14
5.4.280.0100.04719.16
5.4.270.0100.06719.19
5.4.260.0570.04318.80
5.4.250.1970.04019.05
5.4.240.1630.04319.13
5.4.230.1770.04319.13
5.4.220.1800.04318.98
5.4.210.1900.04019.08
5.4.200.1830.04319.09
5.4.190.1800.02319.05
5.4.180.0100.03019.20
5.4.170.0030.07318.99
5.4.160.0470.03318.87
5.4.150.1700.03318.85
5.4.140.1670.03316.73
5.4.130.1670.03316.37
5.4.120.0070.03716.52
5.4.110.0000.04016.41
5.4.100.0100.04716.61
5.4.90.1270.03316.61
5.4.80.1600.04016.39
5.4.70.1700.02716.49
5.4.60.0130.06716.54
5.4.50.0030.03316.53
5.4.40.0030.04316.34
5.4.30.1170.02716.25
5.4.20.0070.03716.53
5.4.10.0030.03316.52
5.4.00.0100.03016.11
5.3.290.1330.03314.64
5.3.280.0700.04314.51
5.3.270.0070.03714.63
5.3.260.0100.07314.51
5.3.250.1630.04014.62
5.3.240.1770.03714.61
5.3.230.1800.04014.68
5.3.220.1670.03714.74
5.3.210.1600.03314.65
5.3.200.1900.04714.59
5.3.190.1970.04014.55
5.3.180.1970.04014.58
5.3.170.1670.03314.53
5.3.160.1600.04014.68
5.3.150.1630.04014.50
5.3.140.0700.03714.57
5.3.130.0070.03714.56
5.3.120.0000.04014.64
5.3.110.0800.05314.67
5.3.100.1600.04013.95
5.3.90.1670.03714.04
5.3.80.1700.03014.10
5.3.70.1570.03714.25
5.3.60.1630.03714.18
5.3.50.1500.04013.88
5.3.40.2000.04014.03
5.3.30.1730.02313.84
5.3.20.1670.03713.68
5.3.10.1970.03713.57
5.3.00.1370.03313.79
5.2.170.0070.03311.08
5.2.160.0000.03011.06
5.2.150.0030.05011.06
5.2.140.1270.03011.30
5.2.130.1300.03311.04
5.2.120.1730.02711.04
5.2.110.1800.03311.04
5.2.100.1700.03711.34
5.2.90.1530.03011.26
5.2.80.1370.03011.19
5.2.70.1530.03711.02
5.2.60.0830.04711.11
5.2.50.0000.03310.95
5.2.40.0030.04710.92
5.2.30.0000.03310.91
5.2.20.0000.03010.93
5.2.10.0600.02310.86
5.2.00.1100.02710.78
5.1.60.0030.0279.90
5.1.50.0030.0439.93
5.1.40.0000.0279.89
5.1.30.0030.02710.37
5.1.20.0200.02310.34
5.1.10.0030.0279.98
5.1.00.0030.02310.16
5.0.50.0000.0209.89
5.0.40.0070.0179.89
5.0.30.0000.0309.89
5.0.20.0000.0479.89
5.0.10.0400.0209.89
5.0.00.0670.0339.89
4.4.90.0530.0139.89
4.4.80.0630.0209.89
4.4.70.0600.0239.89
4.4.60.0000.0179.89
4.4.50.0030.0139.89
4.4.40.0070.0179.89
4.4.30.0000.0179.89
4.4.20.0030.0139.89
4.4.10.0030.0139.89
4.4.00.0000.0239.89
4.3.110.0030.0139.89
4.3.100.0000.0209.89
4.3.90.0130.0179.89
4.3.80.0570.0209.89
4.3.70.0570.0139.89
4.3.60.0700.0239.89
4.3.50.0630.0239.89
4.3.40.0670.0409.89
4.3.30.0300.0179.89
4.3.20.0300.0239.89
4.3.10.0330.0179.89
4.3.00.0300.0139.89

preferences:
39.82 ms | 400 KiB | 5 Q