Replace deprecated PREG_REPLACE_EVAL modifier with preg_replace_callback()

`PREG_REPLACE_EVAL` modifier is deprecated since PHP 5.5.0, this PR resolves this problem by using preg_replace_callback instead.