using Php;

namespace PhpNative {
    public string str_replace (string search, string replacement, string value) {
        return value.replace (search, replacement);
    }

    public string str_replace_static (string search, string replacement, string value, string php_file, int php_line) throws Error {
        return str_replace (search, replacement, value);
    }

    public zval str_replace_zval (zval search, zval replacement, zval value, string php_file, int php_line) throws Error {
        return zval.string_value (str_replace_static (zval_to_string (search), zval_to_string (replacement), zval_to_string (value), php_file, php_line));
    }
}
