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 = $this->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.0140.00016.75
8.3.50.0280.00621.13
8.3.40.0070.00718.82
8.3.30.0110.00418.63
8.3.20.0000.00720.41
8.3.10.0080.00023.36
8.3.00.0040.00423.52
8.2.180.0070.01516.75
8.2.170.0100.01022.96
8.2.160.0100.00720.51
8.2.150.0080.00024.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00419.57
8.2.110.0040.00821.00
8.2.100.0080.00317.91
8.2.90.0040.00418.03
8.2.80.0090.00018.19
8.2.70.0060.00317.75
8.2.60.0000.00818.03
8.2.50.0080.00018.07
8.2.40.0050.00322.28
8.2.30.0040.00419.47
8.2.20.0040.00417.90
8.2.10.0080.00018.20
8.2.00.0040.00418.10
8.1.280.0080.00825.92
8.1.270.0000.00820.28
8.1.260.0000.00826.35
8.1.250.0030.00628.09
8.1.240.0080.00020.75
8.1.230.0070.00321.00
8.1.220.0000.00817.78
8.1.210.0040.00418.91
8.1.200.0000.00917.35
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0030.00518.59
8.1.160.0040.00420.90
8.1.150.0000.00718.92
8.1.140.0000.00819.63
8.1.130.0050.00217.70
8.1.120.0000.00717.58
8.1.110.0000.00817.54
8.1.100.0020.00517.44
8.1.90.0020.00517.38
8.1.80.0060.00317.53
8.1.70.0000.00717.54
8.1.60.0000.00917.54
8.1.50.0030.00617.46
8.1.40.0040.00417.44
8.1.30.0050.00317.59
8.1.20.0080.00017.62
8.1.10.0030.00617.51
8.1.00.0000.00917.40
8.0.300.0000.00720.04
8.0.290.0040.00416.88
8.0.280.0000.00818.46
8.0.270.0050.00317.28
8.0.260.0030.00318.94
8.0.250.0000.00717.03
8.0.240.0000.00717.05
8.0.230.0030.00317.05
8.0.220.0030.00317.02
8.0.210.0040.00417.03
8.0.200.0000.00817.09
8.0.190.0000.00717.02
8.0.180.0050.00216.90
8.0.170.0000.00816.98
8.0.160.0040.00417.04
8.0.150.0000.00716.84
8.0.140.0040.00416.86
8.0.130.0000.00513.32
8.0.120.0000.00817.04
8.0.110.0040.00417.05
8.0.100.0020.00516.90
8.0.90.0040.00417.00
8.0.80.0160.01017.04
8.0.70.0080.00016.84
8.0.60.0000.00716.98
8.0.50.0000.00816.89
8.0.30.0120.00317.08
8.0.20.0100.01017.40
8.0.10.0000.00816.95
8.0.00.0080.01016.81
7.4.330.0050.00016.83
7.4.320.0000.00816.39
7.4.300.0040.00416.53
7.4.290.0000.00816.54
7.4.280.0000.00816.51
7.4.270.0040.00416.54
7.4.260.0040.00416.61
7.4.250.0080.00016.40
7.4.240.0030.00416.47
7.4.230.0030.00316.72
7.4.220.0060.01016.63
7.4.210.0030.01016.74
7.4.200.0070.00016.61
7.4.160.0030.01416.46
7.4.150.0070.01017.40
7.4.140.0110.00717.86
7.4.130.0120.00616.55
7.4.120.0080.01416.50
7.4.110.0090.00916.71
7.4.100.0090.00616.43
7.4.90.0130.00316.61
7.4.80.0090.01319.39
7.4.70.0070.01616.66
7.4.60.0100.00716.34
7.4.50.0070.00716.48
7.4.40.0030.01316.54
7.4.30.0060.01116.53
7.4.10.0130.00714.91
7.4.00.0040.01114.83
7.3.330.0050.00013.46
7.3.320.0000.00513.40
7.3.310.0070.00016.35
7.3.300.0000.00716.45
7.3.290.0040.01216.45
7.3.280.0100.00716.43
7.3.270.0080.00817.40
7.3.260.0160.00916.60
7.3.250.0090.01016.55
7.3.240.0090.00916.57
7.3.230.0130.00816.45
7.3.210.0110.00816.64
7.3.200.0090.00619.39
7.3.190.0070.01016.31
7.3.180.0090.00616.69
7.3.170.0060.01216.53
7.3.160.0130.00316.59
7.3.130.0110.00714.95
7.3.120.0060.01214.87
7.3.110.0070.01114.66
7.3.100.0030.01414.94
7.3.90.0040.00814.81
7.3.80.0030.00914.88
7.3.70.0070.00715.02
7.3.60.0070.00714.74
7.3.50.0000.01414.70
7.3.40.0060.00914.77
7.3.30.0040.00714.70
7.3.20.0030.01016.36
7.3.10.0110.00516.44
7.3.00.0130.00616.51
7.2.330.0000.01816.80
7.2.320.0070.01016.52
7.2.310.0120.00316.77
7.2.300.0110.00616.79
7.2.290.0030.01516.55
7.2.260.0160.00314.93
7.2.250.0030.01614.82
7.2.240.0000.01915.05
7.2.230.0040.00914.83
7.2.220.0030.01015.04
7.2.210.0080.00415.26
7.2.200.0100.00315.20
7.2.190.0000.01315.02
7.2.180.0100.00315.05
7.2.170.0030.01215.01
7.2.160.0030.01315.08
7.2.150.0070.00717.02
7.2.140.0070.00716.84
7.2.130.0070.00716.63
7.2.120.0090.01116.59
7.2.110.0140.00516.68
7.2.100.0100.00916.66
7.2.90.0110.00716.63
7.2.80.0160.00316.71
7.2.70.0100.01016.76
7.2.60.0140.00816.69
7.2.50.0080.01016.71
7.2.40.0110.00916.65
7.2.30.0130.00616.71
7.2.20.0130.01016.74
7.2.10.0160.00716.74
7.2.00.0100.00817.79
7.1.330.0030.01415.82
7.1.320.0090.00015.96
7.1.310.0080.00815.89
7.1.300.0080.00315.53
7.1.290.0040.01115.73
7.1.280.0090.00315.70
7.1.270.0070.00315.74
7.1.260.0100.00315.75
7.1.250.0080.01115.39
7.1.240.0090.00615.90
7.1.230.0030.01015.77
7.1.220.0030.01015.89
7.1.210.0100.00315.96
7.1.200.0090.00316.01
7.1.190.0090.00015.79
7.1.180.0060.00915.97
7.1.170.0070.00715.71
7.1.160.0040.00915.63
7.1.150.0030.00815.89
7.1.140.0000.01115.87
7.1.130.0070.00715.86
7.1.120.0000.01615.83
7.1.110.0090.00615.75
7.1.100.0070.00516.93
7.1.90.0130.00015.95
7.1.80.0000.01415.82
7.1.70.0000.01216.54
7.1.60.0030.01317.55
7.1.50.0040.00916.36
7.1.40.0030.01016.04
7.1.30.0110.00015.95
7.1.20.0070.00715.53
7.1.10.0040.00715.71
7.1.00.0060.03919.05
7.0.330.0030.01015.38
7.0.320.0100.00315.41
7.0.310.0060.00615.43
7.0.300.0100.00715.46
7.0.290.0000.01515.51
7.0.280.0100.00715.47
7.0.270.0030.01215.36
7.0.260.0100.00315.14
7.0.250.0080.00415.37
7.0.240.0030.00715.54
7.0.230.0000.01415.52
7.0.220.0070.00715.45
7.0.210.0060.00615.44
7.0.200.0030.00716.16
7.0.190.0040.01115.57
7.0.180.0030.01015.39
7.0.170.0060.00315.30
7.0.160.0030.00515.34
7.0.150.0030.01015.66
7.0.140.0070.00415.25
7.0.130.0100.00315.54
7.0.120.0060.01015.45
7.0.110.0030.00615.47
7.0.100.0040.00915.22
7.0.90.0000.01115.50
7.0.80.0060.00915.48
7.0.70.0060.00615.32
7.0.60.0080.04318.51
7.0.50.0060.04316.63
7.0.40.0090.04416.80
7.0.30.0220.03716.84
7.0.20.0210.03516.77
7.0.10.0070.03516.82
7.0.00.0080.03216.90
5.6.400.0000.01514.06
5.6.390.0030.00614.17
5.6.380.0030.00914.67
5.6.370.0110.00014.21
5.6.360.0070.00714.25
5.6.350.0030.00914.45
5.6.340.0070.00714.16
5.6.330.0000.01114.74
5.6.320.0060.00914.68
5.6.310.0030.01414.49
5.6.300.0100.00314.19
5.6.290.0070.00714.47
5.6.280.0070.03217.77
5.6.270.0080.00814.43
5.6.260.0030.00614.26
5.6.250.0000.01414.46
5.6.240.0030.01014.42
5.6.230.0000.00814.62
5.6.220.0090.00314.50
5.6.210.0080.02517.55
5.6.200.0100.04316.23
5.6.190.0040.02317.36
5.6.180.0230.02817.54
5.6.170.0150.03217.47
5.6.160.0050.05017.37
5.6.150.0030.04316.26
5.6.140.0020.02716.39
5.6.130.0050.04016.33
5.6.120.0020.03917.65
5.6.110.0070.05017.73
5.6.100.0070.04717.95
5.6.90.0030.02717.72
5.6.80.0070.04217.38
5.6.70.0070.00714.30
5.6.60.0000.01814.32
5.6.50.0070.00714.51
5.6.40.0000.01414.50
5.6.30.0030.00714.19
5.6.20.0040.00714.13
5.6.10.0060.00614.44
5.6.00.0000.01514.20
5.5.380.0030.00814.05
5.5.370.0080.00314.63
5.5.360.0060.00314.39
5.5.350.0030.04517.42
5.5.340.0110.02616.26
5.5.330.0110.03817.22
5.5.320.0200.02517.22
5.5.310.0110.02517.35
5.5.300.0070.04016.31
5.5.290.0070.03015.96
5.5.280.0030.03017.60
5.5.270.0150.04317.44
5.5.260.0020.04717.60
5.5.250.0140.03217.52
5.5.240.0120.04217.27
5.5.230.0000.01314.03
5.5.220.0090.00614.04
5.5.210.0070.00714.04
5.5.200.0070.00314.44
5.5.190.0030.01114.43
5.5.180.0130.00014.08
5.5.170.0030.01014.23
5.5.160.0000.01814.30
5.5.150.0060.00914.36
5.5.140.0060.00614.35
5.5.130.0090.00614.12
5.5.120.0030.00614.07
5.5.110.0060.00614.16
5.5.100.0000.01214.20
5.5.90.0040.01114.42
5.5.80.0060.00314.50
5.5.70.0060.00914.46
5.5.60.0050.00814.11
5.5.50.0070.00314.20
5.5.40.0150.00013.89
5.5.30.0030.00614.34
5.5.20.0090.00614.02
5.5.10.0060.00914.55
5.5.00.0090.00014.16

preferences:
48.71 ms | 401 KiB | 5 Q