3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class StringableClass { public function __toString() { return 'helloWorld'; } } class StringEater { public function eat(string $string) { echo $string; } } $string = new StringableClass(); (new StringEater())->eat((string)$string); echo "\n\n"; printf($string); echo "\n\n"; (new StringEater())->eat($string);

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.4.120.0140.00624.14
8.4.110.0130.00722.68
8.4.100.0080.01118.83
8.4.90.0070.01318.86
8.4.80.0050.00320.68
8.4.70.0060.00217.91
8.4.60.0060.00618.95
8.4.50.0090.01118.62
8.4.40.0000.00919.45
8.4.30.0060.00320.33
8.4.20.0130.00917.94
8.4.10.0100.01019.48
8.3.250.0060.00319.04
8.3.240.0040.00417.22
8.3.230.0120.00816.63
8.3.220.0030.00418.95
8.3.210.0100.00716.78
8.3.200.0080.00116.65
8.3.190.0110.00717.28
8.3.180.0120.00717.22
8.3.170.0110.00720.65
8.3.160.0070.01117.01
8.3.150.0150.00417.19
8.3.140.0060.00316.91
8.3.130.0090.00016.77
8.3.120.0060.00318.95
8.3.110.0050.00520.94
8.3.100.0080.00318.30
8.3.90.0040.00416.82
8.3.80.0040.00416.88
8.3.70.0070.01118.43
8.3.60.0140.00718.43
8.3.50.0110.00424.55
8.3.40.0130.00418.75
8.3.30.0150.00018.67
8.3.20.0000.00820.95
8.3.10.0070.00423.67
8.3.00.0040.00417.80
8.2.290.0120.00720.56
8.2.280.0040.00618.36
8.2.270.0090.00917.13
8.2.260.0140.00016.61
8.2.250.0040.00416.82
8.2.240.0040.01117.44
8.2.230.0090.00022.58
8.2.220.0050.00524.06
8.2.210.0100.00326.77
8.2.200.0060.00316.75
8.2.190.0120.00316.63
8.2.180.0070.00718.38
8.2.170.0130.01022.96
8.2.160.0150.00022.20
8.2.150.0080.00324.18
8.2.140.0000.00724.66
8.2.130.0030.00526.16
8.2.120.0030.00521.04
8.2.110.0030.00621.03
8.2.100.0080.00317.84
8.2.90.0040.00417.97
8.2.80.0000.00817.97
8.2.70.0080.00017.75
8.2.60.0000.00817.63
8.2.50.0060.00318.05
8.2.40.0030.00618.22
8.2.30.0040.00419.54
8.2.20.0000.00818.13
8.2.10.0040.00419.13
8.2.00.0040.00419.12
8.1.330.0120.00822.10
8.1.320.0160.00716.14
8.1.310.0070.01120.34
8.1.300.0070.01118.38
8.1.290.0060.00330.84
8.1.280.0090.00625.92
8.1.270.0000.00820.66
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0070.00422.06
8.1.230.0110.00020.85
8.1.220.0030.00617.79
8.1.210.0050.00518.78
8.1.200.0060.00317.48
8.1.190.0070.00417.13
8.1.180.0040.00418.10
8.1.170.0000.00817.62
8.1.160.0000.00819.00
8.1.150.0040.00418.86
8.1.140.0030.00618.89
8.1.130.0000.00720.27
8.1.120.0000.00717.36
8.1.110.0030.00717.41
8.1.100.0040.00417.36
8.1.90.0000.00717.45
8.1.80.0020.00517.43
8.1.70.0030.00317.33
8.1.60.0030.00517.52
8.1.50.0040.00417.54
8.1.40.0040.00417.54
8.1.30.0000.00817.52
8.1.20.0000.00817.66
8.1.10.0040.00417.59
8.1.00.0000.00717.54
8.0.300.0000.00719.98
8.0.290.0050.00216.63
8.0.280.0070.00018.36
8.0.270.0030.00318.06
8.0.260.0000.00820.18
8.0.250.0000.00817.03
8.0.240.0030.00317.04
8.0.230.0070.00016.91
8.0.220.0000.00816.93
8.0.210.0000.00716.92
8.0.200.0060.00016.93
8.0.190.0030.00616.89
8.0.180.0050.00317.01
8.0.170.0000.00816.86
8.0.160.0050.00316.95
8.0.150.0040.00416.88
8.0.140.0030.00316.84
8.0.130.0000.00613.35
8.0.120.0040.00416.89
8.0.110.0040.00416.97
8.0.100.0000.00817.01
8.0.90.0090.00017.04
8.0.80.0080.00816.85
8.0.70.0040.00417.00
8.0.60.0040.00417.07
8.0.50.0000.00816.77
8.0.30.0070.01017.16
8.0.20.0080.01017.41
8.0.10.0000.00717.02
8.0.00.0120.00816.77
7.4.330.0030.00315.55
7.4.320.0030.00316.64
7.4.300.0060.00016.62
7.4.290.0030.00316.51
7.4.280.0050.00216.63
7.4.270.0030.00316.61
7.4.260.0050.00013.21
7.4.250.0030.00316.57
7.4.240.0060.00216.52
7.4.230.0000.00716.41
7.4.220.0020.00516.44
7.4.210.0120.00616.54
7.4.200.0030.00316.45
7.4.130.0100.01216.56
7.4.120.0130.02016.56
7.4.110.0170.00716.46
7.4.100.0100.00716.54
7.4.90.0160.00616.42
7.4.80.0130.01319.39
7.4.70.0110.00816.68
7.4.60.0100.00716.50
7.4.50.0000.01416.73
7.4.40.0100.01016.44
7.4.20.0110.01116.30
7.4.10.0110.00616.34
7.4.00.0100.01016.67
7.3.330.0030.00316.40
7.3.320.0000.00513.34
7.3.310.0070.00016.38
7.3.300.0070.00016.24
7.3.290.0090.00716.37
7.3.280.0070.01016.41
7.3.260.0100.01416.30
7.3.240.0080.00916.52
7.3.230.0090.00916.42
7.3.210.0120.00616.63
7.3.200.0070.01016.42
7.3.190.0090.00616.63
7.3.180.0100.01316.28
7.3.170.0100.01316.38
7.3.160.0090.00916.31
7.3.140.0100.00916.29
7.3.130.0040.01116.52
7.3.120.0060.01116.33
7.3.110.0150.00616.31
7.3.100.0060.01016.55
7.3.90.0120.00916.59
7.3.80.0030.01916.41
7.3.70.0130.00716.48
7.3.60.0100.01016.38
7.3.50.0060.01516.42
7.3.40.0120.00916.46
7.3.30.0090.00916.43
7.3.20.0130.01016.39
7.3.10.0080.01116.45
7.3.00.0090.01416.49
7.2.330.0070.01116.53
7.2.320.0100.00716.71
7.2.310.0040.01216.56
7.2.300.0190.00016.80
7.2.290.0060.01216.46
7.2.270.0110.00816.59
7.2.260.0070.01016.67
7.2.250.0100.01016.38
7.2.240.0070.01116.82
7.2.230.0150.00316.36
7.2.220.0160.00316.66
7.2.210.0150.00716.69
7.2.200.0100.01016.64
7.2.190.0070.01116.37
7.2.180.0130.01016.49
7.2.170.0070.01616.60
7.2.160.0090.00916.47
7.2.150.0200.00616.52
7.2.140.0130.00616.64
7.2.130.0110.01116.57
7.2.120.0060.01416.75
7.2.110.0140.00516.59
7.2.100.0220.00416.64
7.2.90.0100.01316.59
7.2.80.0130.01016.54
7.2.70.0130.01016.42
7.2.60.0090.00916.55
7.2.50.0120.00816.48
7.2.40.0120.00916.73
7.2.30.0120.01216.78
7.2.20.0170.00516.57
7.2.10.0090.01216.42
7.2.00.0060.01316.71

preferences:
30.13 ms | 403 KiB | 5 Q