3v4l.org

run code in 300+ PHP versions simultaneously
<?php class integer { private $value; public function __construct(int ...$value) { switch (count($value)) { case 0: break; case 1: $this->value = $value[0]; break; default: throw new Exception('Multiple values given.'); } } public function __invoke(int ...$value) : int { switch (count($value)) { case 0: break; case 1: $this->value = $value[0]; break; default: throw new Exception('Multiple values given.'); } return $this->value; } public function __toString() : int { return $this->value; } } $testi = new integer(); $testi(2); $copy = $testi; var_dump($copy); echo $testi;

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.70.0110.01116.63
8.3.60.0110.00416.63
8.3.50.0110.01022.04
8.3.40.0110.00318.74
8.3.30.0070.01418.38
8.3.20.0070.00020.39
8.3.10.0040.00421.92
8.3.00.0000.00919.38
8.2.180.0090.00616.37
8.2.170.0060.00922.96
8.2.160.0110.00420.39
8.2.150.0080.00024.18
8.2.140.0070.00024.66
8.2.130.0030.00617.25
8.2.120.0070.00026.35
8.2.110.0070.00320.34
8.2.100.0120.00017.68
8.2.90.0000.00819.05
8.2.80.0060.00317.97
8.2.70.0080.00017.38
8.2.60.0080.00017.91
8.2.50.0000.00818.07
8.2.40.0060.00319.23
8.2.30.0040.00420.65
8.2.20.0040.00417.63
8.2.10.0040.00417.88
8.2.00.0040.00417.90
8.1.280.0110.00725.92
8.1.270.0040.00423.79
8.1.260.0040.00428.09
8.1.250.0070.00028.09
8.1.240.0050.00523.88
8.1.230.0060.00617.54
8.1.220.0000.00717.74
8.1.210.0050.00318.77
8.1.200.0060.00317.00
8.1.190.0000.00816.98
8.1.180.0040.00418.10
8.1.170.0060.00318.63
8.1.160.0000.00822.01
8.1.150.0000.00818.84
8.1.140.0050.00319.47
8.1.130.0030.00317.59
8.1.120.0000.00817.36
8.1.110.0040.00417.41
8.1.100.0040.00417.35
8.1.90.0040.00417.36
8.1.80.0080.00017.33
8.1.70.0000.00717.30
8.1.60.0080.00317.52
8.1.50.0060.00317.36
8.1.40.0040.00417.44
8.1.30.0030.00717.46
8.1.20.0030.00617.40
8.1.10.0000.00817.31
8.1.00.0080.00017.39
8.0.300.0070.00018.77
8.0.290.0030.00316.63
8.0.280.0030.00518.41
8.0.270.0030.00317.20
8.0.260.0060.00317.20
8.0.250.0070.00017.01
8.0.240.0050.00316.84
8.0.230.0030.00316.84
8.0.220.0020.00516.86
8.0.210.0040.00416.71
8.0.200.0000.00716.87
8.0.190.0040.00416.85
8.0.180.0040.00416.76
8.0.170.0000.00716.91
8.0.160.0070.00416.84
8.0.150.0000.00716.80
8.0.140.0030.00416.74
8.0.130.0030.00313.35
8.0.120.0030.00616.80
8.0.110.0080.00016.88
8.0.100.0040.00416.77
8.0.90.0040.00416.86
8.0.80.0090.00916.88
8.0.70.0000.00816.95
8.0.60.0080.00016.81
8.0.50.0050.00316.73
8.0.30.0090.00917.01
8.0.20.0140.00917.40
8.0.10.0000.00917.15
8.0.00.0070.01116.77
7.4.330.0000.00516.83
7.4.320.0000.00616.50
7.4.300.0000.00716.53
7.4.290.0030.00316.59
7.4.280.0070.00016.41
7.4.270.0070.00016.54
7.4.260.0000.00716.61
7.4.250.0000.00716.48
7.4.240.0040.00416.64
7.4.230.0000.00716.61
7.4.220.0090.00916.53
7.4.210.0000.01516.71
7.4.200.0030.00316.36
7.4.160.0090.00616.34
7.4.150.0130.00617.40
7.4.140.0080.01017.86
7.4.130.0090.00816.54
7.4.120.0040.01516.45
7.4.110.0100.01316.55
7.4.100.0150.00616.80
7.4.90.0000.01816.54
7.4.80.0130.00319.39
7.4.70.0060.01016.46
7.4.60.0110.00516.61
7.4.50.0070.00716.22
7.4.40.0080.00816.61
7.4.30.0060.01216.43
7.4.00.0080.00814.72
7.3.330.0030.00313.44
7.3.320.0000.00613.40
7.3.310.0030.00416.53
7.3.300.0030.00316.44
7.3.290.0090.00616.46
7.3.280.0110.00716.42
7.3.270.0140.00317.40
7.3.260.0090.00916.44
7.3.250.0090.01216.49
7.3.240.0090.01016.53
7.3.230.0070.01016.39
7.3.210.0150.00316.56
7.3.200.0080.00816.41
7.3.190.0030.01416.38
7.3.180.0090.00616.50
7.3.170.0080.00916.42
7.3.160.0060.01016.44
7.3.120.0060.01014.78
7.3.110.0050.01214.88
7.3.100.0100.00214.93
7.3.90.0110.00514.79
7.3.80.0050.01014.98
7.3.70.0050.00814.91
7.3.60.0090.00514.85
7.3.50.0090.00514.91
7.3.40.0080.00514.73
7.3.30.0070.00914.89
7.3.20.0010.01416.69
7.3.10.0040.01116.71
7.3.00.0070.00816.58
7.2.330.0030.01916.63
7.2.320.0110.00616.65
7.2.310.0080.01416.51
7.2.300.0100.00716.71
7.2.290.0170.00016.63
7.2.250.0090.00715.22
7.2.240.0060.01014.99
7.2.230.0090.00714.99
7.2.220.0050.00815.27
7.2.210.0080.00814.94
7.2.200.0050.00915.15
7.2.190.0030.01115.13
7.2.180.0070.00515.05
7.2.170.0050.01014.96
7.2.160.0060.00915.24
7.2.150.0050.00916.97
7.2.140.0070.00916.98
7.2.130.0020.01416.83
7.2.120.0100.00716.80
7.2.110.0060.01017.03
7.2.100.0030.01117.05
7.2.90.0050.00917.07
7.2.80.0080.00517.09
7.2.70.0070.01016.97
7.2.60.0030.01116.77
7.2.50.0060.01017.04
7.2.40.0090.00617.03
7.2.30.0040.00816.95
7.2.20.0090.00317.08
7.2.10.0080.00917.02
7.2.00.0070.00817.77
7.1.330.0030.01415.82
7.1.320.0080.00815.72
7.1.310.0060.00815.74
7.1.300.0050.00815.94
7.1.290.0060.00715.74
7.1.280.0030.01115.72
7.1.270.0030.00915.76
7.1.260.0020.01015.73
7.1.250.0070.01015.99
7.1.240.0040.01115.57
7.1.230.0100.00615.88
7.1.220.0000.00915.66
7.1.210.0100.00715.89
7.1.200.0060.01115.85
7.1.190.0040.00815.98
7.1.180.0000.01315.68
7.1.170.0000.00915.78
7.1.160.0000.01115.81
7.1.150.0030.01015.78
7.1.140.0000.00915.91
7.1.130.0060.00915.76
7.1.120.0000.00815.84
7.1.110.0060.00315.87
7.1.100.0060.00817.07
7.1.90.0030.01315.75
7.1.80.0060.00615.90
7.1.70.0040.00616.41
7.1.60.0110.00817.63
7.1.50.0070.00416.27
7.1.40.0100.00315.84
7.1.30.0060.00615.81
7.1.20.0090.00015.72
7.1.10.0030.00615.68
7.1.00.0020.04619.03
7.0.330.0100.00715.42
7.0.320.0030.00915.48
7.0.310.0080.00815.43
7.0.300.0060.00315.14
7.0.290.0000.00815.38
7.0.280.0100.00015.34
7.0.270.0040.00715.37
7.0.260.0000.01215.41
7.0.250.0030.01315.50
7.0.240.0000.00915.57
7.0.230.0110.00015.09
7.0.220.0030.00715.64
7.0.210.0040.01115.48
7.0.200.0070.00316.05
7.0.190.0070.00715.54
7.0.180.0070.00715.24
7.0.170.0030.00915.36
7.0.160.0120.00015.48
7.0.150.0040.01115.11
7.0.140.0030.00615.57
7.0.130.0090.00315.39
7.0.120.0000.00815.55
7.0.110.0040.01115.52
7.0.100.0030.01015.35
7.0.90.0070.00715.53
7.0.80.0060.00615.46
7.0.70.0070.00615.40
7.0.60.0080.04417.71
7.0.50.0050.04216.65
7.0.40.0080.04816.79
7.0.30.0100.02616.87
7.0.20.0090.02716.97
7.0.10.0070.02916.85
7.0.00.0050.04916.68
5.6.400.0080.00414.35
5.6.390.0080.00514.00
5.6.380.0100.00714.13
5.6.370.0110.00713.96
5.6.360.0090.00014.07
5.6.350.0000.00914.12
5.6.340.0100.00314.11
5.6.330.0070.00714.36
5.6.320.0080.00414.36
5.6.310.0070.01114.04
5.6.300.0080.00414.10
5.6.290.0060.00614.37
5.6.280.0050.04017.60
5.6.270.0080.00414.01
5.6.260.0030.00914.30
5.6.250.0040.00814.36
5.6.240.0090.00314.10
5.6.230.0090.00313.98
5.6.220.0000.01114.34
5.6.210.0050.04917.29
5.6.200.0060.04716.03
5.6.190.0080.02217.21
5.6.180.0130.04417.48
5.6.170.0150.04217.27
5.6.160.0080.03017.38
5.6.150.0100.04016.28
5.6.140.0130.03316.26
5.6.130.0030.04316.13
5.6.120.0060.04617.50
5.6.110.0070.04017.42
5.6.100.0050.04717.53
5.6.90.0080.03817.43
5.6.80.0020.04517.27
5.6.70.0040.01113.95
5.6.60.0080.00314.13
5.6.50.0040.01414.04
5.6.40.0040.00714.13
5.6.30.0090.00613.97
5.6.20.0120.00313.83
5.6.10.0110.00314.00
5.6.00.0030.00913.96
5.5.380.0070.00714.02
5.5.370.0030.00614.10
5.5.360.0000.00913.94
5.5.350.2000.02317.20
5.5.340.0070.02216.10
5.5.330.0080.04217.19
5.5.320.0000.04917.17
5.5.310.0130.04517.31
5.5.300.0080.04215.89
5.5.290.0090.04215.98
5.5.280.0120.02617.45
5.5.270.0050.03217.48
5.5.260.0050.03717.14
5.5.250.0100.02717.33
5.5.240.0180.03417.08
5.5.230.0000.00914.27
5.5.220.0030.01014.35
5.5.210.0060.00913.91
5.5.200.0090.00014.06
5.5.190.0040.00413.66
5.5.180.0080.00313.97
5.5.170.0070.00714.22
5.5.160.0000.01314.00
5.5.150.0070.00413.85
5.5.140.0110.00413.87
5.5.130.0070.00313.57
5.5.120.0070.00313.85
5.5.110.0070.00714.01
5.5.100.0030.01013.84
5.5.90.0100.00314.18
5.5.80.0040.01113.93
5.5.70.0060.00313.91
5.5.60.0040.00714.04
5.5.50.0080.00314.16
5.5.40.0080.00314.11
5.5.30.0090.00313.79
5.5.20.0140.00013.84
5.5.10.0090.00913.95
5.5.00.0040.01113.96

preferences:
70.37 ms | 401 KiB | 5 Q