3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $oldValue = 'new_name_spacing'; $newValue = preg_replace_callback( '/(_[a-z])/', function ($match) { return substr($match, 1, strlen($match)); }, $oldValue ); echo $newValue;
Output for 5.6.0 - 7.3.0beta1
Warning: strlen() expects parameter 1 to be string, array given in /in/GI59E on line 9 Warning: substr() expects parameter 1 to be string, array given in /in/GI59E on line 9 Warning: strlen() expects parameter 1 to be string, array given in /in/GI59E on line 9 Warning: substr() expects parameter 1 to be string, array given in /in/GI59E on line 9 newamepacing