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.0110.00416.63
8.3.50.0100.01021.20
8.3.40.0130.00618.80
8.3.30.0140.00018.67
8.3.20.0050.00320.38
8.3.10.0050.00321.89
8.3.00.0040.00417.80
8.2.180.0090.00918.31
8.2.170.0140.00722.96
8.2.160.0100.00320.57
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0090.00017.63
8.2.110.0110.00020.43
8.2.100.0040.00817.93
8.2.90.0000.00819.27
8.2.80.0030.00617.97
8.2.70.0030.00617.50
8.2.60.0000.00817.80
8.2.50.0000.00818.07
8.2.40.0080.00021.06
8.2.30.0000.00820.69
8.2.20.0000.00817.57
8.2.10.0020.00517.98
8.2.00.0040.00418.00
8.1.280.0040.01125.92
8.1.270.0090.00623.96
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.57
8.1.230.0060.00619.13
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0040.00417.35
8.1.190.0030.00517.35
8.1.180.0040.00418.10
8.1.170.0040.00418.46
8.1.160.0040.00421.95
8.1.150.0040.00418.81
8.1.140.0040.00421.41
8.1.130.0000.00717.71
8.1.120.0070.00017.41
8.1.110.0070.00017.46
8.1.100.0000.00817.46
8.1.90.0000.00717.46
8.1.80.0000.00717.33
8.1.70.0040.00417.52
8.1.60.0000.00817.59
8.1.50.0000.00717.46
8.1.40.0000.01017.44
8.1.30.0050.00517.57
8.1.20.0070.00317.57
8.1.10.0000.00817.52
8.1.00.0030.00617.34
8.0.300.0030.00618.77
8.0.290.0000.00716.59
8.0.280.0030.00318.39
8.0.270.0040.00417.34
8.0.260.0070.00017.18
8.0.250.0000.00716.99
8.0.240.0000.00817.04
8.0.230.0040.00716.96
8.0.220.0040.00417.02
8.0.210.0080.00016.93
8.0.200.0030.00316.96
8.0.190.0040.00417.00
8.0.180.0000.00716.87
8.0.170.0000.00916.83
8.0.160.0040.00417.02
8.0.150.0050.00216.95
8.0.140.0070.00016.97
8.0.130.0080.00013.47
8.0.120.0040.00416.90
8.0.110.0040.00416.96
8.0.100.0000.00716.91
8.0.90.0080.00017.01
8.0.80.0030.01316.85
8.0.70.0000.00816.79
8.0.60.0050.00316.95
8.0.50.0040.00416.77
8.0.30.0100.01017.19
8.0.20.0100.01117.40
8.0.10.0000.00817.08
8.0.00.0140.00616.78
7.4.330.0060.00015.08
7.4.320.0000.00716.51
7.4.300.0070.00016.65
7.4.290.0110.00016.41
7.4.280.0040.00416.60
7.4.270.0030.00316.61
7.4.260.0030.00316.39
7.4.250.0080.00016.48
7.4.240.0040.00416.56
7.4.230.0030.00316.40
7.4.220.0070.01116.64
7.4.210.0100.01016.64
7.4.200.0040.00416.35
7.4.160.0080.00816.40
7.4.150.0160.00417.40
7.4.140.0110.01517.86
7.4.130.0090.01116.44
7.4.120.0090.01416.61
7.4.110.0110.00716.56
7.4.100.0120.00616.48
7.4.90.0110.00616.51
7.4.80.0110.00519.39
7.4.70.0040.01416.67
7.4.60.0200.00316.41
7.4.50.0040.00016.80
7.4.40.0140.00616.53
7.4.30.0110.01116.74
7.4.00.0070.01015.01
7.3.330.0030.00313.09
7.3.320.0030.00313.23
7.3.310.0050.00316.16
7.3.300.0040.00416.32
7.3.290.0030.01216.28
7.3.280.0070.01116.26
7.3.270.0140.00317.40
7.3.260.0150.00316.30
7.3.250.0110.00616.52
7.3.240.0120.01316.43
7.3.230.0100.00816.39
7.3.210.0130.00316.33
7.3.200.0090.01416.45
7.3.190.0030.01316.31
7.3.180.0060.00916.30
7.3.170.0140.00716.37
7.3.160.0160.00016.24
7.3.10.0060.01016.47
7.3.00.0030.01016.53
7.2.330.0130.00416.83
7.2.320.0000.01716.87
7.2.310.0090.01316.54
7.2.300.0100.00616.45
7.2.290.0110.00816.77
7.2.130.0060.00916.87
7.2.120.0030.00916.86
7.2.110.0000.01716.88
7.2.100.0040.00817.03
7.2.90.0040.00816.61
7.2.80.0000.01517.09
7.2.70.0000.01416.84
7.2.60.0050.00716.79
7.2.50.0080.00816.98
7.2.40.0060.00616.98
7.2.30.0100.00316.75
7.2.20.0060.01216.96
7.2.10.0070.00416.93
7.2.00.0070.00716.70
7.1.250.0110.00415.77
7.1.200.0030.01015.88
7.1.70.0030.00317.17
7.1.60.0130.01019.50
7.1.50.0040.01416.99
7.1.00.0030.07722.40
7.0.200.0000.00716.40
7.0.60.0070.04020.01
7.0.50.0070.08017.88
7.0.40.0070.08020.24
7.0.30.0270.07020.16
7.0.20.0230.05320.16
7.0.10.0200.06720.18
7.0.00.0070.08020.29
5.6.280.0000.03320.83
5.6.210.0070.07320.66
5.6.200.0070.08018.16
5.6.190.0100.04320.77
5.6.180.0330.07020.57
5.6.170.0430.07720.71
5.6.160.0100.07720.55
5.6.150.0030.07718.16
5.6.140.0070.05718.28
5.6.130.0100.07018.19
5.6.120.0100.09021.06
5.6.110.0170.07321.00
5.6.100.0100.08320.96
5.6.90.0100.04720.97
5.6.80.0100.06720.41
5.5.350.0100.07320.41
5.5.340.0100.07317.99
5.5.330.0070.08020.35
5.5.320.3400.04020.26
5.5.310.0500.07020.41
5.5.300.0070.07318.03
5.5.290.0070.08717.99
5.5.280.0000.05020.77
5.5.270.0000.05020.65
5.5.260.0100.08020.96
5.5.250.0070.08320.43
5.5.240.0200.07320.36
5.4.450.0230.05019.62
5.4.440.0170.05719.46
5.4.430.0230.04719.62
5.4.420.0330.03719.46
5.4.410.0330.05319.17
5.4.400.0300.05019.23
5.4.390.0330.06018.87
5.4.380.0230.04719.37
5.4.370.0270.04318.80
5.4.360.0130.05719.28
5.4.350.0270.04319.25
5.4.340.0070.06718.84
5.4.320.0170.05318.87
5.4.310.0230.06319.01
5.4.300.0370.06319.05
5.4.290.0330.04018.86
5.4.280.0130.05719.12
5.4.270.0200.05018.83
5.4.260.0170.05018.87
5.4.250.0230.04718.96
5.4.240.0200.05019.05
5.4.230.0170.05319.27
5.4.220.0200.05019.23
5.4.210.0130.06319.36
5.4.200.0270.05319.38
5.4.190.0200.05019.21
5.4.180.0270.04319.29
5.4.170.0230.04718.82
5.4.160.0230.04319.11
5.4.150.0130.05719.16
5.4.140.0130.05316.44
5.4.130.0130.05316.70
5.4.120.0130.05716.52
5.4.110.0200.05716.50
5.4.100.0230.05016.25
5.4.90.0300.04016.69
5.4.80.0300.06016.58
5.4.70.0300.06016.48
5.4.60.0130.05716.17
5.4.50.0200.05316.40
5.4.40.0130.05016.22
5.4.30.0070.05716.42
5.4.20.0130.05716.59
5.4.10.0100.06316.61
5.4.00.0230.04315.80

preferences:
50.79 ms | 401 KiB | 5 Q