3v4l.org

run code in 500+ PHP versions simultaneously
<?php class B { public function __toString() { return 'b'; } } class A { function getFoo(): ?string { return new B(); } } $a = new A(); var_dump($a->getFoo());

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.5.30.0090.01119.43
8.5.20.0120.00617.87
8.5.10.0100.01016.69
8.5.00.0120.00919.84
8.4.180.0150.00725.76
8.4.170.0100.01221.95
8.4.160.0120.00923.99
8.4.150.0080.00416.85
8.4.140.0140.01017.58
8.4.130.0070.00418.94
8.4.120.0160.00617.60
8.4.110.0110.00817.89
8.4.100.0160.00417.75
8.4.90.0160.00420.38
8.4.80.0140.00618.99
8.4.70.0130.00618.84
8.4.60.0050.01418.83
8.4.50.0120.00719.70
8.4.40.0070.01017.60
8.4.30.0130.00718.57
8.4.20.0180.00719.87
8.4.10.0170.00319.57
8.3.300.0160.00420.41
8.3.290.0130.00820.71
8.3.280.0120.00918.36
8.3.270.0150.00716.57
8.3.260.0110.00916.39
8.3.250.0120.00716.51
8.3.240.0050.00416.42
8.3.230.0100.00916.47
8.3.220.0020.00519.03
8.3.210.0060.00816.52
8.3.200.0130.00516.50
8.3.190.0090.01018.04
8.3.180.0080.01116.66
8.3.170.0030.00519.05
8.3.160.0110.00720.27
8.3.150.0150.00616.68
8.3.140.0120.00319.11
8.3.130.0090.00018.29
8.3.120.0030.00619.06
8.3.110.0000.00820.94
8.3.100.0000.00818.30
8.3.90.0070.01126.77
8.3.80.0080.00018.43
8.3.70.0120.01216.38
8.3.60.0180.00018.43
8.3.50.0120.00916.59
8.3.40.0070.00720.09
8.3.30.0140.00021.80
8.3.20.0000.00824.18
8.3.10.0040.00424.66
8.3.00.0090.00028.09
8.2.300.0090.01018.73
8.2.290.0090.00916.48
8.2.280.0140.00619.96
8.2.270.0120.00617.01
8.2.260.0030.00718.13
8.2.250.0170.00316.76
8.2.240.0130.00618.88
8.2.230.0000.00822.58
8.2.220.0030.00624.06
8.2.210.0130.00326.77
8.2.200.0110.00018.43
8.2.190.0120.00316.61
8.2.180.0110.00416.63
8.2.170.0110.00718.95
8.2.160.0090.00922.96
8.2.150.0040.00425.66
8.2.140.0090.00024.66
8.2.130.0070.00028.09
8.2.120.0030.00628.09
8.1.340.0100.01119.92
8.1.330.0100.00916.30
8.1.320.0120.00718.00
8.1.310.0040.00416.62
8.1.300.0060.01019.71
8.1.290.0000.00930.84
8.1.280.0040.01125.92
8.1.270.0090.00621.85
8.1.260.0040.00528.09
8.1.250.0050.00328.09
8.1.160.0050.00428.09

preferences:
47.96 ms | 828 KiB | 5 Q