3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo preg_replace( '/(^|[a-z])([A-Z])/e', 'strtolower(strlen("\\1") ? "\\1_\\2" : "\\2")', $word );
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: Undefined variable $word in /in/Q5U5J on line 5 Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/Q5U5J on line 2 Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /in/Q5U5J on line 2
Output for 8.1.0 - 8.1.28
Warning: Undefined variable $word in /in/Q5U5J on line 5 Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated 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 8.0.0 - 8.0.30
Warning: 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.19 - 7.0.33, 7.1.5 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
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.3.32 - 7.3.33
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.18, 7.1.0 - 7.1.4
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.5.38, 5.6.0 - 5.6.40
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

preferences:
230.9 ms | 401 KiB | 376 Q