get to the end without encountering a delimiter. */
while (isspace((int)*(unsigned char *)p)) p++;
if (*p == 0) {
- zend_error(E_WARNING, "Empty regular expression");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression");
return NULL;
}
or a backslash. */
delimiter = *p++;
if (isalnum((int)*(unsigned char *)&delimiter) || delimiter == '\\') {
- zend_error(E_WARNING, "Delimiter must not be alphanumeric or backslash");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Delimiter must not be alphanumeric or backslash");
return NULL;
}
pp++;
}
if (*pp == 0) {
- zend_error(E_WARNING, "No ending delimiter '%c' found", delimiter);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "No ending delimiter '%c' found", delimiter);
return NULL;
}
} else {
pp++;
}
if (*pp == 0) {
- zend_error(E_WARNING, "No ending matching delimiter '%c' found", end_delimiter);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "No ending matching delimiter '%c' found", end_delimiter);
return NULL;
}
}
break;
default:
- zend_error(E_WARNING, "Unknown modifier '%c'", pp[-1]);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown modifier '%c'", pp[-1]);
efree(pattern);
return NULL;
}
tables);
if (re == NULL) {
- zend_error(E_WARNING, "Compilation failed: %s at offset %d", error, erroffset);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Compilation failed: %s at offset %d", error, erroffset);
efree(pattern);
return NULL;
}
if (do_study) {
*extra = pcre_study(re, soptions, &error);
if (error != NULL) {
- zend_error(E_WARNING, "Error while studying pattern");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while studying pattern");
}
}
}
if ((global && (subpats_order < PREG_PATTERN_ORDER || subpats_order > PREG_SET_ORDER)) ||
(!global && subpats_order != 0)) {
- zend_error(E_WARNING, "Wrong value for parameter 4 in call to %s()", get_active_function_name(TSRMLS_C));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong value for parameter 4 in call to %s()", get_active_function_name(TSRMLS_C));
return;
}
}
/* Check for too many substrings condition. */
if (count == 0) {
- zend_error(E_NOTICE, "Matched, but too many substrings");
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Matched, but too many substrings");
count = size_offsets/3;
}
efree(subpat_names);
efree(offsets);
efree(re);
- zend_error(E_WARNING, "Get subpatterns list failed");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get subpatterns list failed");
return;
}
/* Run the code */
if (zend_eval_string(code.c, &retval, compiled_string_description TSRMLS_CC) == FAILURE) {
efree(compiled_string_description);
- zend_error(E_ERROR, "Failed evaluating code:\n%s", code.c);
- /* zend_error() does not return in this case */
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed evaluating code:\n%s", code.c);
+ /* php_error_docref(NULL TSRMLS_CC, ) does not return in this case */
}
efree(compiled_string_description);
convert_to_string(&retval);
/* Check for too many substrings condition. */
if (count == 0) {
- zend_error(E_NOTICE, "Matched, but too many substrings");
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Matched, but too many substrings");
count = size_offsets/3;
}
/* Check for too many substrings condition. */
if (count == 0) {
- zend_error(E_NOTICE, "Matched, but too many substrings");
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Matched, but too many substrings");
count = size_offsets/3;
}
}
if (Z_TYPE_PP(input) != IS_ARRAY) {
- zend_error(E_WARNING, "Second argument to preg_grep() should be an array");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument to preg_grep() should be an array");
return;
}
/* Check for too many substrings condition. */
if (count == 0) {
- zend_error(E_NOTICE, "Matched, but too many substrings");
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Matched, but too many substrings");
count = size_offsets/3;
}