3v4l.org

run code in 300+ PHP versions simultaneously
<?php public function formModelName ($formName, $inputName) { $retVal = "['" . $formName . "']"; $retVal .= preg_replace_callback('$\[\D+\]$', function ($matches) { return "['" . $matches [1] . "']"; }, $inputName); return $retVal; } echo formModelName ('relation_import', '[locations][0][name]')

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.0.20.0300.05020.19
7.0.10.0000.05720.09
7.0.00.0200.07720.09
5.6.160.0070.08320.55
5.6.150.0000.05718.19
5.6.140.0130.07318.25
5.6.130.0100.06718.18
5.6.120.0130.07321.03
5.6.110.0070.07021.04
5.6.100.0030.09020.96
5.6.90.0070.08320.96
5.6.80.0170.06320.36
5.5.300.0130.07318.01
5.5.290.0070.05017.95
5.5.280.0030.07320.79
5.5.270.0200.07320.75
5.5.260.0100.06320.93
5.5.250.0030.08720.66
5.5.240.0270.06020.18

preferences:
141.08 ms | 1386 KiB | 7 Q