3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function callback($s) { return substr_replace($s[0], str_repeat('*', strlen($s[0])), 0, -4); } $value = '5746244234383238'; var_dump(preg_replace_callback('/\d{12,16}/', 'callback', $value));
Output for 4.3.0 - 7.2.0
string(20) "****************3238"