rc = mdb_txn_begin(LMDB_IT(env), NULL, MDB_RDONLY, &LMDB_IT(txn));
if (rc) {
- php_error_docref0(NULL, E_WARNING, "%s", mdb_strerror(rc));
+ php_error_docref(NULL, E_WARNING, "%s", mdb_strerror(rc));
return NULL;
}
rc = mdb_cursor_open(LMDB_IT(txn), LMDB_IT(dbi), &LMDB_IT(cur));
if (rc) {
mdb_txn_abort(LMDB_IT(txn));
- php_error_docref0(NULL, E_WARNING, "%s", mdb_strerror(rc));
+ php_error_docref(NULL, E_WARNING, "%s", mdb_strerror(rc));
return NULL;
}
mdb_cursor_close(LMDB_IT(cur));
LMDB_IT(cur) = NULL;
if (MDB_NOTFOUND != rc) {
- php_error_docref0(NULL, E_WARNING, "%s", mdb_strerror(rc));
+ php_error_docref(NULL, E_WARNING, "%s", mdb_strerror(rc));
}
return NULL;
}
rc = mdb_txn_renew(LMDB_IT(txn));
if (rc) {
- php_error_docref0(NULL, E_WARNING, "%s", mdb_strerror(rc));
+ php_error_docref(NULL, E_WARNING, "%s", mdb_strerror(rc));
return NULL;
}
mdb_cursor_close(LMDB_IT(cur));
LMDB_IT(cur) = NULL;
if (MDB_NOTFOUND != rc) {
- php_error_docref0(NULL, E_WARNING, "%s", mdb_strerror(rc));
+ php_error_docref(NULL, E_WARNING, "%s", mdb_strerror(rc));
}
return NULL;
}
rc = mdb_env_sync(LMDB_IT(env), 1);
if (rc) {
- php_error_docref0(NULL, E_WARNING, "%s", mdb_strerror(rc));
+ php_error_docref(NULL, E_WARNING, "%s", mdb_strerror(rc));
return FAILURE;
}
if (idna_info != NULL) {
if (variant == INTL_IDN_VARIANT_2003) {
- php_error_docref0(NULL, E_NOTICE,
+ php_error_docref(NULL, E_NOTICE,
"4 arguments were provided, but INTL_IDNA_VARIANT_2003 only "
"takes 3 - extra argument ignored");
} else {
TimeZone_ce_ptr = zend_register_internal_class(&ce);
if (!TimeZone_ce_ptr) {
//can't happen now without bigger problems before
- php_error_docref0(NULL, E_ERROR,
+ php_error_docref(NULL, E_ERROR,
"IntlTimeZone: class registration has failed.");
return;
}
( zend_binary_strcmp( "id", sizeof( "id" ) - 1,
Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) )
{
- php_error_docref0( NULL, E_WARNING, "The property \"id\" is read-only" );
+ php_error_docref(NULL, E_WARNING, "The property \"id\" is read-only" );
retval = &EG( uninitialized_zval );
}
else
( zend_binary_strcmp( "id", sizeof( "id" ) - 1,
Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) )
{
- php_error_docref0( NULL, E_WARNING, "The property \"id\" is read-only" );
+ php_error_docref(NULL, E_WARNING, "The property \"id\" is read-only" );
}
else
{
if( res == FAILURE )
{
zend_string *message = intl_error_get_message( NULL );
- php_error_docref0( NULL, E_WARNING, "Could not create "
+ php_error_docref(NULL, E_WARNING, "Could not create "
"transliterator with ID \"%s\" (%s)", Z_STRVAL_P( arg1 ), ZSTR_VAL(message) );
zend_string_free( message );
ZVAL_UNDEF(&tmp_object);
void err_msg_dispose(struct err_s *err)
{
if (err->msg != NULL) {
- php_error_docref0(NULL, err->level, "%s", err->msg);
+ php_error_docref(NULL, err->level, "%s", err->msg);
if (err->should_free) {
efree(err->msg);
}
#define LONG_CHECK_VALID_INT(l) \
do { \
if ((l) < INT_MIN && (l) > INT_MAX) { \
- php_error_docref0(NULL, E_WARNING, "The value " ZEND_LONG_FMT " does not fit inside " \
+ php_error_docref(NULL, E_WARNING, "The value " ZEND_LONG_FMT " does not fit inside " \
"the boundaries of a native integer", (l)); \
return; \
} \
LONG_CHECK_VALID_INT(n);
if (n < 0) {
- php_error_docref0(NULL, E_WARNING, "The third argument "
+ php_error_docref(NULL, E_WARNING, "The third argument "
"cannot be negative");
return;
}
entry = get_ancillary_reg_entry(level, type);
if (entry == NULL) {
- php_error_docref0(NULL, E_WARNING, "The pair level " ZEND_LONG_FMT "/type " ZEND_LONG_FMT " is "
+ php_error_docref(NULL, E_WARNING, "The pair level " ZEND_LONG_FMT "/type " ZEND_LONG_FMT " is "
"not supported by PHP", level, type);
return;
}
if (entry->var_el_size > 0 && n > (zend_long)((ZEND_LONG_MAX - entry->size -
CMSG_SPACE(0) - 15L) / entry->var_el_size)) {
/* the -15 is to account for any padding CMSG_SPACE may add after the data */
- php_error_docref0(NULL, E_WARNING, "The value for the "
+ php_error_docref(NULL, E_WARNING, "The value for the "
"third argument (" ZEND_LONG_FMT ") is too large", n);
return;
}
case IPV6_PKTINFO:
#ifdef PHP_WIN32
if (Z_TYPE_P(arg4) == IS_ARRAY) {
- php_error_docref0(NULL, E_WARNING, "Windows does not "
+ php_error_docref(NULL, E_WARNING, "Windows does not "
"support sticky IPV6_PKTINFO");
return FAILURE;
} else {
if (all) { /* replace with all named entities */
if (CHARSET_PARTIAL_SUPPORT(charset)) {
- php_error_docref0(NULL, E_STRICT, "Only basic entities "
+ php_error_docref(NULL, E_STRICT, "Only basic entities "
"substitution is supported for multi-byte encodings other than UTF-8; "
"functionality is equivalent to htmlspecialchars");
}
}
/* }}} */
-/* {{{ php_error_docref0 */
-/* See: CODING_STANDARDS.md for details. */
-PHPAPI ZEND_COLD void php_error_docref0(const char *docref, int type, const char *format, ...)
+/* {{{ php_error_docref */
+/* Generate an error which links to docref or the php.net documentation if docref is NULL */
+PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format, ...)
{
va_list args;
PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int type, const char *format, va_list args) PHP_ATTRIBUTE_FORMAT(printf, 4, 0);
/* PHPAPI void php_error(int type, const char *format, ...); */
-PHPAPI ZEND_COLD void php_error_docref0(const char *docref, int type, const char *format, ...)
+PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format, ...)
PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
PHPAPI ZEND_COLD void php_error_docref1(const char *docref, const char *param1, int type, const char *format, ...)
PHP_ATTRIBUTE_FORMAT(printf, 4, 5);
#endif
END_EXTERN_C()
-#define php_error_docref php_error_docref0
-
#define zenderror phperror
#define zendlex phplex