tony2001 Mon Jul 17 07:11:06 2006 UTC
Modified files:
/php-src/ext/standard basic_functions.c
Log:
tweak constant() to use the brand new unicode parameters API
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.789&r2=1.790&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.789
php-src/ext/standard/basic_functions.c:1.790
--- php-src/ext/standard/basic_functions.c:1.789 Mon Jul 17 07:02:26 2006
+++ php-src/ext/standard/basic_functions.c Mon Jul 17 07:11:06 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.789 2006/07/17 07:02:26 tony2001 Exp $ */
+/* $Id: basic_functions.c,v 1.790 2006/07/17 07:11:06 tony2001 Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -4177,16 +4177,15 @@
Given the name of a constant this function will return the constants
associated value */
PHP_FUNCTION(constant)
{
- zval* const_name;
+ zstr const_name;
+ int const_name_len, const_type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &const_name)
== FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "T", &const_name,
&const_name_len, &const_type) == FAILURE) {
return;
}
- convert_to_text_ex(&const_name);
-
- if (!zend_u_get_constant(Z_TYPE_P(const_name), Z_UNIVAL_P(const_name),
Z_UNILEN_P(const_name), return_value TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't find
constant %s", Z_STRVAL_P(const_name));
+ 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);
RETURN_NULL();
}
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php