3v4l.org

run code in 300+ PHP versions simultaneously
<?php class my { private $a = null; protected $b = 'b'; public $c = 'c'; function __construct($b, $c) { $this->a = 'a1'; $this->b = $b; $this->c = $c; } public function test() { echo $this->a, $this->b, $this->c; } } class my_ex extends my { function __construct() { $cleaner = function () { echo "Clearing all properties", "<br>"; unset($this->a, $this->b, $this->c); }; $cleaner->bindTo($this, get_parent_class($this))->__invoke(); } function __get($name) { $lazySetter = function($name) { echo "Lazy-loading property {$name}", "<br>"; $this->$name = "new{$name}"; }; $lazySetter->bindTo($this, get_parent_class($this))->__invoke($name); } } $my = new my_ex(1,2); $my->test();

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.0110.00716.50
8.3.50.0070.00917.25
8.3.40.0150.00618.67
8.3.30.0110.00418.72
8.3.20.0090.00018.78
8.3.10.0060.00320.40
8.3.00.0080.00019.26
8.2.180.0150.00616.63
8.2.170.0140.00722.96
8.2.160.0080.00522.13
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00419.77
8.2.110.0090.00020.94
8.2.100.0110.00017.84
8.2.90.0090.00019.17
8.2.80.0040.00417.93
8.2.70.0030.00617.48
8.2.60.0060.00317.99
8.2.50.0040.00418.07
8.2.40.0030.00518.16
8.2.30.0040.00418.08
8.2.20.0000.00717.64
8.2.10.0030.00617.63
8.2.00.0030.00617.76
8.1.280.0140.00025.92
8.1.270.0030.00624.66
8.1.260.0060.00326.35
8.1.250.0000.00728.09
8.1.240.0100.00020.80
8.1.230.0070.00320.92
8.1.220.0060.00317.79
8.1.210.0000.00919.04
8.1.200.0100.00017.38
8.1.190.0040.00417.54
8.1.180.0030.00618.10
8.1.170.0070.00018.96
8.1.160.0040.00418.95
8.1.150.0050.00218.57
8.1.140.0000.00717.49
8.1.130.0030.00317.70
8.1.120.0000.00717.44
8.1.110.0050.00217.36
8.1.100.0000.00717.50
8.1.90.0040.00417.46
8.1.80.0000.00817.46
8.1.70.0080.00017.49
8.1.60.0040.00417.62
8.1.50.0080.00017.42
8.1.40.0040.00417.57
8.1.30.0040.00417.56
8.1.20.0000.00817.65
8.1.10.0040.00417.66
8.1.00.0000.00817.55
8.0.300.0000.00919.85
8.0.290.0020.00516.63
8.0.280.0050.00218.45
8.0.270.0000.00717.29
8.0.260.0030.00316.84
8.0.250.0020.00516.86
8.0.240.0000.00716.89
8.0.230.0000.00716.96
8.0.220.0040.00416.77
8.0.210.0080.00016.99
8.0.200.0000.00616.87
8.0.190.0000.00716.97
8.0.180.0050.00316.93
8.0.170.0000.00816.97
8.0.160.0000.00816.88
8.0.150.0060.00316.76
8.0.140.0080.00416.91
8.0.130.0050.00013.38
8.0.120.0050.00216.86
8.0.110.0000.00716.81
8.0.100.0050.00216.88
8.0.90.0000.00716.91
8.0.80.0090.00616.88
8.0.70.0000.00716.71
8.0.60.0040.00416.81
8.0.50.0070.00016.78
8.0.30.0080.01117.02
8.0.20.0080.01117.15
8.0.10.0000.00717.05
8.0.00.0090.01116.89
7.4.330.0030.00312.95
7.4.320.0030.00316.60
7.4.300.0000.00716.63
7.4.290.0040.00416.67
7.4.280.0050.00516.50
7.4.270.0040.00416.53
7.4.260.0030.00313.24
7.4.250.0050.00216.60
7.4.240.0040.00416.61
7.4.230.0030.00316.62
7.4.220.0090.00916.49
7.4.210.0070.00916.63
7.4.200.0000.00716.62
7.4.190.0000.00716.63
7.4.160.0110.00516.58
7.4.150.0030.01416.38
7.4.140.0120.00616.60
7.4.130.0070.01016.50
7.4.120.0070.01016.51
7.4.110.0030.01416.49
7.4.100.0080.01516.58
7.4.90.0070.01116.57
7.4.80.0070.01016.63
7.4.70.0090.00916.48
7.4.60.0130.00316.64
7.4.50.0030.00616.44
7.4.40.0000.01116.43
7.4.30.0040.01216.54
7.4.00.0120.00414.98
7.3.330.0060.00013.30
7.3.320.0030.00313.20
7.3.310.0040.00416.33
7.3.300.0040.00416.41
7.3.290.0070.01316.34
7.3.280.0080.00916.39
7.3.270.0090.01016.38
7.3.260.0090.00816.27
7.3.250.0070.01516.40
7.3.240.0040.01316.55
7.3.230.0060.01216.39
7.3.210.0140.00316.66
7.3.200.0100.01419.39
7.3.190.0090.01516.43
7.3.180.0110.00616.42
7.3.170.0060.00916.37
7.3.160.0170.00316.61
7.3.120.0030.01415.04
7.2.330.0110.00716.77
7.2.320.0150.00316.41
7.2.310.0140.00616.78
7.2.300.0100.00716.84
7.2.290.0130.00316.69
7.2.00.0070.00719.22
7.1.100.0000.01318.39
7.1.70.0110.00017.28
7.1.60.0100.01419.40
7.1.50.0040.01816.87
7.1.00.0030.06722.35
7.0.200.0220.00414.63
7.0.140.0130.06721.92
7.0.120.0000.06722.27
7.0.60.0100.07319.96
7.0.50.0030.08717.74
7.0.40.0130.04020.11
7.0.30.0370.06020.26
7.0.20.0270.04320.24
7.0.10.0030.07320.25
7.0.00.0100.08020.25
5.6.280.0030.07321.11
5.6.210.0130.08020.71
5.6.200.0030.08318.22
5.6.190.0130.06720.52
5.6.180.0230.07320.39
5.6.170.0170.06320.57
5.6.160.0070.06020.50
5.6.150.0070.08318.15
5.6.140.0070.07018.18
5.6.130.0070.03718.24
5.6.120.0100.06021.11
5.6.110.0100.08321.13
5.6.100.0200.05321.04
5.6.90.0130.07321.14
5.6.80.0100.08320.32
5.5.350.0230.06320.41
5.5.340.0100.07717.98
5.5.330.0070.05320.42
5.5.320.0170.04020.27
5.5.310.0300.06720.29
5.5.300.0030.04017.96
5.5.290.0130.07717.95
5.5.280.0130.08320.91
5.5.270.0130.08020.78
5.5.260.0130.07320.91
5.5.250.0170.08320.71
5.5.240.0030.07320.28
5.4.450.0100.06719.20
5.4.440.0100.07719.57
5.4.430.0030.07719.18
5.4.420.0030.07319.29
5.4.410.0070.07019.40
5.4.400.0130.06719.15
5.4.390.0070.07718.89
5.4.380.0030.07319.01
5.4.370.0030.05319.00
5.4.360.0070.07319.15
5.4.350.0100.03719.15
5.4.340.0130.07019.20
5.4.320.0130.05319.00
5.4.310.0100.05319.08
5.4.300.0100.05019.13
5.4.290.0070.07319.08
5.4.280.0070.03719.14
5.4.270.0030.04718.88
5.4.260.0070.04719.23
5.4.250.0070.03719.19
5.4.240.0030.04718.84
5.4.230.0200.07319.15
5.4.220.0000.04719.13
5.4.210.0030.07719.24
5.4.200.0030.04719.14
5.4.190.0000.05018.96
5.4.180.0030.08019.13
5.4.170.0130.06319.23
5.4.160.0100.05718.91
5.4.150.0100.03319.19
5.4.140.0100.07016.55
5.4.130.0100.06016.40
5.4.120.0000.08016.42
5.4.110.0070.06716.34
5.4.100.0000.04716.48
5.4.90.0030.05016.33
5.4.80.0070.04316.35
5.4.70.0030.07016.37
5.4.60.0030.04016.39
5.4.50.0030.08016.51
5.4.40.0130.06716.44
5.4.30.0030.04716.40
5.4.20.0070.07016.40
5.4.10.0030.04316.27
5.4.00.0030.05715.88
5.3.290.0100.06014.57
5.3.280.0070.08014.62
5.3.270.0100.07314.62
5.3.260.0070.05714.63
5.3.250.0130.05014.65
5.3.240.0070.03714.55
5.3.230.0100.06714.77
5.3.220.0000.05714.60
5.3.210.0030.05014.47
5.3.200.0030.05014.61
5.3.190.0070.03714.59
5.3.180.0100.07314.60
5.3.170.0100.05014.59
5.3.160.0130.07014.58
5.3.150.0070.07314.58
5.3.140.0100.04714.73
5.3.130.0070.08014.56
5.3.120.0100.07314.57
5.3.110.0030.04014.63
5.3.100.0000.08014.09
5.3.90.0030.05014.10
5.3.80.0100.03314.06
5.3.70.0170.05014.09
5.3.60.0070.03714.05
5.3.50.0030.04714.12
5.3.40.0070.05313.94
5.3.30.0070.07014.07
5.3.20.0100.04713.71
5.3.10.0030.04713.63
5.3.00.0030.03713.70
5.2.170.0100.04711.20
5.2.160.0070.06011.20
5.2.150.0000.04011.04
5.2.140.0070.06011.20
5.2.130.0070.03311.18
5.2.120.0070.05711.07
5.2.110.0070.03011.05
5.2.100.0030.02711.16
5.2.90.0070.05311.12
5.2.80.0030.04711.11
5.2.70.0070.06311.13
5.2.60.0070.05011.01
5.2.50.0000.05311.07
5.2.40.0030.03710.94
5.2.30.0070.04011.04
5.2.20.0000.06010.98
5.2.10.0030.04310.87
5.2.00.0000.03710.88
5.1.60.0000.0279.95
5.1.50.0000.02710.00
5.1.40.0030.03010.13
5.1.30.0070.05310.51
5.1.20.0030.04010.50
5.1.10.0100.05310.04
5.1.00.0030.05710.10
5.0.50.0070.0178.46
5.0.40.0030.0438.39
5.0.30.0000.0338.38
5.0.20.0000.0238.26
5.0.10.0000.0338.33
5.0.00.0070.0408.18
4.4.90.0100.0277.87
4.4.80.0070.0337.87
4.4.70.0000.0277.87
4.4.60.0030.0177.87
4.4.50.0070.0137.87
4.4.40.0030.0377.87
4.4.30.0000.0177.87
4.4.20.0070.0307.87
4.4.10.0030.0377.87
4.4.00.0070.0377.87
4.3.110.0030.0277.87
4.3.100.0000.0177.87
4.3.90.0000.0237.87
4.3.80.0000.0377.87
4.3.70.0030.0177.87
4.3.60.0000.0307.87
4.3.50.0000.0277.87
4.3.40.0030.0277.87
4.3.30.0000.0177.87
4.3.20.0000.0177.87
4.3.10.0030.0137.87
4.3.00.0000.0137.87

preferences:
56.8 ms | 401 KiB | 5 Q