3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { protected $_a = 6; function __get($key) { echo "__get({$key})\n"; if($key == 'stuff') { return $this->stuff(); } else if($key == 'a') { return $this->_a + 2; } } function stuff() { echo "stuff()\n"; return array('random' => 'key', 'using_getter' => 10 * $this->a); } function hey() { return $this->a; } } class me extends test { function __get( $name){ $val = parent::__get($name); if ($name === 'a' ) { $val = parent::a - 5; } return $val; } } $test = new test(); print 'this should be 60: '.$test->stuff['using_getter'].PHP_EOL; print 'this should be 6: '.$test->a.PHP_EOL; print $test->hey(); $me = new me(); print $me->a;

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.0040.01116.73
8.3.50.0090.00916.20
8.3.40.0050.01018.88
8.3.30.0040.01118.70
8.3.20.0020.00520.34
8.3.10.0000.00823.61
8.3.00.0040.00423.69
8.2.180.0120.00616.75
8.2.170.0140.00022.96
8.2.160.0140.00020.43
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00019.95
8.2.120.0080.00026.35
8.2.110.0070.00321.18
8.2.100.0040.00718.03
8.2.90.0000.00817.68
8.2.80.0040.00418.02
8.2.70.0000.00917.75
8.2.60.0000.00818.16
8.2.50.0000.00818.07
8.2.40.0000.00822.20
8.2.30.0040.00419.56
8.2.20.0040.00417.83
8.2.10.0050.00319.82
8.2.00.0000.00718.11
8.1.280.0140.00025.92
8.1.270.0100.00020.27
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0080.00020.88
8.1.230.0070.00420.91
8.1.220.0090.00017.77
8.1.210.0030.00618.87
8.1.200.0060.00317.35
8.1.190.0000.00917.36
8.1.180.0000.00818.10
8.1.170.0000.00818.59
8.1.160.0000.00720.79
8.1.150.0000.00719.00
8.1.140.0040.00419.66
8.1.130.0070.00017.73
8.1.120.0020.00517.54
8.1.110.0040.00417.52
8.1.100.0080.00017.38
8.1.90.0000.00717.53
8.1.80.0080.00017.52
8.1.70.0030.00517.49
8.1.60.0040.00417.62
8.1.50.0050.00317.47
8.1.40.0050.00217.44
8.1.30.0000.00817.69
8.1.20.0000.00817.66
8.1.10.0030.00617.54
8.1.00.0030.00617.42
8.0.300.0000.00720.09
8.0.290.0040.00416.88
8.0.280.0060.00318.38
8.0.270.0040.00417.35
8.0.260.0030.00317.29
8.0.250.0000.00716.95
8.0.240.0020.00516.96
8.0.230.0000.00716.96
8.0.220.0000.00716.91
8.0.210.0030.00317.00
8.0.200.0030.00317.03
8.0.190.0000.00717.09
8.0.180.0070.00016.98
8.0.170.0000.00816.92
8.0.160.0000.00716.98
8.0.150.0030.00516.82
8.0.140.0000.00716.96
8.0.130.0050.00013.46
8.0.120.0040.00416.94
8.0.110.0000.00716.88
8.0.100.0070.00017.03
8.0.90.0030.00516.88
8.0.80.0170.00716.98
8.0.70.0000.00717.05
8.0.60.0030.00516.96
8.0.50.0080.00017.05
8.0.30.0070.01016.99
8.0.20.0090.01017.40
8.0.10.0000.00817.02
8.0.00.0090.01216.80
7.4.330.0000.00516.71
7.4.320.0040.00416.57
7.4.300.0080.00016.51
7.4.290.0000.00716.63
7.4.280.0000.00816.63
7.4.270.0000.00716.48
7.4.260.0000.00716.48
7.4.250.0000.00816.49
7.4.240.0050.00316.59
7.4.230.0070.00016.43
7.4.220.0050.01016.46
7.4.210.0060.00916.40
7.4.200.0000.00716.51
7.4.160.0110.01416.80
7.4.150.0080.00817.40
7.4.140.0080.00917.86
7.4.130.0060.01116.70
7.4.120.0060.01116.52
7.4.110.0120.00616.49
7.4.100.0070.01416.51
7.4.90.0120.00616.40
7.4.80.0060.01219.39
7.4.70.0090.00916.43
7.4.60.0060.01616.46
7.4.50.0060.00916.65
7.4.40.0100.00616.49
7.4.30.0090.00816.74
7.4.00.0090.00615.10
7.3.330.0060.00013.47
7.3.320.0030.00313.24
7.3.310.0070.00016.27
7.3.300.0000.00716.51
7.3.290.0090.00716.42
7.3.280.0060.01116.48
7.3.270.0130.00417.40
7.3.260.0120.00916.60
7.3.250.0090.00716.43
7.3.240.0090.01416.40
7.3.230.0120.00616.39
7.3.210.0060.01016.51
7.3.200.0090.00919.39
7.3.190.0160.00016.50
7.3.180.0120.00416.44
7.3.170.0100.01316.41
7.3.160.0040.01116.46
7.2.330.0090.00916.68
7.2.320.0120.00416.44
7.2.310.0060.01116.53
7.2.300.0030.01416.81
7.2.290.0090.00916.77
7.2.60.0110.00616.91
7.2.00.0030.00619.59
7.1.200.0180.00415.70
7.1.100.0090.00018.25
7.1.70.0000.01017.05
7.1.60.0100.01419.27
7.1.50.0070.01417.02
7.1.00.0000.08022.42
7.0.200.0050.00316.57
7.0.60.0070.07721.76
7.0.50.0030.08317.88
7.0.40.0030.07320.11
7.0.30.0200.06320.30
7.0.20.0370.05320.06
7.0.10.0100.08320.24
7.0.00.0030.04020.10
5.6.280.0030.04021.05
5.6.210.0100.07720.51
5.6.200.0030.08318.28
5.6.190.0070.04320.49
5.6.180.0400.05720.47
5.6.170.0230.04720.55
5.6.160.0100.07320.44
5.6.150.0270.03718.18
5.6.140.0070.03318.20
5.6.130.0070.06318.18
5.6.120.0030.04321.03
5.6.110.0000.08321.09
5.6.100.0070.05321.02
5.6.90.0070.06721.11
5.6.80.0130.06720.39
5.5.350.0070.07720.40
5.5.340.0030.09017.95
5.5.330.0100.07320.27
5.5.320.0400.05020.32
5.5.310.0230.04320.51
5.5.300.0030.04718.05
5.5.290.0130.07017.98
5.5.280.0000.08320.90
5.5.270.0030.08720.88
5.5.260.0170.07020.76
5.5.250.0070.08720.47
5.5.240.0200.05020.27

preferences:
46.19 ms | 401 KiB | 5 Q