3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Set { public function __construct(array $spec, $arg1 = null, $arg2 = null) { if (isset($spec[0]) && is_array($spec[0]) { // was called like Set::createFromArray([['foo'=>'bar'], false, 64]); } else { // was called like new Set(['foo'=>'bar'], false, 64) } } } class SetFactory { public function create(array $map, $arg1, $arg2) { return new Set($map, $arg1, $arg2); } public function createFromArray(array $spec) { return new Set($spec); } }

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.20.0000.05717.31
5.5.10.0130.07017.32
5.5.00.0100.07717.22
5.4.180.0070.08019.13
5.4.170.0030.04719.00
5.4.160.0030.07018.87
5.4.150.0070.05719.25
5.4.140.0070.07316.38
5.4.130.0070.04316.32
5.4.120.0070.07716.54
5.4.110.0100.05716.59
5.4.100.0100.06716.40
5.4.90.0030.06716.48
5.4.80.0070.07316.22
5.4.70.0070.06716.41
5.4.60.0070.07716.38
5.4.50.0130.06316.46
5.4.40.0070.07016.43
5.4.30.0030.07316.55
5.4.20.0130.06716.45
5.4.10.0070.07316.41
5.4.00.0070.07315.76
5.3.270.0030.08014.64
5.3.260.0000.07314.59
5.3.250.0070.04714.62
5.3.240.0030.06314.58
5.3.230.0030.07714.64
5.3.220.0030.07014.57
5.3.210.0100.08014.67
5.3.200.0070.05314.67
5.3.190.0070.06314.63
5.3.180.0030.08014.59
5.3.170.0170.06714.60
5.3.160.0000.06014.60
5.3.150.0100.06714.78
5.3.140.0170.06714.60
5.3.130.0070.06714.60
5.3.120.0070.07314.40
5.3.110.0100.07314.54
5.3.100.0100.07714.07
5.3.90.0030.06714.06
5.3.80.0030.06713.86
5.3.70.0000.08013.86
5.3.60.0030.08014.04
5.3.50.0070.07713.94
5.3.40.0070.05014.02
5.3.30.0130.07013.96
5.3.20.0070.07713.91
5.3.10.0030.03313.86
5.3.00.0000.03713.67

preferences:
137.66 ms | 1394 KiB | 7 Q