Browse Source

- Use zend_uchar for param type

- %v is for UG() - dependent strings, which is not the case here
- 'T' is only useful for multiple parameters, so use 't' instead
migration/RELEASE_1_0_0
Andrei Zmievski 20 years ago
parent
commit
0bb270d352
  1. 11
      ext/standard/basic_functions.c

11
ext/standard/basic_functions.c

@ -4173,19 +4173,20 @@ PHP_MINFO_FUNCTION(basic)
}
/* {{{ proto mixed constant(string const_name)
Given the name of a constant this function will return the constants associated value */
/* {{{ proto mixed constant(string const_name) U
Given the name of a constant this function will return the constant's associated value */
PHP_FUNCTION(constant)
{
zstr const_name;
int const_name_len, const_type;
int const_name_len;
zend_uchar const_type;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "T", &const_name, &const_name_len, &const_type) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t", &const_name, &const_name_len, &const_type) == FAILURE) {
return;
}
if (!zend_u_get_constant(const_type, const_name, const_name_len, return_value TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't find constant %v", const_name);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't find constant %R", const_type, const_name);
RETURN_NULL();
}
}

Loading…
Cancel
Save