3v4l.org

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