3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Book { private $bookProperties; private $bookMethods; public function __construct(Array $properties = []) { $this->bookProperties = array(); $this->bookMethods = array(); foreach ($properties as $property => $value) { $this->bookProperties[$property] = $value; } } public function __get($property) { if (!in_array($property, $this->bookProperties)) { throw new \Exception('No such property: ' . $property); } else { return $this->bookProperties[$property]; } } public function __set($property, $value) { $this->bookProperties[$property] = $value; } public function addMethod($methodName, $methodCallable) { if (!is_callable($methodCallable)) { throw new InvalidArgumentException('Second parameter must be callable'); } else { $this->bookMethods[$methodName] = $methodCallable; } } public function __call($methodName, Array $args) { if (!in_array($methodName, $this->bookMethods)) { throw new \Exception('No such method: ' . $methodName); } else { return call_user_func_array([$this, $methodName], $args); } } } $book = new Book; $book->title = 'Code Complete'; print $book->title;

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.00016.88
8.3.50.0100.01316.50
8.3.40.0100.01018.78
8.3.30.0120.00618.87
8.3.20.0050.00220.34
8.3.10.0070.00021.89
8.3.00.0090.00021.55
8.2.180.0040.01116.63
8.2.170.0090.00622.96
8.2.160.0000.01720.43
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0050.00321.00
8.2.120.0140.00026.35
8.2.110.0090.00020.83
8.2.100.0090.00318.03
8.2.90.0040.00418.09
8.2.80.0030.00518.07
8.2.70.0030.00617.75
8.2.60.0000.01017.80
8.2.50.0080.00018.09
8.2.40.0060.00320.42
8.2.30.0070.00019.43
8.2.20.0040.00417.71
8.2.10.0030.00618.20
8.2.00.0000.00718.18
8.1.280.0100.00725.92
8.1.270.0040.00422.13
8.1.260.0080.00028.09
8.1.250.0080.00028.09
8.1.240.0070.00422.54
8.1.230.0060.00620.91
8.1.220.0060.00317.80
8.1.210.0050.00318.93
8.1.200.0060.00317.35
8.1.190.0050.00317.36
8.1.180.0060.00318.10
8.1.170.0000.00818.64
8.1.160.0000.00720.73
8.1.150.0040.00419.02
8.1.140.0050.00319.57
8.1.130.0050.00317.60
8.1.120.0000.00817.39
8.1.110.0040.00417.48
8.1.100.0050.00317.52
8.1.90.0000.00717.51
8.1.80.0030.00617.50
8.1.70.0000.00717.46
8.1.60.0040.00417.61
8.1.50.0000.00817.61
8.1.40.0080.00017.62
8.1.30.0060.00317.53
8.1.20.0070.00317.59
8.1.10.0040.00417.62
8.1.00.0030.00617.40
8.0.300.0040.00419.98
8.0.290.0040.00416.88
8.0.280.0080.00018.47
8.0.270.0030.00317.32
8.0.260.0000.00617.29
8.0.250.0000.00716.96
8.0.240.0070.00017.04
8.0.230.0000.00716.95
8.0.220.0040.00416.97
8.0.210.0040.00416.86
8.0.200.0030.00616.93
8.0.190.0000.00817.03
8.0.180.0000.00716.90
8.0.170.0070.00316.93
8.0.160.0020.00516.95
8.0.150.0040.00416.89
8.0.140.0000.00816.97
8.0.130.0000.00513.41
8.0.120.0030.00516.94
8.0.110.0000.00717.04
8.0.100.0000.00716.85
8.0.90.0000.00816.89
8.0.80.0090.00516.96
8.0.70.0040.00416.96
8.0.60.0000.00716.86
8.0.50.0040.00416.85
8.0.30.0100.00817.13
8.0.20.0080.01017.40
8.0.10.0020.00516.98
8.0.00.0090.01016.87
7.4.330.0050.00016.84
7.4.320.0000.00616.54
7.4.300.0050.00316.53
7.4.290.0000.00616.60
7.4.280.0030.00316.53
7.4.270.0000.00816.44
7.4.260.0070.00016.56
7.4.250.0040.00416.51
7.4.240.0030.00516.64
7.4.230.0000.00716.61
7.4.220.0070.01116.55
7.4.210.0100.00616.59
7.4.200.0030.00316.46
7.4.160.0080.00816.71
7.4.150.0090.00917.40
7.4.140.0050.01417.86
7.4.130.0100.00916.55
7.4.120.0110.00516.51
7.4.110.0140.00416.56
7.4.100.0130.01016.57
7.4.90.0130.00316.63
7.4.80.0090.00919.39
7.4.70.0100.00716.47
7.4.60.0030.01516.45
7.4.50.0070.00416.49
7.4.40.0110.00616.67
7.4.30.0070.01016.56
7.4.10.0080.01115.59
7.4.00.0050.01015.58
7.3.330.0000.00513.30
7.3.320.0030.00313.42
7.3.310.0030.00316.41
7.3.300.0000.00716.32
7.3.290.0000.00716.46
7.3.280.0060.01316.45
7.3.270.0070.01017.40
7.3.260.0140.00716.45
7.3.250.0080.01116.47
7.3.240.0110.01016.51
7.3.230.0060.01416.66
7.3.210.0100.01316.66
7.3.200.0100.00719.39
7.3.190.0030.01716.48
7.3.180.0070.01016.48
7.3.170.0040.01416.45
7.3.160.0070.01016.54
7.3.130.0100.00615.77
7.3.120.0050.01215.68
7.3.110.0060.01015.76
7.3.100.0060.00815.71
7.3.90.0030.00915.64
7.3.80.0040.00615.76
7.3.70.0040.00715.61
7.3.60.0030.01115.56
7.3.50.0010.01115.65
7.3.40.0060.00615.60
7.3.30.0060.00415.66
7.3.20.0070.00717.30
7.3.10.0040.00917.41
7.3.00.0070.00417.33
7.2.330.0090.01516.85
7.2.320.0130.00616.79
7.2.310.0030.01316.85
7.2.300.0070.01016.79
7.2.290.0130.00316.61
7.2.260.0090.01216.02
7.2.250.0090.00915.69
7.2.240.0080.00715.95
7.2.230.0090.00415.75
7.2.220.0050.00715.93
7.2.210.0090.00515.85
7.2.200.0080.00415.79
7.2.190.0090.00315.81
7.2.180.0090.00515.88
7.2.170.0040.00915.93
7.2.160.0020.00815.80
7.2.150.0020.00917.63
7.2.140.0050.00617.79
7.2.130.0050.00917.86
7.2.120.0080.00517.64
7.2.110.0070.00517.79
7.2.100.0000.01217.69
7.2.90.0100.00217.59
7.2.80.0090.00617.68
7.2.70.0050.00817.81
7.2.60.0010.01317.53
7.2.50.0050.01017.76
7.2.40.0070.00617.64
7.2.30.0040.00917.71
7.2.20.0060.00417.73
7.2.10.0050.00917.56
7.2.00.0050.01018.12
7.1.330.0070.00416.67
7.1.320.0080.00616.56
7.1.310.0040.00916.61
7.1.300.0030.01216.56
7.1.290.0070.00416.60
7.1.280.0040.00616.40
7.1.270.0050.00716.56
7.1.260.0020.00816.67
7.1.250.0050.00716.51
7.1.240.0080.00516.60
7.1.230.0030.00916.63
7.1.220.0010.01016.53
7.1.210.0050.00616.65
7.1.200.0040.00816.40
7.1.190.0050.00416.66
7.1.180.0050.00916.62
7.1.170.0040.00816.58
7.1.160.0060.00816.62
7.1.150.0090.00716.72
7.1.140.0070.00716.62
7.1.130.0050.00816.55
7.1.120.0090.00216.57
7.1.110.0080.00316.55
7.1.100.0070.00817.01
7.1.90.0060.00616.69
7.1.80.0050.00716.68
7.1.70.0040.00616.90
7.1.60.0070.01017.56
7.1.50.0050.01016.74
7.1.40.0060.00816.60
7.1.30.0060.00916.53
7.1.20.0050.01016.55
7.1.10.0060.00816.51
7.1.00.0040.02818.41
7.0.330.0050.00316.12
7.0.320.0020.01116.26
7.0.310.0070.00216.16
7.0.300.0030.00916.31
7.0.290.0010.00716.12
7.0.280.0020.01016.11
7.0.270.0060.00916.29
7.0.260.0040.01116.20
7.0.250.0020.01316.23
7.0.240.0050.00916.16
7.0.230.0100.00316.22
7.0.220.0070.00716.25
7.0.210.0040.01116.18
7.0.200.0180.00615.79
7.0.190.0080.00716.35
7.0.180.0060.00816.14
7.0.170.0020.01316.26
7.0.160.0050.00816.38
7.0.150.0030.00816.12
7.0.140.0060.00716.32
7.0.130.0030.01016.29
7.0.120.0070.00516.30
7.0.110.0040.00716.24
7.0.100.0000.01616.29
7.0.90.0070.00716.23
7.0.80.0080.00716.14
7.0.70.0070.00716.15
7.0.60.0080.03517.96
7.0.50.0040.02816.82
7.0.40.0060.02816.09
7.0.30.0110.02616.14
7.0.20.0130.02816.24
7.0.10.0020.02416.19
7.0.00.0070.03316.22
5.6.400.0030.00615.26
5.6.390.0070.00715.41
5.6.380.0030.00815.16
5.6.370.0030.00815.54
5.6.360.0070.00915.20
5.6.350.0050.00515.50
5.6.340.0060.00615.30
5.6.330.0090.00915.60
5.6.320.0030.00815.18
5.6.310.0050.00915.33
5.6.300.0040.00715.15
5.6.290.0080.00615.13
5.6.280.0040.02317.24
5.6.270.0040.01115.29
5.6.260.0030.00815.15
5.6.250.0070.00715.29
5.6.240.0080.00515.26
5.6.230.0030.00915.25
5.6.220.0070.00815.17
5.6.210.0050.02117.19
5.6.200.0000.02616.21
5.6.190.0090.03017.03
5.6.180.0130.03017.06
5.6.170.0140.02817.03
5.6.160.0060.02416.97
5.6.150.0060.03316.22
5.6.140.0090.03016.44
5.6.130.0070.03016.24
5.6.120.0100.03217.13
5.6.110.0090.01717.21
5.6.100.0060.01817.17
5.6.90.0080.01717.20
5.6.80.0030.02817.02
5.6.70.0070.00615.20
5.6.60.0030.01215.11
5.6.50.0060.00915.37
5.6.40.0050.00415.13
5.6.30.0050.01015.16
5.6.20.0060.00815.26
5.6.10.0060.00415.17
5.6.00.0080.00615.15
5.5.380.0080.00615.34
5.5.370.0050.00915.23
5.5.360.0040.01115.16
5.5.350.0060.03317.08
5.5.340.0070.02416.13
5.5.330.0020.03516.91
5.5.320.0190.01816.92
5.5.310.0140.02816.99
5.5.300.0050.03516.16
5.5.290.0050.03115.96
5.5.280.0100.02917.06
5.5.270.0040.02117.11
5.5.260.0080.01417.04
5.5.250.0040.01817.00
5.5.240.0080.03016.86
5.5.230.0060.00615.21
5.5.220.0040.00915.30
5.5.210.0060.00415.17
5.5.200.0020.01115.24
5.5.190.0060.00915.14
5.5.180.0040.00815.13
5.5.170.0070.00215.17
5.5.160.0050.00914.95
5.5.150.0090.00715.14
5.5.140.0060.00615.07
5.5.130.0030.00915.05
5.5.120.0060.00915.18
5.5.110.0070.00714.99
5.5.100.0070.00515.02
5.5.90.0060.00714.98
5.5.80.0050.01015.21
5.5.70.0090.00715.17
5.5.60.0060.00815.17
5.5.50.0050.00915.18
5.5.40.0080.00815.28
5.5.30.0040.00815.03
5.5.20.0110.00314.97
5.5.10.0050.00715.05
5.5.00.0020.01315.11

preferences:
38.35 ms | 400 KiB | 5 Q