3v4l.org

run code in 300+ 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.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.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.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:
29.61 ms | 403 KiB | 5 Q