3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ 'one"two_"_"_three', 'one__two_"__three', 'one__two_"__""____"three', 'one__two___"""""""______three', ]; var_export( preg_replace('~["_]+~', '_', $strings) );

preferences:
98.34 ms | 1503 KiB | 5 Q