3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function replace_callback($matches){ return $matches[0]; } $str = "abc{123}def{456}ghi{789}jkl"; $result = preg_replace_callback('/\{.*?\}/', 'replace_callback', $str); print_r($result);
Output for 4.3.0 - 7.2.0
abc{123}def{456}ghi{789}jkl