summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2000-09-05 17:55:57 +0000
committerAndi Gutmans <andi@php.net>2000-09-05 17:55:57 +0000
commit715774bed73cc789b7c5cc7b79acd6a283be86ed (patch)
tree2ff142207896e46dd4dc821373eb2b653a925c61
parentd57e56ab4ceac8564112522132e08fa0f5c9a877 (diff)
downloadphp-git-715774bed73cc789b7c5cc7b79acd6a283be86ed.tar.gz
- Commiting Sterling's new multi_convert* functions
-rw-r--r--Zend/zend_operators.c46
-rw-r--r--Zend/zend_operators.h3
2 files changed, 48 insertions, 1 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index e1e7cd2d36..b112a50257 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -488,7 +488,51 @@ ZEND_API void convert_to_object(zval *op)
}
}
-
+ZEND_API void multi_convert_to_long_ex(int argc, ...)
+{
+ zval **arg;
+ va_list ap;
+
+ va_start(ap, argc);
+
+ while (argc--) {
+ arg = va_arg(ap, zval **);
+ convert_to_long_ex(arg);
+ }
+
+ va_end(ap);
+}
+
+ZEND_API void multi_convert_to_double_ex(int argc, ...)
+{
+ zval **arg;
+ va_list ap;
+
+ va_start(ap, argc);
+
+ while (argc--) {
+ arg = va_arg(ap, zval **);
+ convert_to_double_ex(arg);
+ }
+
+ va_end(ap);
+}
+
+ZEND_API void multi_convert_to_string_ex(int argc, ...)
+{
+ zval **arg;
+ va_list ap;
+
+ va_start(ap, argc);
+
+ while (argc--) {
+ arg = va_arg(ap, zval **);
+ convert_to_string_ex(arg);
+ }
+
+ va_end(ap);
+}
+
ZEND_API int add_function(zval *result, zval *op1, zval *op2)
{
zval op1_copy, op2_copy;
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index 3cdbda42ce..28c63739af 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -132,6 +132,9 @@ ZEND_API void convert_to_null(zval *op);
ZEND_API void convert_to_boolean(zval *op);
ZEND_API void convert_to_array(zval *op);
ZEND_API void convert_to_object(zval *op);
+ZEND_API void multi_convert_to_long_ex(int argc, ...);
+ZEND_API void multi_convert_to_double_ex(int argc, ...);
+ZEND_API void multi_convert_to_string_ex(int argc, ...);
ZEND_API int add_char_to_string(zval *result, zval *op1, zval *op2);
ZEND_API int add_string_to_string(zval *result, zval *op1, zval *op2);
#define convert_to_string(op) _convert_to_string((op) ZEND_FILE_LINE_CC)