3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); interface ValidatorInterface { public function validate($number); } interface LegacyValidatorInterface { public function validate($number, $deprecated = false); } class Validator implements LegacyValidatorInterface, ValidatorInterface { public function validate($number, $deprecated = false) { echo func_num_args(); echo "\n"; } } class Decorator implements ValidatorInterface { /** * @var ValidatorInterface */ private $core; /** * @param ValidatorInterface $core */ public function __construct(ValidatorInterface $core) { $this->core = $core; } public function validate($number) { $this->core->validate($number); } } declare(strict_types=1); $v = new Decorator(new Validator()); $v->validate("1", false); $v->validate("1");

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)
7.1.60.0170.01033.08
7.1.50.0730.00732.91
7.1.40.0830.00332.51
7.1.30.0700.01732.59
7.1.20.0730.01332.56
7.1.10.1000.00314.61
7.1.00.0700.01314.70
7.0.200.0600.01014.79
7.0.190.0700.00314.89
7.0.180.0670.00314.19
7.0.170.0730.00714.41
7.0.160.0530.01314.04
7.0.150.0630.01014.32
7.0.140.0770.01014.34
7.0.130.0670.01014.70
7.0.120.0670.00314.54
7.0.110.0600.01014.35
7.0.100.0570.01014.14
7.0.90.0600.01014.28
7.0.80.0600.01314.47
7.0.70.0630.00714.38
7.0.60.0630.01314.24
7.0.50.0800.00714.22
7.0.40.1470.00714.75
7.0.30.0630.01014.48
7.0.20.0730.01014.28
7.0.10.0600.01014.41
7.0.00.0630.00714.53

preferences:
138.38 ms | 1394 KiB | 7 Q