3v4l.org

run code in 300+ PHP versions simultaneously
<?php function snakeToCamel($text, $firstUpper = true) { $regex = '/('; if ($firstUpper) { $regex .= '^|'; } $regex .= '_)([a-z])/'; return preg_replace_callback($regex, function($match) {return strtoupper($match[2]), $text); } echo snakeToCamel('testFooBar');

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.00.0030.05320.29
5.6.160.0100.04720.47
5.6.150.0030.04318.12
5.6.140.0100.05718.15
5.6.130.0030.07718.21
5.6.120.0130.07021.00
5.6.110.0000.08721.09
5.6.100.0200.06721.14
5.6.90.0070.08721.13
5.6.80.0100.06720.40
5.5.300.0170.07018.05
5.5.290.0100.07718.00
5.5.280.0070.07320.78
5.5.270.0100.06020.77
5.5.260.0130.07720.87
5.5.250.0000.08720.61
5.5.240.3930.04020.25

preferences:
143.32 ms | 1394 KiB | 7 Q