Exemple #1
0
Variant HHVM_FUNCTION(preg_replace_callback, const Variant& pattern, const Variant& callback,
                                             const Variant& subject,
                                             int limit /* = -1 */,
                                             VRefParam count /* = null */) {
  if (!f_is_callable(callback)) {
    raise_warning("Not a valid callback function %s",
        callback.toString().data());
    return empty_string_variant();
  }
  return preg_replace_impl(pattern, callback, subject,
                           limit, count, true, false);
}
Exemple #2
0
Variant HHVM_FUNCTION(preg_filter, const Variant& pattern, const Variant& callback,
                                   const Variant& subject, int limit /* = -1 */,
                                   VRefParam count /* = null */) {
  return preg_replace_impl(pattern, callback, subject,
                           limit, count, false, true);
}
Exemple #3
0
Variant f_preg_replace_callback(CVarRef pattern, CVarRef callback,
                                CVarRef subject, int limit /* = -1 */,
                                VRefParam count /* = null */) {
  return preg_replace_impl(pattern, callback, subject, limit, count, true);
}
Exemple #4
0
Variant HHVM_FUNCTION(preg_replace, const Variant& pattern, const Variant& replacement,
                                    const Variant& subject, int limit /* = -1 */,
                                    VRefParam count /* = null */) {
  return preg_replace_impl(pattern, replacement, subject,
                           limit, count, false, false);
}
Exemple #5
0
Variant f_preg_replace(CVarRef pattern, CVarRef replacement, CVarRef subject,
                       int limit /* = -1 */, VRefParam count /* = null */) {
  return preg_replace_impl(pattern, replacement, subject, limit, count, false);
}