summaryrefslogtreecommitdiff
path: root/ext/standard/type.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/type.c')
-rw-r--r--ext/standard/type.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/standard/type.c b/ext/standard/type.c
index 543fdea..59d7314b 100644
--- a/ext/standard/type.c
+++ b/ext/standard/type.c
@@ -176,6 +176,21 @@ PHP_FUNCTION(floatval)
}
/* }}} */
+/* {{{ proto bool boolval(mixed var)
+ Get the boolean value of a variable */
+PHP_FUNCTION(boolval)
+{
+ zval **val;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &val) == FAILURE) {
+ return;
+ }
+
+ RETVAL_ZVAL(*val, 1, 0);
+ convert_to_boolean(return_value);
+}
+/* }}} */
+
/* {{{ proto string strval(mixed var)
Get the string value of a variable */
PHP_FUNCTION(strval)