3v4l.org

run code in 200+ 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 echo lcfirst($final); // returns propResourceType
Output for 5.3.0 - 7.2.0
PropResourceTypepropResourceType
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.2.17
PropResourceType Fatal error: Call to undefined function lcfirst() in /in/9S3Oo on line 14
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/9S3Oo 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/9S3Oo 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/9S3Oo 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/9S3Oo on line 6
Process exited with code 255.