3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php array( 'fromWeightkg', 'toWeightkg', 'value', '1', '0', ); foreach ($array as $value) { var_dump(gr($value)); } function gr($str) { $str[0] = strtoupper($str[0]); }
based on STZIk
Output for 5.1.0 - 7.1.0
Notice: Undefined variable: array in /in/N3CWH on line 10 Warning: Invalid argument supplied for foreach() in /in/N3CWH on line 10
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.0.5
Warning: Invalid argument supplied for foreach() in /in/N3CWH on line 10
Output for 4.3.11