3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait LazyGetSet { public function __call($method, $args) { if ((0 === strpos($method, 'get')) && ($ptyName = $this->getLazyPropertyName($method))) { return $this->lazyGet($ptyName, $args); } if ((0 === strpos($method, 'set')) && ($ptyName = $this->getLazyPropertyName($method))) { return $this->lazySet($ptyName, $args); } } private function getLazyPropertyName($method) { $ptyName = lcfirst(substr($method, 3)); if (property_exists($this, $ptyName)) { return $ptyName; } } private function lazyGet($ptyName) { return $this->{$ptyName}; } private function lazySet($ptyName, $args) { $this->{$ptyName} = $args[0]; return $this; } } class MyClass { use LazyGetSet; private $name; } echo (new MyClass())->setName(123)->getName();

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.0030.01416.75
8.3.50.0090.00722.05
8.3.40.0090.00618.90
8.3.30.0100.00319.01
8.3.20.0040.00420.34
8.3.10.0040.00420.66
8.3.00.0040.00419.38
8.2.180.0100.01018.29
8.2.170.0170.00022.96
8.2.160.0110.00420.52
8.2.150.0080.00024.18
8.2.140.0080.00324.66
8.2.130.0050.00226.16
8.2.120.0040.00420.89
8.2.110.0040.00422.26
8.2.100.0080.00417.72
8.2.90.0040.00419.20
8.2.80.0040.00417.97
8.2.70.0060.00317.50
8.2.60.0030.00617.93
8.2.50.0060.00318.07
8.2.40.0040.00418.34
8.2.30.0050.00219.40
8.2.20.0050.00317.74
8.2.10.0000.00817.95
8.2.00.0000.00717.81
8.1.280.0120.00325.92
8.1.270.0050.00322.18
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0090.00023.88
8.1.230.0030.00819.04
8.1.220.0030.00517.74
8.1.210.0080.00018.77
8.1.200.0100.00017.10
8.1.190.0000.00817.22
8.1.180.0030.00618.10
8.1.170.0000.00818.52
8.1.160.0050.00222.04
8.1.150.0040.00418.95
8.1.140.0000.00717.53
8.1.130.0030.00317.93
8.1.120.0000.00817.41
8.1.110.0000.00717.48
8.1.100.0050.00317.43
8.1.90.0000.00817.54
8.1.80.0000.00817.44
8.1.70.0030.00317.34
8.1.60.0040.00417.64
8.1.50.0000.00817.44
8.1.40.0000.00817.40
8.1.30.0000.00817.70
8.1.20.0040.00417.60
8.1.10.0000.00817.61
8.1.00.0040.00417.52
8.0.300.0070.00018.77
8.0.290.0040.00416.63
8.0.280.0000.00818.35
8.0.270.0000.00717.18
8.0.260.0000.00617.18
8.0.250.0030.00317.01
8.0.240.0050.00316.96
8.0.230.0000.00716.99
8.0.220.0030.00316.82
8.0.210.0090.00016.82
8.0.200.0000.00816.97
8.0.190.0070.00016.90
8.0.180.0040.00416.80
8.0.170.0040.00416.81
8.0.160.0030.00616.95
8.0.150.0000.00716.84
8.0.140.0000.00716.95
8.0.130.0030.00313.29
8.0.120.0000.00816.88
8.0.110.0040.00416.98
8.0.100.0040.00416.86
8.0.90.0000.00716.98
8.0.80.0070.01416.91
8.0.70.0040.00416.84
8.0.60.0040.00416.87
8.0.50.0000.00816.88
8.0.30.0160.00517.05
8.0.20.0100.00917.40
8.0.10.0000.00817.04
8.0.00.0120.00616.77
7.4.330.0000.00515.15
7.4.320.0000.00616.66
7.4.300.0030.00316.41
7.4.290.0000.00716.54
7.4.280.0000.00816.56
7.4.270.0040.00416.63
7.4.260.0030.00316.50
7.4.250.0050.00216.49
7.4.240.0020.00616.64
7.4.230.0000.00716.44
7.4.220.0140.00416.62
7.4.210.0100.00316.64
7.4.200.0000.00816.60
7.4.160.0090.00616.54
7.4.150.0090.00917.40
7.4.140.0120.00817.86
7.4.130.0080.00816.56
7.4.120.0070.01316.53
7.4.110.0120.00616.65
7.4.100.0110.01016.55
7.4.90.0110.00716.53
7.4.80.0060.01219.39
7.4.70.0120.00616.43
7.4.60.0070.01316.45
7.4.50.0050.00316.67
7.4.40.0080.01016.55
7.4.30.0080.00816.51
7.4.00.0100.00714.96
7.3.330.0000.00513.35
7.3.320.0060.00013.37
7.3.310.0050.00216.39
7.3.300.0060.00016.25
7.3.290.0040.01516.37
7.3.280.0060.01216.34
7.3.270.0060.01117.40
7.3.260.0070.01016.35
7.3.250.0150.00516.52
7.3.240.0150.00416.36
7.3.230.0160.01616.59
7.3.210.0090.01316.30
7.3.200.0060.01719.39
7.3.190.0080.00816.55
7.3.180.0130.00316.32
7.3.170.0090.01216.79
7.3.160.0160.00016.27
7.3.10.0040.00716.48
7.3.00.0050.00516.49
7.2.330.0100.00716.68
7.2.320.0080.01616.58
7.2.310.0190.00516.58
7.2.300.0080.00816.60
7.2.290.0060.01016.56
7.2.130.0030.00616.93
7.2.120.0040.00817.07
7.2.110.0070.00716.78
7.2.100.0070.00716.93
7.2.90.0070.00716.86
7.2.80.0060.00316.76
7.2.70.0060.00316.88
7.2.60.0090.00316.80
7.2.50.0080.00716.96
7.2.40.0040.00816.98
7.2.30.0030.00616.85
7.2.20.0070.00717.01
7.2.10.0110.00017.04
7.2.00.0060.00418.31
7.1.250.0040.00415.76
7.1.200.0030.00615.74
7.1.100.0060.00618.02
7.1.70.0070.00017.18
7.1.60.0040.01519.61
7.1.50.0130.01016.93
7.1.00.0030.07722.32
7.0.200.0000.00716.63
7.0.140.0030.07321.98
7.0.60.0100.04019.95
7.0.50.0070.05017.87
7.0.40.0070.07320.40
7.0.30.0400.06020.07
7.0.20.0300.04320.07
7.0.10.0370.07720.30
7.0.00.0070.06720.05
5.6.280.0030.07320.83
5.6.210.0170.07020.49
5.6.200.0100.07718.22
5.6.190.0030.04320.50
5.6.180.0330.06720.55
5.6.170.0270.04720.47
5.6.160.0100.08320.44
5.6.150.0070.06718.18
5.6.140.0000.04718.15
5.6.130.0100.04318.19
5.6.120.0100.08021.13
5.6.110.0030.05721.04
5.6.100.0130.06021.15
5.6.90.0130.07721.11
5.6.80.0070.04020.36
5.6.70.0270.08020.51
5.5.350.0030.07720.46
5.5.340.0100.07717.93
5.5.330.0100.08320.47
5.5.320.0300.07720.27
5.5.310.0170.04720.37
5.5.300.0030.07717.98
5.5.290.0000.04318.02
5.5.280.0130.04720.79
5.5.270.0100.08020.86
5.5.260.0170.07320.90
5.5.250.0030.04020.60
5.5.240.0170.05320.16
5.4.450.0070.04019.31
5.4.440.0430.04319.56
5.4.430.0200.03319.45
5.4.420.0500.04719.63
5.4.410.0430.05019.42
5.4.400.0400.03319.07
5.4.390.0330.04019.22
5.4.380.0300.07318.83
5.4.370.0230.05318.62
5.4.360.0200.05718.70
5.4.350.0230.05718.62
5.4.340.0270.04718.73
5.4.320.0050.04812.51
5.4.310.0100.05012.50
5.4.300.0100.03712.51
5.4.290.0110.03812.50
5.4.280.0090.03612.40
5.4.270.0090.03512.40
5.4.260.0070.04612.40
5.4.250.0090.05012.40
5.4.240.0090.04812.40
5.4.230.0100.03712.39
5.4.220.0100.03212.39
5.4.210.0050.03712.39
5.4.200.0070.04612.39
5.4.190.0070.04112.39
5.4.180.0090.04112.39
5.4.170.0080.03912.41
5.4.160.0090.04412.39
5.4.150.0090.03612.40
5.4.140.0060.04512.08
5.4.130.0080.03412.07
5.4.120.0080.03412.02
5.4.110.0060.03712.02
5.4.100.0100.04112.02
5.4.90.0110.03312.02
5.4.80.0050.04412.02
5.4.70.0050.04112.02
5.4.60.0080.04412.02
5.4.50.0050.04412.02
5.4.40.0090.03712.00
5.4.30.0080.03312.00
5.4.20.0060.04712.00
5.4.10.0070.04112.00
5.4.00.0030.04011.49
5.3.290.0090.03712.80
5.3.280.0070.03712.71
5.3.270.0080.04012.72
5.3.260.0040.04112.72
5.3.250.0080.04712.72
5.3.240.0080.03412.72
5.3.230.0050.04112.71
5.3.220.0090.04112.68
5.3.210.0110.03612.68
5.3.200.0050.03812.68
5.3.190.0060.03812.68
5.3.180.0070.03612.67
5.3.170.0100.04112.67
5.3.160.0090.03712.67
5.3.150.0110.03612.67
5.3.140.0080.03712.66
5.3.130.0080.03812.66
5.3.120.0040.04212.66
5.3.110.0070.05612.66
5.3.100.0060.05312.12
5.3.90.0040.04412.09
5.3.80.0150.04212.07
5.3.70.0110.04312.07
5.3.60.0050.04012.07
5.3.50.0070.03912.00
5.3.40.0090.04012.00
5.3.30.0060.04011.95
5.3.20.0060.03611.73
5.3.10.0110.03311.70
5.3.00.0100.03711.68
5.2.170.0070.0349.18
5.2.160.0040.0389.18
5.2.150.0070.0389.18
5.2.140.0020.0369.18
5.2.130.0060.0349.14
5.2.120.0060.0309.14
5.2.110.0090.0329.14
5.2.100.0050.0309.14
5.2.90.0070.0309.14
5.2.80.0040.0409.14
5.2.70.0060.0459.14
5.2.60.0050.0309.09
5.2.50.0060.0299.06
5.2.40.0060.0319.04
5.2.30.0070.0349.02
5.2.20.0060.0289.00
5.2.10.0080.0268.92
5.2.00.0040.0358.79
5.1.60.0050.0278.07
5.1.50.0070.0298.07
5.1.40.0030.0278.05
5.1.30.0070.0268.39
5.1.20.0040.0338.41
5.1.10.0060.0358.14
5.1.00.0050.0368.14
5.0.50.0040.0246.62
5.0.40.0040.0286.48
5.0.30.0030.0346.29
5.0.20.0040.0256.26
5.0.10.0060.0206.24
5.0.00.0040.0426.24
4.4.90.0030.0274.78
4.4.80.0030.0234.75
4.4.70.0040.0174.75
4.4.60.0020.0254.76
4.4.50.0020.0224.77
4.4.40.0020.0294.71
4.4.30.0070.0344.76
4.4.20.0010.0224.84
4.4.10.0020.0194.85
4.4.00.0040.0334.76
4.3.110.0010.0244.67
4.3.100.0020.0264.66
4.3.90.0060.0184.63
4.3.80.0040.0274.58
4.3.70.0020.0164.63
4.3.60.0030.0264.62
4.3.50.0050.0214.63
4.3.40.0040.0344.54
4.3.30.0020.0193.28
4.3.20.0030.0243.25
4.3.10.0030.0153.22
4.3.00.0070.02013.57

preferences:
45.82 ms | 401 KiB | 5 Q