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.0070.00716.73
8.3.50.0160.01221.19
8.3.40.0070.01318.57
8.3.30.0070.00718.81
8.3.20.0030.00620.15
8.3.10.0040.00421.75
8.3.00.0040.00417.88
8.2.180.0000.01918.51
8.2.170.0110.00422.96
8.2.160.0100.00320.53
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00417.75
8.2.110.0060.00319.30
8.2.100.0080.00317.72
8.2.90.0000.00818.15
8.2.80.0040.00417.97
8.2.70.0080.00017.63
8.2.60.0030.00517.93
8.2.50.0060.00318.07
8.2.40.0050.00321.10
8.2.30.0000.00720.72
8.2.20.0040.00417.69
8.2.10.0050.00217.95
8.2.00.0040.00418.13
8.1.280.0070.00725.92
8.1.270.0040.00423.96
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0090.00022.55
8.1.230.0080.00420.97
8.1.220.0080.00017.74
8.1.210.0030.00618.82
8.1.200.0030.00717.35
8.1.190.0070.00417.38
8.1.180.0000.00718.10
8.1.170.0080.00018.48
8.1.160.0000.00721.90
8.1.150.0000.00818.91
8.1.140.0000.00821.36
8.1.130.0000.00717.74
8.1.120.0040.00417.38
8.1.110.0040.00417.46
8.1.100.0000.00717.44
8.1.90.0070.00017.34
8.1.80.0030.00517.54
8.1.70.0070.00017.45
8.1.60.0040.00417.48
8.1.50.0040.00417.44
8.1.40.0070.00317.48
8.1.30.0000.00917.63
8.1.20.0060.00317.61
8.1.10.0000.00717.39
8.1.00.0050.00317.45
8.0.300.0040.00419.94
8.0.290.0000.00716.75
8.0.280.0040.00418.36
8.0.270.0040.00417.18
8.0.260.0030.00317.33
8.0.250.0050.00316.94
8.0.240.0000.00817.04
8.0.230.0030.00617.03
8.0.220.0030.00316.96
8.0.210.0000.00716.96
8.0.200.0070.00017.02
8.0.190.0040.00416.89
8.0.180.0040.00416.98
8.0.170.0000.00916.97
8.0.160.0060.00316.87
8.0.150.0000.00716.91
8.0.140.0000.00716.91
8.0.130.0050.00013.38
8.0.120.0080.00016.94
8.0.110.0040.00416.96
8.0.100.0040.00416.99
8.0.90.0080.00016.77
8.0.80.0000.01517.01
8.0.70.0020.00517.06
8.0.60.0030.00516.86
8.0.50.0040.00417.01
8.0.30.0130.00617.05
8.0.20.0100.00817.40
8.0.10.0000.00716.95
8.0.00.0090.01116.74
7.4.330.0000.00515.08
7.4.320.0030.00316.52
7.4.300.0000.00616.63
7.4.290.0040.00716.40
7.4.280.0030.00516.52
7.4.270.0030.00316.55
7.4.260.0060.00016.47
7.4.250.0050.00216.44
7.4.240.0020.00516.51
7.4.230.0030.00316.61
7.4.220.0130.00716.41
7.4.210.0120.00916.68
7.4.200.0030.00316.63
7.4.160.0030.01216.50
7.4.150.0110.00717.40
7.4.140.0120.01417.86
7.4.130.0040.01716.49
7.4.120.0120.00716.49
7.4.110.0070.01116.58
7.4.100.0100.01316.47
7.4.90.0100.00716.47
7.4.80.0100.01019.39
7.4.70.0080.00816.31
7.4.60.0000.01716.60
7.4.50.0030.00316.20
7.4.40.0070.01416.39
7.4.30.0090.00916.53
7.4.00.0070.00715.01
7.3.330.0000.00513.27
7.3.320.0000.00613.13
7.3.310.0060.00016.20
7.3.300.0040.00416.11
7.3.290.0090.00616.29
7.3.280.0080.00916.33
7.3.270.0120.00417.40
7.3.260.0110.00616.44
7.3.240.0130.00716.35
7.3.230.0100.01316.52
7.3.210.0090.00916.27
7.3.200.0090.00916.52
7.3.190.0090.00616.51
7.3.180.0090.00616.47
7.3.170.0060.00916.38
7.3.160.0160.00016.57
7.3.10.0030.00716.27
7.3.00.0000.01116.75
7.2.330.0120.00616.75
7.2.320.0220.02816.54
7.2.310.0070.01016.47
7.2.300.0070.01016.57
7.2.290.0110.00816.65
7.2.130.0030.01216.88
7.2.120.0030.00816.88
7.2.110.0030.01016.79
7.2.100.0110.00316.75
7.2.90.0080.00616.63
7.2.80.0090.00616.72
7.2.70.0000.01716.96
7.2.60.0040.01016.68
7.2.50.0120.00416.78
7.2.40.0000.01116.98
7.2.30.0000.01416.99
7.2.20.0090.00616.55
7.2.10.0100.00316.75
7.2.00.0090.00718.15
7.1.250.0100.00315.79
7.1.200.0030.01015.53
7.1.100.0070.00718.15
7.1.70.0060.01317.07
7.1.60.0130.01319.50
7.1.50.0090.00316.91
7.1.00.0070.07322.31
7.0.200.0000.00716.66
7.0.60.0100.08719.94
7.0.50.0070.04717.97
7.0.40.0030.08020.31
7.0.30.0270.03320.33
7.0.20.0270.04020.30
7.0.10.0070.09020.11
7.0.00.0100.07320.22
5.6.280.0030.03320.98
5.6.210.0170.07020.71
5.6.200.0030.04718.20
5.6.190.0100.03720.54
5.6.180.0400.06320.58
5.6.170.0230.04320.48
5.6.160.0100.04720.57
5.6.150.0070.05018.25
5.6.140.0000.05018.15
5.6.130.0100.08018.28
5.6.120.0030.07320.88
5.6.110.0130.06021.14
5.6.100.0130.05020.98
5.6.90.0100.06720.97
5.6.80.0100.03320.44
5.5.350.0000.08320.43
5.5.340.0130.07017.96
5.5.330.0000.04720.21
5.5.320.3100.05020.34
5.5.310.0300.08020.35
5.5.300.0070.08317.98
5.5.290.0070.05717.94
5.5.280.0030.04720.98
5.5.270.0070.04320.72
5.5.260.0030.09720.96
5.5.250.0170.07720.55
5.5.240.0330.03320.35
5.4.450.0170.06019.61
5.4.440.0230.05319.33
5.4.430.0270.04719.60
5.4.420.0230.04719.57
5.4.410.0300.06719.44
5.4.400.0200.05019.15
5.4.390.0200.05719.12
5.4.380.0300.04318.86
5.4.370.0170.05319.14
5.4.360.0200.06318.84
5.4.350.0230.05018.87
5.4.340.0200.05719.15
5.4.320.0200.05319.05
5.4.310.0170.05719.37
5.4.300.0270.04719.14
5.4.290.0170.04719.02
5.4.280.0230.04319.05
5.4.270.0070.05719.14
5.4.260.0230.05019.36
5.4.250.0170.05318.83
5.4.240.0270.04718.99
5.4.230.0230.04719.29
5.4.220.0200.05719.00
5.4.210.0200.05019.24
5.4.200.0200.04719.27
5.4.190.0230.04719.24
5.4.180.0200.05019.26
5.4.170.0130.05719.36
5.4.160.0100.06019.25
5.4.150.0200.05319.12
5.4.140.0130.05716.43
5.4.130.0170.05016.52
5.4.120.0200.05316.32
5.4.110.0270.04316.67
5.4.100.0200.04716.25
5.4.90.0200.05316.62
5.4.80.0130.05016.63
5.4.70.0130.05716.68
5.4.60.0170.04716.43
5.4.50.0230.05016.17
5.4.40.0170.04716.64
5.4.30.0200.05716.40
5.4.20.0200.05316.58
5.4.10.0230.05316.56
5.4.00.0300.03715.74

preferences:
48 ms | 401 KiB | 5 Q