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->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.0140.00717.00
8.3.50.0120.00621.20
8.3.40.0120.00318.84
8.3.30.0110.00718.84
8.3.20.0040.00420.21
8.3.10.0000.00723.66
8.3.00.0040.00423.61
8.2.180.0100.00618.54
8.2.170.0070.01022.96
8.2.160.0070.00720.41
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0050.00321.09
8.2.120.0040.00426.35
8.2.110.0050.00520.93
8.2.100.0070.00418.03
8.2.90.0050.00319.17
8.2.80.0030.00518.03
8.2.70.0060.00317.63
8.2.60.0090.00317.93
8.2.50.0000.00918.07
8.2.40.0100.00020.63
8.2.30.0040.00419.54
8.2.20.0000.00717.91
8.2.10.0000.00718.03
8.2.00.0000.00717.98
8.1.280.0100.00725.92
8.1.270.0030.01922.31
8.1.260.0050.00228.09
8.1.250.0070.00028.09
8.1.240.0040.00422.55
8.1.230.0040.00719.14
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0060.00317.22
8.1.180.0000.00818.10
8.1.170.0050.00318.56
8.1.160.0000.00720.77
8.1.150.0050.00218.82
8.1.140.0000.00819.66
8.1.130.0070.00017.71
8.1.120.0040.00417.48
8.1.110.0040.00417.47
8.1.100.0000.00717.49
8.1.90.0030.00517.43
8.1.80.0000.00717.46
8.1.70.0000.00717.42
8.1.60.0040.00417.66
8.1.50.0050.00317.57
8.1.40.0060.00317.54
8.1.30.0050.00517.68
8.1.20.0030.00517.67
8.1.10.0040.00417.65
8.1.00.0030.00617.52
8.0.300.0000.00818.77
8.0.290.0040.00416.73
8.0.280.0000.00818.41
8.0.270.0000.00717.31
8.0.260.0030.00317.29
8.0.250.0030.00317.07
8.0.240.0000.00716.90
8.0.230.0070.00017.07
8.0.220.0040.00416.94
8.0.210.0070.00017.05
8.0.200.0060.00016.97
8.0.190.0050.00317.05
8.0.180.0040.00416.95
8.0.170.0050.00316.88
8.0.160.0000.00716.90
8.0.150.0030.00716.98
8.0.140.0040.00416.95
8.0.130.0000.00613.45
8.0.120.0080.00016.86
8.0.110.0040.00416.87
8.0.100.0030.00517.01
8.0.90.0040.00417.03
8.0.80.0100.00716.98
8.0.70.0050.00316.95
8.0.60.0050.00217.01
8.0.50.0040.00416.88
8.0.30.0070.01117.25
8.0.20.0110.00917.40
8.0.10.0030.00517.16
8.0.00.0060.01116.90
7.4.330.0060.00016.73
7.4.320.0030.00316.64
7.4.300.0030.00316.66
7.4.290.0060.00316.66
7.4.280.0040.00416.63
7.4.270.0030.00316.59
7.4.260.0040.00416.57
7.4.250.0050.00316.54
7.4.240.0000.00716.55
7.4.230.0030.00316.68
7.4.220.0070.01416.56
7.4.210.0070.00716.62
7.4.200.0030.00316.30
7.4.160.0080.00616.58
7.4.150.0040.01317.40
7.4.140.0080.01217.86
7.4.130.0070.01116.69
7.4.120.0070.01416.49
7.4.110.0150.00316.67
7.4.100.0100.00716.55
7.4.90.0160.00616.67
7.4.80.0070.01019.39
7.4.70.0100.00716.50
7.4.60.0080.00816.51
7.4.50.0090.00616.43
7.4.40.0100.00716.67
7.4.30.0140.00616.52
7.4.00.0070.00715.26
7.3.330.0060.00013.41
7.3.320.0030.00313.44
7.3.310.0030.00416.49
7.3.300.0000.00716.23
7.3.290.0100.00816.43
7.3.280.0100.00816.46
7.3.270.0100.00717.40
7.3.260.0090.01016.44
7.3.250.0100.00716.36
7.3.240.0070.01016.58
7.3.230.0060.01216.45
7.3.210.0130.00316.46
7.3.200.0060.01319.39
7.3.190.0080.00816.47
7.3.180.0130.00316.59
7.3.170.0040.01216.61
7.3.160.0070.01416.64
7.2.330.0100.01316.82
7.2.320.0070.01616.39
7.2.310.0110.00816.71
7.2.300.0120.00616.76
7.2.290.0120.00916.77
7.2.60.0060.00916.86
7.2.00.0040.01819.21
7.1.200.0060.00615.82
7.1.100.0000.01118.21
7.1.70.0000.00817.34
7.1.60.0090.00919.28
7.1.50.0000.01016.84
7.1.00.0030.08022.46
7.0.200.0080.00016.77
7.0.60.0030.06721.70
7.0.50.0000.04317.86
7.0.40.0230.04020.26
7.0.30.0230.08020.27
7.0.20.0230.08020.19
7.0.10.0170.08020.08
7.0.00.0100.08320.20
5.6.280.0030.05021.14
5.6.210.0130.08020.73
5.6.200.0170.06318.16
5.6.190.0130.04720.63
5.6.180.0300.08320.55
5.6.170.0430.07320.39
5.6.160.0100.08020.48
5.6.150.0130.07018.18
5.6.140.0030.08718.25
5.6.130.0070.04018.27
5.6.120.0170.07721.15
5.6.110.0030.06020.99
5.6.100.0070.04320.88
5.6.90.0100.08321.14
5.6.80.0070.04020.40
5.5.350.4430.03720.46
5.5.340.0070.08317.98
5.5.330.0000.04720.38
5.5.320.0430.05020.34
5.5.310.0300.07020.27
5.5.300.0130.07017.95
5.5.290.0070.08017.99
5.5.280.0170.03320.70
5.5.270.0130.07320.74
5.5.260.0000.09020.69
5.5.250.0070.09020.68
5.5.240.0170.07020.28

preferences:
50.52 ms | 401 KiB | 5 Q