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($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($this, $property)) { throw new Exception("Invalid Arguments: $property Does not Exists"); } return $this->$property; } } $user = new User(); $user->firstname = "Zia"; echo $user->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.0040.01116.75
8.3.50.0110.00621.09
8.3.40.0140.00718.84
8.3.30.0110.00318.90
8.3.20.0070.00020.34
8.3.10.0070.00021.85
8.3.00.0030.00723.58
8.2.180.0120.00618.17
8.2.170.0000.01522.96
8.2.160.0030.01220.57
8.2.150.0040.00424.18
8.2.140.0000.00924.66
8.2.130.0080.00021.00
8.2.120.0080.00026.35
8.2.110.0060.00319.44
8.2.100.0090.00317.91
8.2.90.0040.00419.17
8.2.80.0000.00817.97
8.2.70.0100.00317.50
8.2.60.0000.00818.05
8.2.50.0060.00318.07
8.2.40.0120.00020.53
8.2.30.0040.00419.37
8.2.20.0000.00717.70
8.2.10.0080.00018.05
8.2.00.0040.00418.05
8.1.280.0110.01125.92
8.1.270.0030.00622.23
8.1.260.0070.00028.09
8.1.250.0000.00728.09
8.1.240.0030.00621.14
8.1.230.0000.01217.45
8.1.220.0080.00017.77
8.1.210.0030.00518.77
8.1.200.0090.00317.48
8.1.190.0090.00017.60
8.1.180.0040.00418.10
8.1.170.0000.00818.78
8.1.160.0040.00420.83
8.1.150.0000.00718.87
8.1.140.0040.00419.68
8.1.130.0000.00717.86
8.1.120.0040.00417.49
8.1.110.0040.00417.37
8.1.100.0000.00717.45
8.1.90.0000.00717.45
8.1.80.0000.00717.54
8.1.70.0070.00017.40
8.1.60.0030.00617.53
8.1.50.0050.00317.46
8.1.40.0050.00317.61
8.1.30.0060.00317.75
8.1.20.0060.00317.60
8.1.10.0000.00817.54
8.1.00.0080.00017.42
8.0.300.0030.00618.77
8.0.290.0030.00516.88
8.0.280.0050.00218.42
8.0.270.0000.00717.36
8.0.260.0000.00617.23
8.0.250.0050.00316.96
8.0.240.0000.00717.02
8.0.230.0000.00717.02
8.0.220.0040.00416.89
8.0.210.0000.00816.84
8.0.200.0000.00617.02
8.0.190.0000.00916.89
8.0.180.0000.00717.00
8.0.170.0030.00516.82
8.0.160.0040.00316.98
8.0.150.0000.00716.92
8.0.140.0030.00616.78
8.0.130.0030.00313.36
8.0.120.0050.00316.82
8.0.110.0040.00316.89
8.0.100.0060.00316.95
8.0.90.0000.00716.84
8.0.80.0100.01116.95
8.0.70.0000.00716.96
8.0.60.0030.00516.86
8.0.50.0000.00716.98
8.0.30.0110.00817.05
8.0.20.0150.01117.40
8.0.10.0050.00216.86
8.0.00.0080.01016.86
7.4.330.0020.00216.69
7.4.320.0000.00616.58
7.4.300.0060.00016.48
7.4.290.0060.00316.64
7.4.280.0030.00516.54
7.4.270.0030.00316.65
7.4.260.0030.00316.69
7.4.250.0030.00316.61
7.4.240.0000.00716.65
7.4.230.0000.00716.48
7.4.220.0150.01016.64
7.4.210.0130.00716.62
7.4.200.0040.00416.38
7.4.160.0070.01016.60
7.4.150.0140.00417.40
7.4.140.0110.00817.86
7.4.130.0100.00616.52
7.4.120.0110.00616.64
7.4.110.0100.00716.64
7.4.100.0130.00416.69
7.4.90.0070.01016.63
7.4.80.0160.00619.39
7.4.70.0140.00316.62
7.4.60.0100.00716.70
7.4.50.0080.00816.21
7.4.40.0030.01316.57
7.4.30.0040.01216.64
7.4.10.0070.01116.77
7.4.00.0060.01015.80
7.3.330.0000.00613.47
7.3.320.0000.00613.34
7.3.310.0080.00016.29
7.3.300.0000.00716.36
7.3.290.0110.00616.41
7.3.280.0100.00716.38
7.3.270.0100.00717.40
7.3.260.0150.00316.31
7.3.250.0090.00816.43
7.3.240.0050.01116.56
7.3.230.0070.01016.77
7.3.210.0160.00016.57
7.3.200.0040.01219.39
7.3.190.0110.00616.57
7.3.180.0110.00616.42
7.3.170.0060.01216.56
7.3.160.0060.00916.57
7.3.130.0040.01516.23
7.3.120.0100.01016.21
7.3.110.0060.01016.23
7.3.100.0080.00416.40
7.3.90.0070.00416.45
7.3.80.0120.00316.32
7.3.70.0070.00416.33
7.3.60.0090.00316.47
7.3.50.0090.00616.48
7.3.40.0110.00616.49
7.3.30.0030.01016.42
7.3.20.0040.00818.12
7.3.10.0050.00817.41
7.3.00.0020.01417.44
7.2.330.0170.00316.59
7.2.320.0060.01216.73
7.2.310.0030.01516.89
7.2.300.0090.01216.81
7.2.290.0060.01016.50
7.2.260.0070.01316.59
7.2.250.0130.00316.77
7.2.240.0070.01016.63
7.2.230.0040.00816.36
7.2.220.0030.01316.59
7.2.210.0130.00016.79
7.2.200.0030.00716.61
7.2.190.0090.01016.68
7.2.180.0060.01216.55
7.2.170.0040.01216.37
7.2.160.0040.01116.41
7.2.150.0030.01418.65
7.2.140.0090.00618.37
7.2.130.0090.00517.54
7.2.120.0080.00917.68
7.2.110.0050.01317.71
7.2.100.0100.00717.59
7.2.90.0130.00217.84
7.2.80.0020.01417.70
7.2.70.0060.00517.75
7.2.60.0050.00817.67
7.2.50.0100.00617.71
7.2.40.0050.00817.76
7.2.30.0090.00717.62
7.2.20.0040.01117.88
7.2.10.0070.00317.68
7.2.00.0060.00618.19
7.1.330.0070.00717.53
7.1.320.0090.00617.31
7.1.310.0070.00717.54
7.1.300.0090.00617.42
7.1.290.0060.01017.33
7.1.280.0070.00417.27
7.1.270.0040.00817.51
7.1.260.0060.01017.27
7.1.250.0020.00816.38
7.1.240.0090.00917.37
7.1.230.0090.00317.22
7.1.220.0070.00317.54
7.1.210.0030.01017.32
7.1.200.0040.01117.20
7.1.190.0060.00317.38
7.1.180.0040.00817.30
7.1.170.0000.00917.31
7.1.160.0070.00717.22
7.1.150.0000.01517.32
7.1.140.0000.01117.38
7.1.130.0070.01017.33
7.1.120.0000.01217.26
7.1.110.0080.00517.36
7.1.100.0090.00817.77
7.1.90.0030.00717.34
7.1.80.0090.00617.33
7.1.70.0050.00717.20
7.1.60.0030.01117.42
7.1.50.0050.01116.99
7.1.40.0130.00017.35
7.1.30.0060.00617.34
7.1.20.0120.00617.27
7.1.10.0030.01317.52
7.1.00.0030.04519.96
7.0.330.0080.00816.96
7.0.320.0000.01017.05
7.0.310.0040.00717.03
7.0.300.0070.00717.09
7.0.290.0000.01316.94
7.0.280.0080.00416.96
7.0.270.0030.01416.98
7.0.260.0100.00317.01
7.0.250.0040.01117.28
7.0.240.0070.00717.16
7.0.230.0070.00716.98
7.0.220.0060.00916.98
7.0.210.0090.00317.25
7.0.200.0050.00516.96
7.0.190.0080.00417.25
7.0.180.0030.01317.17
7.0.170.0040.01416.95
7.0.160.0090.00616.95
7.0.150.0030.01017.07
7.0.140.0070.00716.88
7.0.130.0160.00316.96
7.0.120.0080.00317.02
7.0.110.0090.00617.05
7.0.100.0070.04318.42
7.0.90.0280.03718.48
7.0.80.0170.04718.44
7.0.70.0200.04318.45
7.0.60.0240.03818.37
7.0.50.0250.03518.71
7.0.40.0110.03617.45
7.0.30.0120.04317.43
7.0.20.0090.04017.49
7.0.10.0020.04717.48
7.0.00.0130.03717.52
5.6.400.0100.00716.06
5.6.390.0040.00716.29
5.6.380.0030.01016.06
5.6.370.0080.00616.29
5.6.360.0110.00415.70
5.6.350.0000.00916.14
5.6.340.0140.00316.03
5.6.330.0000.01016.16
5.6.320.0030.00616.11
5.6.310.0100.00616.14
5.6.300.0110.00415.72
5.6.290.0000.01416.02
5.6.280.0030.01015.85
5.6.270.0080.01215.69
5.6.260.0100.00316.05
5.6.250.0050.04718.34
5.6.240.0030.04018.26
5.6.230.0070.04018.20
5.6.220.0110.03318.28
5.6.210.0080.03818.23
5.6.200.0080.04418.46
5.6.190.0100.03318.54
5.6.180.0070.05018.45
5.6.170.0080.04018.58
5.6.160.0050.03918.38
5.6.150.0070.03718.47
5.6.140.0050.03618.42
5.6.130.0090.04918.55
5.6.120.0100.04218.52
5.6.110.0030.04718.63
5.6.100.0070.04718.58
5.6.90.0050.04818.44
5.6.80.0100.04318.05
5.6.70.0130.04018.12
5.6.60.0070.04518.15
5.6.50.0050.03918.29
5.6.40.0080.04018.11
5.6.30.0050.04518.29
5.6.20.0080.04118.28
5.6.10.0070.02718.13
5.6.00.0100.03218.29
5.5.380.0080.04118.14
5.5.370.0100.04018.08
5.5.360.0030.04618.23
5.5.350.0060.02818.10
5.5.340.0080.03318.33
5.5.330.0100.03818.25
5.5.320.0150.03718.39
5.5.310.0110.04018.40
5.5.300.0090.03718.20
5.5.290.0070.04518.41
5.5.280.0130.04018.37
5.5.270.0080.04518.17
5.5.260.0080.04718.23
5.5.250.0150.04018.23
5.5.240.0100.03617.98
5.5.230.0120.04018.02
5.5.220.0070.03817.96
5.5.210.0040.04717.91
5.5.200.0070.04118.04
5.5.190.0120.04018.05
5.5.180.0080.04318.05
5.5.170.0110.00015.72
5.5.160.0070.02517.95
5.5.150.0070.04017.82
5.5.140.0070.03217.89
5.5.130.0050.04218.10
5.5.120.0060.04618.05
5.5.110.0100.03818.11
5.5.100.0020.04817.92
5.5.90.0050.04417.85
5.5.80.0030.04417.93
5.5.70.0020.03318.04
5.5.60.0070.04017.97
5.5.50.0050.04517.78
5.5.40.0100.03117.95
5.5.30.0050.02817.98
5.5.20.0100.04017.99
5.5.10.0080.04517.85
5.5.00.0050.03517.95

preferences:
58.84 ms | 401 KiB | 5 Q