3v4l.org

run code in 200+ PHP versions simultaneously
<?php interface Employee {} class SteelFactoryEmployee implements Employee {} class CarsFactoryEmployee implements Employee {} interface Factory { public function hire(Employee $employee): bool; } class SteelFactory implements Factory { public function hire(Employee $employee): bool { if (! $employee instanceof SteelFactoryEmployee) { throw new InvalidArgumentException('Employee should be ' . SteelFactoryEmployee::class); } return true; } } class CarsFactory implements Factory { public function hire(Employee $employee): bool { if (! $employee instanceof CarsFactoryEmployee) { throw new InvalidArgumentException('Employee should be ' . CarsFactoryEmployee::class); } return true; } } class EmploymentDepartment { public function hireNewEmployee(Factory $factory, Employee $employee): void { $factory->hire($employee); } } $someNewEmployee = new SteelFactoryEmployee(); $someFactory = new SteelFactory(); $employmentDepartment = new EmploymentDepartment(); $employmentDepartment->hireNewEmployee($someFactory, $someNewEmployee);
based on ajgqR

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.4.10.0140.00614.82
7.4.00.0080.00914.85
7.3.130.0070.01114.88
7.3.120.0080.00914.88
7.3.110.0090.00814.80
7.3.100.0050.01014.85
7.3.90.0070.01014.78
7.3.80.0090.00514.67
7.3.70.0060.00614.73
7.3.60.0080.00514.73
7.3.50.0040.00914.69
7.3.40.0050.01114.76
7.3.30.0050.00914.70
7.3.20.0070.00916.15
7.3.10.0070.00716.09
7.3.00.0080.00616.13
7.2.260.0090.00914.94
7.2.250.0020.01414.96
7.2.240.0090.00815.04
7.2.230.0040.01214.79
7.2.220.0080.00714.94
7.2.210.0070.00714.93
7.2.200.0050.00714.96
7.2.190.0080.00614.86
7.2.180.0060.00614.99
7.2.170.0060.01014.98
7.2.160.0040.01214.99
7.2.150.0090.00016.79
7.2.140.0040.01116.87
7.2.130.0060.01316.77
7.2.120.0060.00917.05
7.2.110.0100.01016.94
7.2.100.0040.00717.05
7.2.90.0070.00316.79
7.2.80.0030.00917.04
7.2.70.0030.01016.73
7.2.60.0030.01016.86
7.2.50.0080.00416.63
7.2.40.0090.00316.98
7.2.30.0000.01016.69
7.2.20.0060.00616.84
7.2.10.0100.00716.65
7.2.00.0030.01216.95
7.1.330.0050.00915.02
7.1.320.0090.00615.09
7.1.310.0040.01015.12
7.1.300.0030.00914.93
7.1.290.0090.00615.02
7.1.280.0060.01115.09
7.1.270.0090.00415.13
7.1.260.0070.00715.17