3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (version_compare(phpversion(), '8.2.0', '<')) { interface Greet { function speak(); } class Hello implements Greet { function speak() { return 'world'; } } } else { interface Greet { function speak(): string; } class Hello implements Greet { function speak(): string { return 'world'; } } } echo (new Hello())->speak();

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)
5.6.50.0120.00517.23

preferences:
37.14 ms | 403 KiB | 5 Q