3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User { private $firstname; private $lastname; private $age; public function __contruct() { $this->firstname = null; $this->lastname = null; $this->age = null; } public function __set($property, $value) { $property = trim(strtolower($property)); if (!property_exists($this, $property)) { throw new Exception("$property does not exists"); } if( !isset($value) && empty($value)) { throw new Exception("$property Can not be NULL or EMPTY"); } switch($property) { case "firstname": case "lastname": if(!is_string($value)) { throw new Exception("$property must be a String"); } $this->$property = $value; break; case "age": if(!is_int($value)) { throw new Exception("TypeError : $property must be an Integer Value"); } $this->$property = $value; break; default: throw new Exception("Invalid Exception."); break; } } public function __get($property) { if(!property_exists($property)) { throw new Exception("Invalid Arguments: $property Does not Exists"); } return $this->$property; } } $user = new User(); $user->set("firstname", "Zia"); echo $user->get("firstname");

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.0150.00616.75
8.3.50.0070.00716.39
8.3.40.0120.00918.80
8.3.30.0080.00818.88
8.3.20.0040.00420.40
8.3.10.0080.00023.65
8.3.00.0050.00323.61
8.2.180.0110.00418.41
8.2.170.0090.00922.96
8.2.160.0160.00620.53
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00821.04
8.2.120.0070.00026.35
8.2.110.0000.00922.11
8.2.100.0000.01217.66
8.2.90.0030.00917.97
8.2.80.0040.00417.97
8.2.70.0000.00817.36
8.2.60.0040.00418.04
8.2.50.0060.00318.10
8.2.40.0060.00320.64
8.2.30.0070.00019.36
8.2.20.0050.00317.64
8.2.10.0070.00018.11
8.2.00.0000.00717.92
8.1.280.0210.00025.92
8.1.270.0110.00422.18
8.1.260.0050.00228.09
8.1.250.0070.00028.09
8.1.240.0060.00323.97
8.1.230.0090.00322.64
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0030.00617.23
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0060.00318.59
8.1.160.0070.00022.07
8.1.150.0000.00818.83
8.1.140.0030.00519.61
8.1.130.0040.00417.72
8.1.120.0050.00217.35
8.1.110.0020.00517.43
8.1.100.0000.00817.38
8.1.90.0040.00417.47
8.1.80.0040.00417.45
8.1.70.0000.00817.37
8.1.60.0030.00617.58
8.1.50.0040.00417.57
8.1.40.0030.00517.64
8.1.30.0030.00617.62
8.1.20.0000.00817.69
8.1.10.0000.00717.53
8.1.00.0030.00517.45
8.0.300.0070.00020.29
8.0.290.0040.00416.88
8.0.280.0070.00018.39
8.0.270.0070.00017.16
8.0.260.0000.00717.18
8.0.250.0030.00317.07
8.0.240.0030.00317.04
8.0.230.0050.00316.91
8.0.220.0000.00716.88
8.0.210.0000.00716.94
8.0.200.0030.00316.99
8.0.190.0000.00817.01
8.0.180.0080.00017.02
8.0.170.0020.00516.97
8.0.160.0040.00416.92
8.0.150.0000.00716.88
8.0.140.0000.00816.92
8.0.130.0000.00513.36
8.0.120.0040.00416.80
8.0.110.0000.00716.95
8.0.100.0000.00816.97
8.0.90.0070.00016.98
8.0.80.0120.00916.93
8.0.70.0040.00416.95
8.0.60.0000.00716.83
8.0.50.0000.00716.81
8.0.30.0060.01116.99
8.0.20.0110.01117.40
8.0.10.0050.00317.00
8.0.00.0080.01316.72
7.4.330.0000.00616.77
7.4.320.0030.00316.59
7.4.300.0030.00316.57
7.4.290.0030.00316.58
7.4.280.0000.00816.63
7.4.270.0000.00816.41
7.4.260.0000.00716.68
7.4.250.0080.00016.63
7.4.240.0030.00516.52
7.4.230.0000.00816.70
7.4.220.0100.00616.66
7.4.210.0040.01116.65
7.4.200.0000.00716.69
7.4.160.0090.00616.61
7.4.150.0080.01617.40
7.4.140.0140.00617.86
7.4.130.0110.00716.46
7.4.120.0070.01616.60
7.4.110.0100.00716.57
7.4.100.0150.00316.48
7.4.90.0110.00716.59
7.4.80.0120.00619.39
7.4.70.0070.01016.33
7.4.60.0070.01016.57
7.4.50.0040.01116.60
7.4.40.0080.00816.56
7.4.30.0060.01016.45
7.4.00.0040.01414.96
7.3.330.0000.00613.32
7.3.320.0030.00313.16
7.3.310.0040.00416.22
7.3.300.0000.00716.15
7.3.290.0060.00916.31
7.3.280.0080.00716.38
7.3.270.0120.01217.40
7.3.260.0070.01016.39
7.3.240.0110.00516.33
7.3.230.0030.01416.39
7.3.210.0040.01316.35
7.3.200.0100.00619.39
7.3.190.0040.01216.46
7.3.180.0100.00616.40
7.3.170.0160.00316.34
7.3.160.0130.00916.32
7.3.120.0120.00615.02
7.3.110.0130.00314.97
7.3.100.0090.00014.70
7.3.90.0040.01114.55
7.3.80.0030.01014.76
7.3.70.0110.00614.45
7.3.60.0070.01014.77
7.3.50.0070.00714.82
7.3.40.0000.01414.65
7.3.30.0040.01114.81
7.3.20.0000.00916.61
7.3.10.0060.00716.47
7.3.00.0070.00916.56
7.2.330.0160.00316.43
7.2.320.0120.00916.68
7.2.310.0060.01216.67
7.2.300.0120.00616.63
7.2.290.0090.00916.66
7.2.250.0100.01015.09
7.2.240.0120.00614.86
7.2.230.0090.00614.69
7.2.220.0060.00915.05
7.2.210.0090.00614.97
7.2.200.0030.01314.93
7.2.190.0070.01014.73
7.2.180.0030.01314.95
7.2.170.0040.01114.91
7.2.130.0030.01016.50
7.2.120.0060.00616.75
7.2.110.0000.01916.27
7.2.100.0150.00016.70
7.2.90.0060.00816.74
7.2.80.0040.01116.47
7.2.70.0160.00016.63
7.2.60.0070.00916.62
7.2.50.0090.00616.64
7.2.40.0130.00016.53
7.2.30.0110.01116.44
7.2.20.0130.00516.27
7.2.10.0130.01316.45
7.2.00.0060.00718.04
7.1.330.0080.00615.30
7.1.320.0030.00615.53
7.1.310.0030.01315.73
7.1.300.0070.00715.72
7.1.290.0090.00615.45
7.1.280.0080.00815.70
7.1.270.0100.01015.58
7.1.260.0040.01115.61
7.1.250.0140.00715.49
7.1.200.0050.01015.20
7.1.100.0060.00318.23
7.1.70.0040.00416.71
7.1.60.0000.02219.28
7.1.50.0040.00716.72
7.1.00.0070.07022.48
7.0.200.0050.00316.71
7.0.60.0070.08021.78
7.0.50.0070.03717.88
7.0.40.0070.04720.52
7.0.30.0330.07020.09
7.0.20.0230.04320.30
7.0.10.0030.07720.21
7.0.00.0030.06020.09
5.6.280.0070.06021.12
5.6.210.0030.09020.68
5.6.200.0030.05718.14
5.6.190.0070.04320.61
5.6.180.0230.04720.77
5.6.170.0370.07020.54
5.6.160.0030.04320.47
5.6.150.0070.08018.27
5.6.140.0070.07718.23
5.6.130.0030.05318.19
5.6.120.0070.08321.06
5.6.110.0030.04321.13
5.6.100.0030.04021.01
5.6.90.0070.04021.02
5.6.80.0100.07320.48
5.5.350.2700.03720.35
5.5.340.0070.08017.98
5.5.330.0030.05020.25
5.5.320.0530.06020.51
5.5.310.0300.08320.23
5.5.300.0100.06317.95
5.5.290.0200.05318.08
5.5.280.0130.07020.82
5.5.270.0070.04020.78
5.5.260.0130.06320.99
5.5.250.0030.08720.80
5.5.240.0270.06720.05

preferences:
55.01 ms | 400 KiB | 5 Q