3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // php 5.3.0+ $initial = 'PROP_RESOURCE_TYPE'; $words = explode('_', $initial); foreach($words as &$word){ $word = ucfirst(strtolower($word)); } $final = implode($words); echo $final; // returns PropResourceType // if you want a lowercase first letter just do // returns propResourceType
Output for 5.0.0 - 5.0.5, 5.1.1 - 7.1.0
PropResourceType
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/XNbj2 on line 15
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /in/XNbj2 on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '&', expecting T_VARIABLE or '$' in /in/XNbj2 on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /in/XNbj2 on line 6
Process exited with code 255.