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)) { $f = function($method) use ($this) { return $this->package->$method; }; // Closure::bind($f, $this); return $f; } } } $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.0100.04718.15
5.6.130.0070.08718.14
5.6.120.0030.08021.13
5.6.110.0070.07721.02
5.6.100.0030.08321.10
5.6.90.0100.08020.96
5.6.80.0070.08020.55
5.5.300.0030.08317.98
5.5.290.0030.08317.95
5.5.280.0030.05020.64
5.5.270.0000.07720.76
5.5.260.0130.07720.81
5.5.250.0100.04020.63
5.5.240.0030.07320.25
5.4.450.0570.06319.63
5.4.440.0730.04719.57
5.4.430.0570.06019.35
5.4.420.0600.05319.45
5.4.410.0670.05019.30
5.4.400.0570.06319.30
5.4.390.0670.05019.14
5.4.380.0730.04319.11
5.4.370.0670.05319.25
5.4.360.0670.05719.25
5.4.350.0670.05319.03
5.4.340.0700.05019.11
5.4.320.0700.05018.96
5.4.310.0700.05019.14
5.4.300.0670.05319.13
5.4.290.0730.06719.37
5.4.280.0670.05719.22
5.4.270.0670.05019.17
5.4.260.0730.04719.14
5.4.250.0670.05319.34
5.4.240.0670.06719.24
5.4.230.0770.05018.95
5.4.220.0530.05319.22
5.4.210.0070.05319.02
5.4.200.0130.04719.24
5.4.190.0170.04319.13
5.4.180.0530.05319.10
5.4.170.0600.05318.80
5.4.160.0630.05319.24
5.4.150.0630.05319.09
5.4.140.0600.05316.60
5.4.130.0630.04716.75
5.4.120.0630.04716.33
5.4.110.0630.05016.63
5.4.100.0600.05016.29
5.4.90.0600.05016.44
5.4.80.0770.04016.46
5.4.70.0800.04016.55
5.4.60.0670.04316.42
5.4.50.0700.04016.52
5.4.40.0630.04716.23
5.4.30.0600.05016.15
5.4.20.0770.04016.25
5.4.10.0530.06016.38
5.4.00.0630.04715.98

preferences:
144.24 ms | 1394 KiB | 7 Q