3v4l.org

run code in 300+ PHP versions simultaneously
<?php class shapeClass { public function __set($name, $value) { //if (!property_exists($this, $name)) { throw new Exception("No such property: $name"); //} //$this->{$name} = $value; } public function __get($name) { //if (!property_exists($this, $name)) { throw new Exception("No such property: $name"); //} //return $this->{$name}; } } /* Declaring your struct/shape */ $person = new class() extends shapeClass { public $age = 15, $height = 72, $weight = 200; }; var_dump($person); var_dump($person->age); $person->age = 19; var_dump($person->age); try { var_dump($person->badProp); } catch (Exception $e) { var_dump($e); } try { $person->badProp = 5; } catch (Exception $e) { var_dump($e); }

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.01216.63
8.3.50.0140.00821.25
8.3.40.0080.01219.09
8.3.30.0110.00418.79
8.3.20.0040.00420.20
8.3.10.0080.00021.90
8.3.00.0060.00319.80
8.2.180.0060.01318.16
8.2.170.0060.00922.96
8.2.160.0110.00420.28
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0090.00017.50
8.2.110.0030.00621.08
8.2.100.0040.00817.91
8.2.90.0050.00318.03
8.2.80.0040.00417.97
8.2.70.0090.00017.50
8.2.60.0050.00317.93
8.2.50.0080.00018.07
8.2.40.0000.00821.02
8.2.30.0040.00420.77
8.2.20.0000.00717.70
8.2.10.0040.00418.08
8.2.00.0040.00417.98
8.1.280.0090.00625.92
8.1.270.0150.00423.81
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00622.54
8.1.230.0060.00620.84
8.1.220.0060.00317.79
8.1.210.0000.00818.86
8.1.200.0060.00317.25
8.1.190.0070.00417.23
8.1.180.0040.00418.10
8.1.170.0000.00818.59
8.1.160.0040.00422.05
8.1.150.0020.00518.89
8.1.140.0040.00421.24
8.1.130.0040.00417.64
8.1.120.0040.00417.55
8.1.110.0050.00317.40
8.1.100.0050.00217.38
8.1.90.0020.00517.48
8.1.80.0000.00817.45
8.1.70.0030.00317.33
8.1.60.0030.00617.56
8.1.50.0040.00417.59
8.1.40.0050.00617.42
8.1.30.0030.00617.68
8.1.20.0000.01117.57
8.1.10.0050.00217.54
8.1.00.0000.00917.43
8.0.300.0100.00019.89
8.0.290.0060.00316.88
8.0.280.0030.00518.46
8.0.270.0000.00817.29
8.0.260.0000.00717.25
8.0.250.0030.00617.02
8.0.240.0000.00716.91
8.0.230.0030.00716.94
8.0.220.0000.00716.92
8.0.210.0070.00016.96
8.0.200.0000.00617.07
8.0.190.0080.00017.00
8.0.180.0040.00417.06
8.0.170.0000.00816.93
8.0.160.0060.00316.87
8.0.150.0040.00416.98
8.0.140.0070.00016.93
8.0.130.0000.00813.41
8.0.120.0040.00416.85
8.0.110.0080.00016.81
8.0.100.0040.00416.84
8.0.90.0000.00717.02
8.0.80.0150.00316.97
8.0.70.0080.00016.84
8.0.60.0060.00317.09
8.0.50.0050.00216.78
8.0.30.0100.01017.25
8.0.20.0140.00717.41
8.0.10.0040.00417.14
8.0.00.0130.01116.84
7.4.330.0000.00615.08
7.4.320.0030.00316.48
7.4.300.0000.00616.62
7.4.290.0070.00516.59
7.4.280.0040.00416.60
7.4.270.0070.00016.42
7.4.260.0000.00716.49
7.4.250.0100.00016.55
7.4.240.0060.00216.54
7.4.230.0030.00316.69
7.4.220.0150.00416.52
7.4.210.0060.01216.50
7.4.200.0000.00716.62
7.4.160.0070.01016.62
7.4.150.0150.00617.40
7.4.140.0120.01517.86
7.4.130.0100.01216.56
7.4.120.0130.00816.65
7.4.110.0110.00716.51
7.4.100.0040.01516.63
7.4.90.0080.01016.70
7.4.80.0110.00719.39
7.4.70.0070.01116.70
7.4.60.0150.00316.41
7.4.50.0020.00216.29
7.4.40.0090.00916.46
7.4.30.0120.01216.55
7.4.00.0060.00914.96
7.3.330.0050.00013.26
7.3.320.0030.00313.26
7.3.310.0000.00716.46
7.3.300.0030.00316.31
7.3.290.0050.00916.46
7.3.280.0090.00916.43
7.3.270.0070.01017.40
7.3.260.0080.01116.40
7.3.250.0060.01216.40
7.3.240.0190.00716.42
7.3.230.0130.00516.59
7.3.210.0100.00716.43
7.3.200.0120.00816.57
7.3.190.0000.01716.57
7.3.180.0090.00616.55
7.3.170.0100.00716.74
7.3.160.0000.01916.69
7.3.10.0160.00716.57
7.3.00.0120.00616.70
7.2.330.0150.00616.86
7.2.320.0210.00016.36
7.2.310.0130.00316.52
7.2.300.0080.01116.38
7.2.290.0070.01716.60
7.2.130.0000.01316.21
7.2.120.0040.00916.57
7.2.110.0090.00916.32
7.2.100.0100.00616.30
7.2.90.0040.00816.39
7.2.80.0060.00916.63
7.2.70.0090.00816.59
7.2.60.0070.01116.68
7.2.50.0080.01416.55
7.2.40.0150.00617.17
7.2.30.0110.00816.57
7.2.20.0130.00416.86
7.2.10.0000.01117.02
7.2.00.0070.01016.91
7.1.250.0120.00015.23
7.1.200.0080.00415.86
7.1.100.0030.00618.01
7.1.70.0030.01317.18
7.1.60.0110.01519.50
7.1.50.0070.00717.08
7.1.00.0000.07722.48
7.0.200.0000.01016.69
7.0.60.0100.04719.98
7.0.50.0070.04017.89
7.0.40.0070.09320.13
7.0.30.0300.03720.06
7.0.20.0300.08020.23
7.0.10.0170.08020.09
7.0.00.0070.05720.23
5.6.210.0100.08320.76
5.6.200.0130.04018.16
5.6.190.0000.04720.61
5.6.180.0370.07020.34
5.6.170.0170.04720.47
5.6.160.0100.08320.57
5.6.150.0100.05718.23
5.6.140.0070.08318.17
5.6.130.0100.05318.18
5.6.120.0130.04721.13
5.6.110.0100.08321.06
5.6.100.0030.05720.98
5.6.90.0030.08321.11
5.6.80.0070.04320.48
5.5.350.0270.08020.36
5.5.340.0070.08017.99
5.5.330.0030.04320.40
5.5.320.3570.04720.38
5.5.310.0400.07020.30
5.5.300.0030.08018.07
5.5.290.0130.08018.07
5.5.280.0170.07720.69
5.5.270.0100.04320.87
5.5.260.0100.09020.77
5.5.250.0030.04020.61
5.5.240.0200.03720.24
5.4.450.0630.06319.37
5.4.440.0700.05319.54
5.4.430.0670.05319.40
5.4.420.0770.04719.56
5.4.410.0600.06319.38
5.4.400.0670.05719.10
5.4.390.0730.05319.22
5.4.380.0730.05319.08
5.4.370.0870.07019.08
5.4.360.0700.05018.80
5.4.350.0630.05319.10
5.4.340.0700.05019.05
5.4.320.0670.05319.20
5.4.310.0630.05318.94
5.4.300.0670.05018.82
5.4.290.0670.05018.97
5.4.280.0630.05718.84
5.4.270.0630.05019.22
5.4.260.0630.05018.83
5.4.250.0670.04719.05
5.4.240.0670.05019.09
5.4.230.0700.05319.05
5.4.220.0830.04719.29
5.4.210.0670.05318.79
5.4.200.0630.07019.05
5.4.190.0770.04719.30
5.4.180.0770.05719.05
5.4.170.0770.05019.25
5.4.160.0700.05319.04
5.4.150.0600.06019.02
5.4.140.0730.04716.49
5.4.130.0730.07016.53
5.4.120.0830.07016.57
5.4.110.0770.07716.57
5.4.100.0730.04716.30
5.4.90.0730.07316.67
5.4.80.0930.05016.23
5.4.70.0630.05316.65
5.4.60.0730.04316.54
5.4.50.0630.05316.54
5.4.40.0670.05716.50
5.4.30.0700.05316.42
5.4.20.0730.07316.22
5.4.10.0730.05016.54
5.4.00.0630.05315.83

preferences:
75.87 ms | 401 KiB | 5 Q