replace evil eval with preg_replace_callback