3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Thing { public function method() { $args = func_get_args(); if (count($args) === 2) { if ($args[0] instanceof OtherThing && is_int($args[1])) { $this->methodImplOtherThingInt($args[0], $args[1]); } else if (is_int($args[0]) && is_int($args[1])) { $this->methodImplIntInt($args[0], $args[1]); } } else if (count($args) === 3) { // ... } } public function methodImplOtherThingInt(OtherThing $otherThing, $int) { // stuff } public function methodImplOtherThingInt($int1, $int2) { // stuff } } class BetterThing { public function method(OtherThing $otherThing, int $int) { // stuff } public function method(int $int1, int $int2) { // stuff } }

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.5.70.0000.05319.38
5.5.60.0100.06719.27
5.5.50.0130.07719.23
5.5.40.0030.07019.50
5.5.30.0030.05019.52
5.5.20.0070.08719.32
5.5.10.0070.04719.31
5.5.00.0000.06019.30
5.4.230.0030.08719.07
5.4.220.0170.06719.05
5.4.210.0030.07719.15
5.4.200.0130.07319.20
5.4.190.0000.06319.23
5.4.180.0070.05318.84
5.4.170.0130.07319.14
5.4.160.0070.04319.24
5.4.150.0070.07718.96
5.4.140.0070.05016.41
5.4.130.0070.04016.42
5.4.120.0130.06716.42
5.4.110.0130.06316.47
5.4.100.0070.07716.42
5.4.90.0030.03716.54
5.4.80.0070.03316.27
5.4.70.0100.05716.41
5.4.60.0030.04016.36
5.4.50.0100.03316.37
5.4.40.0030.03716.50
5.4.30.0100.06716.43
5.4.20.0030.04316.28
5.4.10.0070.05016.64
5.4.00.0070.04015.73
5.3.280.0030.08714.60
5.3.270.0070.07714.63
5.3.260.0000.04314.49
5.3.250.0070.06714.63
5.3.240.0070.05014.61
5.3.230.0100.07714.63
5.3.220.0130.07014.62
5.3.210.0100.07014.73
5.3.200.0100.04714.60
5.3.190.0030.06314.58
5.3.180.0070.08014.71
5.3.170.0070.05014.57
5.3.160.0000.04314.71
5.3.150.0130.07014.64
5.3.140.0000.04014.63
5.3.130.0170.05014.61
5.3.120.0070.06014.59
5.3.110.0070.08014.44
5.3.100.0030.04314.07
5.3.90.0130.06714.02
5.3.80.0100.03314.17
5.3.70.0000.04014.02
5.3.60.0030.04314.15
5.3.50.0000.04013.91
5.3.40.0100.03713.87
5.3.30.0100.03013.83
5.3.20.0030.05013.59
5.3.10.0030.07713.57
5.3.00.0170.05313.70

preferences:
138.77 ms | 1394 KiB | 7 Q