3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo preg_replace( '/(^|[a-z])([A-Z])/e', 'strtolower(strlen("\\1") ? "\\1_\\2" : "\\2")', $word );
based on KkJse
Output for 7.0.20, 7.1.5 - 7.2.0
Notice: Undefined variable: word in /in/Q5U5J on line 5 Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /in/Q5U5J on line 5
Output for 7.0.0 - 7.0.11, 7.1.0
Notice: Undefined variable: word in /in/Q5U5J on line 4 Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /in/Q5U5J on line 4
Output for 5.5.0 - 5.6.28
Notice: Undefined variable: word in /in/Q5U5J on line 6 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /in/Q5U5J on line 6
Output for 5.4.0 - 5.4.45
Notice: Undefined variable: word in /in/Q5U5J on line 6