3v4l.org

run code in 300+ PHP versions simultaneously
<?php class StringCastable { private $data; public function __constructor($data) { $this->data = $data; } public function __toString(): string { return $this->toString(); } public function toString(): string { return $this->data; } } function testStringCast(string $data) { var_dump($data, get_class($data)); } testStringCast(new StringCastable("speculoos"));

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.0120.00316.88
8.3.50.0170.00521.10
8.3.40.0140.00318.88
8.3.30.0090.00618.75
8.3.20.0000.00820.34
8.3.10.0000.00823.48
8.3.00.0060.00319.68
8.2.180.0110.00416.75
8.2.170.0100.01322.96
8.2.160.0100.01020.40
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0070.00317.61
8.2.110.0030.00719.33
8.2.100.0110.00018.22
8.2.90.0000.00819.22
8.2.80.0060.00317.97
8.2.70.0070.00317.63
8.2.60.0080.00018.05
8.2.50.0040.00418.10
8.2.40.0030.00622.31
8.2.30.0000.00717.94
8.2.20.0000.00817.65
8.2.10.0000.00717.93
8.2.00.0030.00618.14
8.1.280.0070.00725.92
8.1.270.0030.00620.33
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0100.00723.97
8.1.230.0040.00717.70
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0030.00617.35
8.1.190.0040.00417.22
8.1.180.0030.00618.10
8.1.170.0110.00018.64
8.1.160.0000.00722.14
8.1.150.0070.00018.86
8.1.140.0000.00817.32
8.1.130.0030.00317.57
8.1.120.0000.00817.39
8.1.110.0000.00717.38
8.1.100.0040.00417.34
8.1.90.0000.00817.31
8.1.80.0000.00717.40
8.1.70.0030.00317.40
8.1.60.0000.00817.52
8.1.50.0000.00717.53
8.1.40.0040.00417.44
8.1.30.0040.00417.61
8.1.20.0000.00817.52
8.1.10.0000.00717.55
8.1.00.0040.00417.41
8.0.300.0000.00818.77
8.0.290.0000.00716.88
8.0.280.0030.00318.38
8.0.270.0040.00417.14
8.0.260.0030.00317.27
8.0.250.0000.00717.01
8.0.240.0030.00616.99
8.0.230.0030.00717.05
8.0.220.0020.00516.93
8.0.210.0070.00017.03
8.0.200.0070.00017.02
8.0.190.0080.00016.94
8.0.180.0040.00416.85
8.0.170.0040.00416.89
8.0.160.0000.00717.00
8.0.150.0000.00716.93
8.0.140.0030.00316.95
8.0.130.0000.00613.35
8.0.120.0040.00416.96
8.0.110.0000.00716.91
8.0.100.0030.00316.98
8.0.90.0040.00417.00
8.0.80.0090.00616.98
8.0.70.0000.00716.93
8.0.60.0000.00716.87
8.0.50.0040.00416.92
8.0.30.0080.00916.96
8.0.20.0090.01217.40
8.0.10.0050.00316.92
8.0.00.0110.00816.72
7.4.330.0040.00415.08
7.4.320.0030.00616.46
7.4.300.0030.00616.55
7.4.290.0030.00316.42
7.4.280.0060.00316.33
7.4.270.0030.00316.54
7.4.260.0070.00016.50
7.4.250.0000.00716.27
7.4.240.0050.00216.51
7.4.230.0030.00316.35
7.4.220.0130.00316.55
7.4.210.0070.01116.46
7.4.200.0030.00316.29
7.4.160.0080.01116.41
7.4.150.0030.01617.40
7.4.140.0170.00517.86
7.4.130.0100.01216.50
7.4.120.0090.01016.32
7.4.110.0030.01316.31
7.4.100.0180.00616.55
7.4.90.0100.00716.52
7.4.80.0100.00719.39
7.4.70.0090.01216.43
7.4.60.0030.01316.48
7.4.50.0000.00616.41
7.4.40.0120.00316.37
7.4.30.0070.01016.71
7.4.00.0120.00314.80
7.3.330.0050.00013.33
7.3.320.0050.00013.34
7.3.310.0000.00716.22
7.3.300.0030.00316.31
7.3.290.0030.00316.25
7.3.280.0090.00716.36
7.3.270.0080.01717.40
7.3.260.0110.00816.34
7.3.250.0110.00916.46
7.3.240.0060.01016.44
7.3.230.0060.01516.40
7.3.210.0080.00816.54
7.3.200.0070.01316.62
7.3.190.0110.00716.45
7.3.180.0060.00916.51
7.3.170.0090.00616.29
7.3.160.0120.00416.66
7.2.330.0060.01216.35
7.2.320.0160.00616.75
7.2.310.0100.01016.56
7.2.300.0090.00616.54
7.2.290.0110.00716.38
7.2.60.0080.00816.50
7.2.00.0090.00619.30
7.1.200.0050.00515.67
7.1.100.0120.00818.14
7.1.70.0050.00317.13
7.1.60.0100.01419.13
7.1.50.0130.01016.70
7.1.00.0070.07022.48
7.0.200.0200.00316.21
7.0.60.0030.08319.94
7.0.50.0070.04717.96
7.0.40.0100.04720.23
7.0.30.0430.05320.08
7.0.20.0300.05720.11
7.0.10.0100.08720.10
7.0.00.0000.09320.24
5.6.210.0100.08020.72
5.6.200.0130.08018.29
5.6.190.0170.07720.42
5.6.180.3100.04720.59
5.6.170.0230.07020.52
5.6.160.0070.05320.47
5.6.150.0070.08018.25
5.6.140.0170.07018.18
5.6.130.0070.07018.23
5.6.120.0070.04021.00
5.6.110.0100.08021.05
5.6.100.0030.04321.13
5.6.90.0070.08721.02
5.6.80.0030.04020.41
5.6.70.3400.01720.40
5.5.350.0170.03320.31
5.5.340.0130.07317.98
5.5.330.0170.07320.35
5.5.320.0330.04320.20
5.5.310.0270.05020.27
5.5.300.0100.03717.99
5.5.290.0070.08318.04
5.5.280.0030.04020.88
5.5.270.0100.06320.68
5.5.260.0170.08320.64
5.5.250.0070.05720.64
5.5.240.0200.06320.27
5.4.450.0000.04719.20
5.4.440.0030.04019.59
5.4.430.0000.03719.32
5.4.420.0030.03719.57
5.4.410.0030.04019.28
5.4.400.0030.05019.07
5.4.390.0070.05319.13
5.4.380.0030.04319.24
5.4.370.0100.04019.20
5.4.360.0030.06319.07
5.4.350.0030.05019.24
5.4.340.0030.07719.31
5.4.320.0030.05719.06
5.4.310.0030.09018.99
5.4.300.0030.07719.31
5.4.290.0070.06718.95
5.4.280.0030.08019.24
5.4.270.0000.06318.87
5.4.260.0070.07318.87
5.4.250.0070.06318.86
5.4.240.0070.04019.15
5.4.230.0030.08319.00
5.4.220.0030.05319.07
5.4.210.0000.07719.32
5.4.200.0170.07019.21
5.4.190.0030.07019.21
5.4.180.0030.07718.98
5.4.170.0070.05019.30
5.4.160.0000.04019.22
5.4.150.0000.04019.13
5.4.140.0000.06316.29
5.4.130.0070.03716.51
5.4.120.0170.04016.34
5.4.110.0070.07016.58
5.4.100.0030.08016.55
5.4.90.0000.07716.56
5.4.80.0030.04016.39

preferences:
34.95 ms | 401 KiB | 5 Q