3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo preg_replace_callback('/([a-z])(_[a-z])/', function($u) { //var_dump($u); return $u[1].ucwords(str_replace('_', '', $u[2])); } , 'rob_tr_yuui'); echo PHP_EOL; echo preg_replace('/([a-z])(_[a-z])/', '$1$2', 'rob_tr_yuui'); function to_camel_case($str, $capitalise_first_char = false) { if($capitalise_first_char) { $str[0] = strtoupper($str[0]); } $func = create_function('$c', 'return strtoupper($c[1]);'); return preg_replace_callback('/_([a-z])/', $func, $str); } echo PHP_EOL; echo to_camel_case('rob_tr_yuui')

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.4.230.0170.05812.39
5.4.220.0130.04312.39
5.4.210.0160.04212.39
5.4.200.0130.04312.39
5.4.190.0110.04612.39
5.4.180.0180.04712.39
5.4.170.0120.04612.39
5.4.160.0140.05212.39
5.4.150.0130.05012.39
5.4.140.0190.06012.08
5.4.130.0120.04112.06
5.4.120.0120.04212.03
5.4.110.0110.04312.02
5.4.100.0140.04312.03
5.4.90.0120.04712.03
5.4.80.0160.04612.02
5.4.70.0190.04512.02
5.4.60.0220.07112.02
5.4.50.0130.04512.02
5.4.40.0150.04112.00
5.4.30.0210.06312.00
5.4.20.0100.04011.99
5.4.10.0120.03912.00
5.4.00.0120.03811.50
5.3.280.0120.04312.71
5.3.270.0150.04612.72
5.3.260.0120.04312.72
5.3.250.0130.04112.72
5.3.240.0110.04212.72
5.3.230.0130.04512.71
5.3.220.0190.07412.68
5.3.210.0140.04912.68
5.3.200.0110.04912.68
5.3.190.0240.06812.68
5.3.180.0120.04412.67
5.3.170.0150.04312.67
5.3.160.0130.04312.68
5.3.150.0220.06612.67
5.3.140.0150.04512.66
5.3.130.0120.04512.66
5.3.120.0120.04312.66
5.3.110.0120.04912.66
5.3.100.0150.04212.12
5.3.90.0130.04312.10
5.3.80.0130.04612.09
5.3.70.0130.04012.09
5.3.60.0130.04312.08
5.3.50.0210.05212.02
5.3.40.0110.04112.02
5.3.30.0110.04311.98
5.3.20.0130.03811.76
5.3.10.0200.06711.73
5.3.00.0140.04511.71

preferences:
141.15 ms | 1394 KiB | 7 Q