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) { if (!in_array($property, $this->bookProperties)) { throw new \Exception('No such property: ' . $property); } else { $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.0180.00416.88
8.3.50.0130.00721.26
8.3.40.0150.00719.08
8.3.30.0150.00418.97
8.3.20.0040.00920.21
8.3.10.0030.00621.89
8.3.00.0080.00021.85
8.2.180.0040.01116.88
8.2.170.0090.00922.96
8.2.160.0130.00720.37
8.2.150.0080.00024.18
8.2.140.0070.00024.66
8.2.130.0040.00421.05
8.2.120.0070.00026.35
8.2.110.0000.01020.90
8.2.100.0040.00818.04
8.2.90.0040.00419.05
8.2.80.0060.00317.97
8.2.70.0040.00417.50
8.2.60.0060.00317.93
8.2.50.0040.00418.09
8.2.40.0000.01122.35
8.2.30.0040.00419.46
8.2.20.0030.00617.61
8.2.10.0000.00717.99
8.2.00.0040.00418.09
8.1.280.0040.01525.92
8.1.270.0080.00022.19
8.1.260.0080.00028.09
8.1.250.0080.00028.09
8.1.240.0000.00922.46
8.1.230.0070.00417.83
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0000.00917.13
8.1.190.0040.00417.22
8.1.180.0030.00618.10
8.1.170.0080.00018.51
8.1.160.0080.00020.70
8.1.150.0000.00718.96
8.1.140.0040.00419.66
8.1.130.0000.00717.72
8.1.120.0040.00417.39
8.1.110.0000.00817.39
8.1.100.0040.00417.54
8.1.90.0040.00417.40
8.1.80.0050.00317.51
8.1.70.0040.00417.57
8.1.60.0000.01017.52
8.1.50.0030.00617.48
8.1.40.0000.00717.52
8.1.30.0030.00617.53
8.1.20.0060.00317.64
8.1.10.0040.00417.52
8.1.00.0070.00017.56
8.0.300.0050.00218.77
8.0.290.0000.00716.63
8.0.280.0030.00318.36
8.0.270.0000.00717.20
8.0.260.0000.00717.28
8.0.250.0030.00317.05
8.0.240.0030.00317.04
8.0.230.0070.00017.00
8.0.220.0050.00316.85
8.0.210.0070.00016.93
8.0.200.0000.01017.04
8.0.190.0000.00816.94
8.0.180.0040.00416.91
8.0.170.0050.00516.90
8.0.160.0040.00417.02
8.0.150.0000.00716.98
8.0.140.0050.00316.96
8.0.130.0000.00713.41
8.0.120.0060.00316.99
8.0.110.0040.00416.89
8.0.100.0000.00816.96
8.0.90.0040.00416.89
8.0.80.0100.01116.99
8.0.70.0000.00817.01
8.0.60.0050.00316.88
8.0.50.0070.00017.01
8.0.30.0080.01117.07
8.0.20.0100.00917.40
8.0.10.0000.00717.12
8.0.00.0130.00716.90
7.4.330.0000.00516.73
7.4.320.0030.00316.55
7.4.300.0070.00016.55
7.4.290.0040.00416.64
7.4.280.0040.00416.64
7.4.270.0070.00016.47
7.4.260.0070.00016.48
7.4.250.0040.00416.64
7.4.240.0000.00716.62
7.4.230.0000.00716.45
7.4.220.0000.00716.52
7.4.210.0070.00816.63
7.4.200.0000.00716.72
7.4.160.0090.01116.58
7.4.150.0100.00717.40
7.4.140.0150.00517.86
7.4.130.0130.00916.55
7.4.120.0090.01116.57
7.4.110.0090.00916.41
7.4.100.0120.00916.64
7.4.90.0120.00616.64
7.4.80.0150.00919.39
7.4.70.0040.01216.54
7.4.60.0030.01416.55
7.4.50.0110.00416.68
7.4.40.0140.00416.59
7.4.30.0100.01016.66
7.4.10.0060.00914.80
7.4.00.0090.01015.06
7.3.330.0000.00513.46
7.3.320.0050.00013.41
7.3.310.0000.00716.43
7.3.300.0040.00416.22
7.3.290.0040.00416.40
7.3.280.0070.01216.39
7.3.270.0120.00617.40
7.3.260.0150.00616.49
7.3.250.0110.00816.48
7.3.240.0130.00516.52
7.3.230.0160.00616.58
7.3.210.0130.00916.59
7.3.200.0070.01019.39
7.3.190.0090.01516.52
7.3.180.0060.01016.52
7.3.170.0120.00916.40
7.3.160.0040.01716.54
7.3.130.0030.01614.90
7.3.120.0080.00915.08
7.3.110.0100.00614.89
7.3.100.0040.01115.14
7.3.90.0080.00815.08
7.3.80.0040.00915.11
7.3.70.0080.00714.96
7.3.60.0060.00615.01
7.3.50.0040.00615.09
7.3.40.0070.00715.13
7.3.30.0120.00315.08
7.3.20.0090.00616.73
7.3.10.0090.00516.58
7.3.00.0060.00816.82
7.2.330.0040.01616.77
7.2.320.0030.01316.72
7.2.310.0100.00716.54
7.2.300.0030.01716.87
7.2.290.0090.00916.56
7.2.260.0160.00415.09
7.2.250.0080.01015.21
7.2.240.0000.01715.16
7.2.230.0100.00515.27
7.2.220.0110.00315.25
7.2.210.0070.00815.18
7.2.200.0060.00915.05
7.2.190.0080.00615.27
7.2.180.0010.01115.19
7.2.170.0070.00915.18
7.2.160.0030.01015.04
7.2.150.0060.00616.85
7.2.140.0040.00816.79
7.2.130.0100.00616.99
7.2.120.0080.00816.96
7.2.110.0100.00617.05
7.2.100.0040.01216.98
7.2.90.0060.00616.88
7.2.80.0070.01016.95
7.2.70.0040.01516.80
7.2.60.0100.00516.98
7.2.50.0100.00717.09
7.2.40.0080.00817.11
7.2.30.0030.01016.78
7.2.20.0070.00716.71
7.2.10.0070.00716.63
7.2.00.0080.00617.96
7.1.330.0070.00815.81
7.1.320.0090.00315.61
7.1.310.0070.00815.79
7.1.300.0090.00315.78
7.1.290.0090.00515.49
7.1.280.0110.00615.68
7.1.270.0120.00315.52
7.1.260.0050.00915.68
7.1.250.0090.00915.86
7.1.240.0100.00615.82
7.1.230.0070.01015.66
7.1.220.0000.01815.63
7.1.210.0030.01015.70
7.1.200.0130.00215.82
7.1.190.0090.00315.76
7.1.180.0080.00415.73
7.1.170.0030.01016.02
7.1.160.0070.00715.98
7.1.150.0070.00415.56
7.1.140.0090.00615.58
7.1.130.0070.00415.75
7.1.120.0110.00415.72
7.1.110.0040.00415.97
7.1.100.0030.00917.02
7.1.90.0030.01015.84
7.1.80.0030.01015.86
7.1.70.0010.00816.47
7.1.60.0050.01217.72
7.1.50.0040.01316.33
7.1.40.0110.00415.56
7.1.30.0000.01015.73
7.1.20.0070.00715.67
7.1.10.0090.00615.68
7.1.00.0070.04019.07
7.0.330.0060.01215.36
7.0.320.0030.00615.36
7.0.310.0030.01415.59
7.0.300.0060.00315.39
7.0.290.0060.00615.36
7.0.280.0100.00315.54
7.0.270.0030.01315.63
7.0.260.0090.00015.46
7.0.250.0060.00615.52
7.0.240.0110.00315.29
7.0.230.0000.01415.48
7.0.220.0030.00915.09
7.0.210.0000.00815.51
7.0.200.0260.00914.95
7.0.190.0030.01015.51
7.0.180.0060.00715.53
7.0.170.0070.00715.23
7.0.160.0030.01015.61
7.0.150.0070.00715.52
7.0.140.0000.01615.35
7.0.130.0030.00615.29
7.0.120.0000.01415.47
7.0.110.0070.00715.57
7.0.100.0070.00715.20
7.0.90.0040.01215.57
7.0.80.0000.01015.40
7.0.70.0090.00615.62
7.0.60.0120.04318.47
7.0.50.0070.04516.58
7.0.40.0080.02716.85
7.0.30.0170.04216.87
7.0.20.0200.02316.80
7.0.10.0020.02616.81
7.0.00.0050.02716.90
5.6.400.0060.00914.77
5.6.390.0070.01114.70
5.6.380.0000.01414.69
5.6.370.0030.01014.66
5.6.360.0030.00914.43
5.6.350.0060.00614.45
5.6.340.0060.00614.62
5.6.330.0070.00714.64
5.6.320.0030.01114.21
5.6.310.0060.00314.65
5.6.300.0120.00014.81
5.6.290.0000.01014.44
5.6.280.0030.02517.56
5.6.270.0060.00314.39
5.6.260.0100.00314.57
5.6.250.0080.00814.54
5.6.240.0080.00814.44
5.6.230.0000.01614.62
5.6.220.0030.01214.19
5.6.210.0030.04817.63
5.6.200.0080.03916.28
5.6.190.0100.04417.59
5.6.180.0160.04517.60
5.6.170.0130.03017.58
5.6.160.0050.03917.45
5.6.150.0100.02816.33
5.6.140.0050.02516.29
5.6.130.0070.04516.51
5.6.120.0050.03317.79
5.6.110.0170.02917.64
5.6.100.0080.02517.71
5.6.90.0110.03817.55
5.6.80.0050.04717.33
5.6.70.0030.01014.55
5.6.60.0060.00314.14
5.6.50.0100.00014.16
5.6.40.0070.00714.42
5.6.30.0060.00614.29
5.6.20.0040.00414.52
5.6.10.0030.01014.53
5.6.00.0040.01414.20
5.5.380.0000.01514.48
5.5.370.0060.01014.26
5.5.360.0000.00914.14
5.5.350.0080.04317.36
5.5.340.0050.04816.22
5.5.330.0110.04017.45
5.5.320.0330.04017.51
5.5.310.0250.03717.35
5.5.300.0080.01816.35
5.5.290.0100.04316.01
5.5.280.0130.04017.84
5.5.270.0040.05417.58
5.5.260.0120.03317.58
5.5.250.0070.03717.54
5.5.240.0140.03317.34
5.5.230.0000.01514.25
5.5.220.0120.00314.33
5.5.210.0080.00414.30
5.5.200.0040.00714.34
5.5.190.0090.00014.19
5.5.180.0000.01514.24
5.5.170.0040.01114.35
5.5.160.0100.00714.41
5.5.150.0060.00313.92
5.5.140.0030.00514.44
5.5.130.0060.00314.56
5.5.120.0030.00913.96
5.5.110.0040.00714.17
5.5.100.0040.00414.59
5.5.90.0030.01214.14
5.5.80.0000.01114.38
5.5.70.0030.01214.38
5.5.60.0090.00914.41
5.5.50.0000.01314.21
5.5.40.0100.00314.44
5.5.30.0060.00914.28
5.5.20.0080.00613.90
5.5.10.0100.00714.32
5.5.00.0030.01014.39

preferences:
49.27 ms | 401 KiB | 5 Q