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}"; return $this->$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.40.0140.00718.71
8.3.30.0150.00618.53
8.3.20.0080.00018.63
8.3.10.0080.00020.73
8.3.00.0070.00723.53
8.2.170.0130.00722.96
8.2.160.0060.00820.57
8.2.150.0120.00324.18
8.2.140.0040.01124.66
8.2.130.0060.00326.16
8.2.120.0040.00421.03
8.2.110.0130.00620.50
8.2.100.0030.01017.91
8.2.90.0090.00017.91
8.2.80.0050.00317.97
8.2.70.0030.00617.50
8.2.60.0040.00417.80
8.2.50.0040.00418.07
8.2.40.0000.00817.97
8.2.30.0050.00221.29
8.2.20.0040.00417.64
8.2.10.0000.00717.80
8.2.00.0000.00817.72
8.1.270.0080.00023.99
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0060.00322.18
8.1.230.0070.00420.89
8.1.220.0000.00817.74
8.1.210.0060.00318.89
8.1.200.0060.00317.35
8.1.190.0070.00317.53
8.1.180.0030.00618.10
8.1.170.0000.00818.25
8.1.160.0000.00718.96
8.1.150.0000.00818.60
8.1.140.0040.00417.39
8.1.130.0000.00717.75
8.1.120.0050.00317.48
8.1.110.0050.00217.36
8.1.100.0000.00717.50
8.1.90.0030.00317.50
8.1.80.0050.00217.36
8.1.70.0030.00317.47
8.1.60.0000.00817.57
8.1.50.0070.00017.48
8.1.40.0030.00517.58
8.1.30.0050.00317.61
8.1.20.0030.00617.73
8.1.10.0000.00817.50
8.1.00.0000.00717.59
8.0.300.0000.00720.07
8.0.290.0080.00017.05
8.0.280.0070.00018.48
8.0.270.0000.00717.31
8.0.260.0000.00716.73
8.0.250.0000.00717.00
8.0.240.0050.00316.87
8.0.230.0030.00316.85
8.0.220.0030.00316.91
8.0.210.0040.00416.89
8.0.200.0070.00016.95
8.0.190.0030.00316.96
8.0.180.0050.00316.99
8.0.170.0050.00316.92
8.0.160.0080.00016.82
8.0.150.0040.00416.97
8.0.140.0000.00716.87
8.0.130.0000.00613.37
8.0.120.0070.00016.84
8.0.110.0050.00216.89
8.0.100.0080.00016.92
8.0.90.0040.00416.79
8.0.80.0030.01416.95
8.0.70.0000.00716.95
8.0.60.0000.00716.80
8.0.50.0000.00816.93
8.0.30.0080.01117.10
8.0.20.0080.01117.40
8.0.10.0050.00316.93
8.0.00.0080.01016.81
7.4.330.0030.00316.67
7.4.320.0030.00316.61
7.4.300.0000.00616.48
7.4.290.0070.00016.57
7.4.280.0070.00016.51
7.4.270.0030.00316.59
7.4.260.0000.00613.24
7.4.250.0000.00816.60
7.4.240.0000.00816.60
7.4.230.0030.00316.62
7.4.220.0060.01116.45
7.4.210.0050.00916.62
7.4.200.0070.00016.34
7.4.190.0000.00816.39
7.4.160.0140.00716.61
7.4.150.0060.01217.40
7.4.140.0160.00517.86
7.4.130.0150.00516.54
7.4.120.0120.00416.58
7.4.110.0090.00916.54
7.4.100.0110.00716.45
7.4.90.0110.00616.65
7.4.80.0030.01319.39
7.4.70.0140.00316.48
7.4.60.0090.01316.65
7.4.50.0060.00316.51
7.4.40.0070.00322.77
7.4.30.0150.00616.55
7.4.00.0040.00815.10
7.3.330.0020.00213.36
7.3.320.0050.00013.24
7.3.310.0030.00316.34
7.3.300.0000.00716.41
7.3.290.0000.02016.37
7.3.280.0100.00716.39
7.3.270.0080.01117.40
7.3.260.0100.01018.24
7.3.250.0140.00316.45
7.3.240.0130.00316.63
7.3.230.0100.01316.64
7.3.210.0070.01016.51
7.3.200.0030.01919.39
7.3.190.0160.00016.72
7.3.180.0030.01316.46
7.3.170.0120.00316.38
7.3.160.0130.00716.35
7.3.120.0070.01015.10
7.3.10.0040.00816.52
7.3.00.0100.00716.67
7.2.330.0110.00616.80
7.2.320.0060.01216.75
7.2.310.0080.00816.80
7.2.300.0170.00716.41
7.2.290.0150.00316.56
7.2.130.0110.00417.09
7.2.120.0060.00616.87
7.2.110.0090.00616.77
7.2.100.0030.01016.87
7.2.90.0030.00716.79
7.2.80.0050.00516.91
7.2.70.0000.01416.89
7.2.60.0080.00616.91
7.2.50.0030.01017.03
7.2.40.0060.00616.79
7.2.30.0090.00616.99
7.2.20.0030.01316.78
7.2.10.0030.01316.63
7.2.00.0070.00918.35
7.1.250.0090.00615.63
7.1.200.0090.00315.85
7.1.100.0000.01018.13
7.1.70.0040.00417.26
7.1.60.0000.01217.37
7.1.50.0120.00917.05
7.1.00.0030.03322.44
7.0.200.0050.00316.67
7.0.140.0000.07322.04
7.0.90.0030.08319.96
7.0.80.0030.08019.87
7.0.70.0100.07319.91
7.0.60.0130.08019.93
7.0.50.0030.04320.27
7.0.40.0070.06719.94
7.0.30.0030.07720.02
7.0.20.0100.08020.04
7.0.10.0170.07019.99
7.0.00.0070.05320.09
5.6.280.0000.07721.13
5.6.230.0030.05320.50
5.6.220.0130.07720.70
5.6.210.0230.06320.48
5.6.200.0030.05721.15
5.6.190.0070.08721.06
5.6.180.0130.07321.06
5.6.170.0130.07020.97
5.6.160.0100.07321.02
5.6.150.0070.08020.96
5.6.140.0130.05320.98
5.6.130.0100.07721.14
5.6.120.0100.08321.02
5.6.110.0070.08721.08
5.6.100.0030.08021.08
5.6.90.0030.06320.93
5.6.80.0130.06020.50
5.6.70.0070.07720.43
5.6.60.0070.08020.52
5.6.50.0130.06020.54
5.6.40.0030.08020.45
5.6.30.0130.05020.43
5.6.20.0100.07720.37
5.6.10.0200.07320.45
5.6.00.0100.05720.31
5.5.370.0170.07020.41
5.5.360.0100.07320.36
5.5.350.0200.07020.39
5.5.340.0030.07720.89
5.5.330.0000.05320.95
5.5.320.0130.07020.76
5.5.310.0100.08020.85
5.5.300.0100.06320.77
5.5.290.0070.05020.65
5.5.280.0100.07720.79
5.5.270.0130.07720.93
5.5.260.0030.06020.83
5.5.250.0200.04320.59
5.5.240.0070.08020.21
5.5.230.0030.08320.32
5.5.220.0130.07320.32
5.5.210.0000.07720.13
5.5.200.0070.08020.16
5.5.190.0230.06720.25
5.5.180.0000.07320.10
5.5.160.0130.07320.25
5.5.150.0130.06720.16
5.5.140.0070.04720.14
5.5.130.0030.08020.18
5.5.120.0030.08320.17
5.5.110.0130.07020.16
5.5.100.0000.04320.15
5.5.90.0100.07020.14
5.5.80.0000.05320.11
5.5.70.0130.03720.17
5.5.60.0100.03720.07
5.5.50.0200.06019.98
5.5.40.0030.05020.07
5.5.30.0030.04319.98
5.5.20.0070.04020.07
5.5.10.0100.07720.06
5.5.00.0130.06320.05
5.4.450.0070.04319.17
5.4.440.0100.06719.45
5.4.430.0070.07019.36
5.4.420.0030.05319.41
5.4.410.0070.07719.14
5.4.400.0100.06718.88
5.4.390.0170.06018.95
5.4.380.0070.06319.18
5.4.370.0100.07019.05
5.4.360.0100.07719.21
5.4.350.0170.06719.14
5.4.340.0100.07718.90
5.4.320.0100.07018.91
5.4.310.0070.08019.05
5.4.300.0030.04319.04
5.4.290.0170.07319.08
5.4.280.0100.05319.04
5.4.270.0100.06718.87
5.4.260.0030.04019.11
5.4.250.0070.04019.02
5.4.240.0070.04719.04
5.4.230.0000.04719.15
5.4.220.0070.05319.12
5.4.210.0100.06019.04
5.4.200.0030.08018.84
5.4.190.0100.07319.11
5.4.180.0100.03018.87
5.4.170.0070.06019.02
5.4.160.0070.04319.11
5.4.150.0070.04018.83
5.4.140.0070.03716.48
5.4.130.0070.07316.50
5.4.120.0070.07016.38
5.4.110.0030.04716.41
5.4.100.0170.03316.39
5.4.90.0130.06716.32
5.4.80.0070.07316.51
5.4.70.0000.05716.46
5.4.60.0030.07316.32
5.4.50.0130.06716.31
5.4.40.0000.08016.53
5.4.30.0100.06716.29
5.4.20.0030.07716.44
5.4.10.0070.03716.32
5.4.00.0100.06715.85
5.3.290.0100.04714.82
5.3.280.0170.02714.70
5.3.270.0100.05314.61
5.3.260.0200.06314.76
5.3.250.0030.07714.69
5.3.240.0070.05714.61
5.3.230.0070.04014.57
5.3.220.0170.06014.66
5.3.210.0070.05314.54
5.3.200.0000.07714.56
5.3.190.0030.05014.61
5.3.180.0100.06714.59
5.3.170.0100.07014.54
5.3.160.0100.06714.51
5.3.150.0070.04314.70
5.3.140.0130.06714.57
5.3.130.0070.07714.60
5.3.120.0100.04314.65
5.3.110.0130.07014.58
5.3.100.0100.07314.03
5.3.90.0070.07014.06
5.3.80.0130.06714.05
5.3.70.0000.07314.11
5.3.60.0100.07013.96
5.3.50.0170.06314.09
5.3.40.0100.05313.88
5.3.30.0200.05014.03
5.3.20.0130.06013.83
5.3.10.0030.06713.67
5.3.00.0030.07013.71
5.2.170.0070.05313.64
5.2.160.0000.06013.64
5.2.150.0030.06713.64
5.2.140.0000.03713.64
5.2.130.0070.06313.64
5.2.120.0000.04013.64
5.2.110.0070.03013.64
5.2.100.0070.03313.64
5.2.90.0070.02713.64
5.2.80.0030.03013.64
5.2.70.0070.02713.64
5.2.60.0030.03013.64
5.2.50.0000.03313.64
5.2.40.0030.05013.64
5.2.30.0070.03313.64
5.2.20.0030.03313.64
5.2.10.0070.02713.64
5.2.00.0100.03013.64
5.1.60.0030.05013.64
5.1.50.0030.03013.64
5.1.40.0070.03013.64
5.1.30.0070.05713.64
5.1.20.0000.06013.64
5.1.10.0070.05313.64
5.1.00.0000.05713.64
5.0.50.0030.04013.64
5.0.40.0070.04013.64
5.0.30.0070.06013.64
5.0.20.0000.04713.64
5.0.10.0030.03013.64
5.0.00.0030.06013.64
4.4.90.0070.01013.64
4.4.80.0000.01713.64
4.4.70.0030.02013.64
4.4.60.0030.02013.64
4.4.50.0030.02013.64
4.4.40.0030.05013.64
4.4.30.0070.02313.64
4.4.20.0030.03713.64
4.4.10.0030.02713.64
4.4.00.0070.05313.64
4.3.110.0030.02713.64
4.3.100.0070.03013.64
4.3.90.0100.01013.64
4.3.80.0000.05313.64
4.3.70.0000.02313.64
4.3.60.0030.01713.64
4.3.50.0000.02313.64
4.3.40.0070.04713.64
4.3.30.0030.03313.64
4.3.20.0000.03713.64
4.3.10.0030.03313.64
4.3.00.0070.02313.64

preferences:
44.3 ms | 400 KiB | 5 Q