3v4l.org

run code in 300+ PHP versions simultaneously
<?php class salutations { public function hello() { return "Hello World!"; } } class methodFactory { public function __construct($instance) { $this->package = $instance; } public function getPackageMethod($method) { if (method_exists($this->package, $method)) { return function() use($this) { return $this->package->$method; }; } } } $salutationsInstance = new salutations(); $obj = new methodFactory($salutationsInstance); $hello = $obj->getPackageMethod('hello'); $hello();

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.140.0030.07318.28
5.6.130.0100.07718.21
5.6.120.0000.04720.92
5.6.110.0070.03721.13
5.6.100.0170.06021.12
5.6.90.0100.07021.11
5.6.80.0170.07020.40
5.5.300.0130.04017.93
5.5.290.0030.04318.08
5.5.280.0030.04320.98
5.5.270.0030.04720.87
5.5.260.0100.07320.80
5.5.250.0100.05020.70
5.5.240.0000.04320.20
5.4.450.0730.07319.18
5.4.440.0870.06319.55
5.4.430.1070.05719.46
5.4.420.0770.05719.55
5.4.410.0830.05319.33
5.4.400.0770.06019.23
5.4.390.0730.06319.30
5.4.380.0700.06018.80
5.4.370.0900.04019.25
5.4.360.0930.06019.20
5.4.350.0900.05319.23
5.4.340.0700.06019.26
5.4.320.0700.05319.05
5.4.310.0800.05318.85
5.4.300.0800.05019.11
5.4.290.0870.04319.34
5.4.280.0730.05018.81
5.4.270.0700.05319.13
5.4.260.0800.07718.95
5.4.250.0730.07319.13
5.4.240.0800.07318.80
5.4.230.0970.06018.86
5.4.220.0730.05319.12
5.4.210.0700.05319.33
5.4.200.0700.05718.84
5.4.190.0630.05719.24
5.4.180.0570.06019.33
5.4.170.0800.05019.22
5.4.160.0730.06318.98
5.4.150.0800.05319.09
5.4.140.0800.08016.50
5.4.130.0870.06316.47
5.4.120.0870.07716.59
5.4.110.0970.07016.57
5.4.100.0800.05316.44
5.4.90.0600.06316.64
5.4.80.0800.05316.55
5.4.70.0830.05716.26
5.4.60.0870.05716.25
5.4.50.0830.05316.59
5.4.40.0830.06716.36
5.4.30.0930.04316.42
5.4.20.0630.05716.22
5.4.10.0600.06716.16
5.4.00.0530.07715.76

preferences:
145.14 ms | 1398 KiB | 7 Q