diff options
author | Andi Gutmans <andi@php.net> | 2001-12-04 17:58:32 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2001-12-04 17:58:32 +0000 |
commit | 54767061429adb3d68200569b5914d1c59ee3bfb (patch) | |
tree | 71c98b44e8072a06d0057485f2a780011984c979 | |
parent | a9b9c68b8a76b210fdce0a240644de299dc3d228 (diff) | |
download | php-git-54767061429adb3d68200569b5914d1c59ee3bfb.tar.gz |
- Damn Zeev :)
-rw-r--r-- | Zend/zend_builtin_functions.c | 51 |
1 files changed, 49 insertions, 2 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 4f6e457cb5..7da9fa9e53 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -127,12 +127,17 @@ int zend_startup_builtin_functions(TSRMLS_D) } +/* {{{ proto string zend_version(void) + Get the version of the Zend Engine */ ZEND_FUNCTION(zend_version) { RETURN_STRINGL(ZEND_VERSION, sizeof(ZEND_VERSION)-1, 1); } +/* }}} */ +/* {{{ proto int func_num_args(void) + Get the number of arguments that were passed to the function */ ZEND_FUNCTION(func_num_args) { void **p; @@ -152,8 +157,11 @@ ZEND_FUNCTION(func_num_args) RETURN_LONG(-1); } } +/* }}} */ +/* {{{ proto mixed func_get_arg(int arg_num) + Get the $arg_num'th argument that was passed to the function */ ZEND_FUNCTION(func_get_arg) { void **p; @@ -190,8 +198,11 @@ ZEND_FUNCTION(func_get_arg) *return_value = *arg; zval_copy_ctor(return_value); } +/* }}} */ +/* {{{ proto array func_get_args() + Get an array of the arguments that were passed to the function */ ZEND_FUNCTION(func_get_args) { void **p; @@ -224,6 +235,7 @@ ZEND_FUNCTION(func_get_args) zend_hash_next_index_insert(return_value->value.ht, &element, sizeof(zval *), NULL); } } +/* }}} */ /* {{{ proto int strlen(string str) @@ -240,6 +252,7 @@ ZEND_NAMED_FUNCTION(zend_if_strlen) } /* }}} */ + /* {{{ proto int strcmp(string str1, string str2) Binary safe string comparison */ ZEND_FUNCTION(strcmp) @@ -255,6 +268,7 @@ ZEND_FUNCTION(strcmp) } /* }}} */ + /* {{{ proto int strncmp(string str1, string str2, int len) Binary safe string comparison */ ZEND_FUNCTION(strncmp) @@ -271,6 +285,7 @@ ZEND_FUNCTION(strncmp) } /* }}} */ + /* {{{ proto int strcasecmp(string str1, string str2) Binary safe case-insensitive string comparison */ ZEND_FUNCTION(strcasecmp) @@ -286,6 +301,7 @@ ZEND_FUNCTION(strcasecmp) } /* }}} */ + /* {{{ proto int strncasecmp(string str1, string str2, int len) Binary safe string comparison */ ZEND_FUNCTION(strncasecmp) @@ -302,6 +318,9 @@ ZEND_FUNCTION(strncasecmp) } /* }}} */ + +/* {{{ proto array each(array arr) + Return the currently pointed key..value pair in the passed array, and advance the pointer to the next element */ ZEND_FUNCTION(each) { zval **array, *entry, **entry_ptr, *tmp; @@ -352,7 +371,11 @@ ZEND_FUNCTION(each) (*inserted_pointer)->refcount++; zend_hash_move_forward(target_hash); } +/* }}} */ + +/* {{{ proto int error_reporting(int new_error_level=null) + Return the current error_reporting level, and if an argument was passed - change to the new level */ ZEND_FUNCTION(error_reporting) { zval **arg; @@ -376,7 +399,11 @@ ZEND_FUNCTION(error_reporting) RETVAL_LONG(old_error_reporting); } +/* }}} */ + +/* {{{ proto bool define(string constant_name, mixed value, case_sensitive=true) + Define a new constant */ ZEND_FUNCTION(define) { zval **var, **val, **non_cs; @@ -432,8 +459,11 @@ ZEND_FUNCTION(define) RETURN_FALSE; } } +/* }}} */ +/* {{{ proto bool define(string constant_name) + Check whether a constant exists */ ZEND_FUNCTION(defined) { zval **var; @@ -451,6 +481,8 @@ ZEND_FUNCTION(defined) RETURN_LONG(0); } } +/* }}} */ + /* {{{ proto string get_class(object object) Retrieves the class name */ @@ -471,6 +503,7 @@ ZEND_FUNCTION(get_class) } /* }}} */ + /* {{{ proto string get_parent_class(mixed object) Retrieves the parent class name for object or class. */ ZEND_FUNCTION(get_parent_class) @@ -498,6 +531,7 @@ ZEND_FUNCTION(get_parent_class) } /* }}} */ + /* {{{ proto bool is_subclass_of(object object, string class_name) Returns true if the object has this class as one of its parents */ ZEND_FUNCTION(is_subclass_of) @@ -529,6 +563,7 @@ ZEND_FUNCTION(is_subclass_of) } /* }}} */ + /* {{{ proto array get_class_vars(string class_name) Returns an array of default properties of the class */ ZEND_FUNCTION(get_class_vars) @@ -561,6 +596,7 @@ ZEND_FUNCTION(get_class_vars) } /* }}} */ + /* {{{ proto array get_object_vars(object obj) Returns an array of object properties */ ZEND_FUNCTION(get_object_vars) @@ -582,6 +618,7 @@ ZEND_FUNCTION(get_object_vars) } /* }}} */ + /* {{{ proto array get_class_methods(mixed class) Returns an array of method names for class or class instance. */ ZEND_FUNCTION(get_class_methods) @@ -622,6 +659,7 @@ ZEND_FUNCTION(get_class_methods) } /* }}} */ + /* {{{ proto bool method_exists(object object, string method) Checks if the class method exists */ ZEND_FUNCTION(method_exists) @@ -648,6 +686,7 @@ ZEND_FUNCTION(method_exists) } /* }}} */ + /* {{{ proto bool class_exists(string classname) Checks if the class exists */ ZEND_FUNCTION(class_exists) @@ -671,6 +710,7 @@ ZEND_FUNCTION(class_exists) } /* }}} */ + /* {{{ proto bool function_exists(string function_name) Checks if the function exists */ ZEND_FUNCTION(function_exists) @@ -694,6 +734,8 @@ ZEND_FUNCTION(function_exists) /* }}} */ +/* {{{ proto void leak(int num_bytes=3) + Cause an intentional memory leak, for testing/debugging purposes */ ZEND_FUNCTION(leak) { int leakbytes=3; @@ -708,6 +750,7 @@ ZEND_FUNCTION(leak) emalloc(leakbytes); } +/* }}} */ #ifdef ZEND_TEST_EXCEPTIONS @@ -815,7 +858,6 @@ ZEND_FUNCTION(set_error_handler) /* }}} */ - /* {{{ proto void restore_error_handler(void) Restores the previously defined error handler function */ ZEND_FUNCTION(restore_error_handler) @@ -842,6 +884,7 @@ static int copy_class_name(zend_class_entry *ce, int num_args, va_list args, zen return 0; } + /* {{{ proto array get_declared_classes(void) Returns an array of all declared classes. */ ZEND_FUNCTION(get_declared_classes) @@ -855,6 +898,7 @@ ZEND_FUNCTION(get_declared_classes) } /* }}} */ + static int copy_function_name(zend_function *func, int num_args, va_list args, zend_hash_key *hash_key) { zval *internal_ar = va_arg(args, zval *), @@ -873,6 +917,7 @@ static int copy_function_name(zend_function *func, int num_args, va_list args, z return 0; } + /* {{{ proto array get_defined_functions(void) Returns an array of all defined functions */ ZEND_FUNCTION(get_defined_functions) @@ -905,6 +950,7 @@ ZEND_FUNCTION(get_defined_functions) } /* }}} */ + /* {{{ proto array get_defined_vars(void) Returns an associative array of names and values of all currently defined variable names (variables in the current scope) */ ZEND_FUNCTION(get_defined_vars) @@ -918,8 +964,8 @@ ZEND_FUNCTION(get_defined_vars) } /* }}} */ -#define LAMBDA_TEMP_FUNCNAME "__lambda_func" +#define LAMBDA_TEMP_FUNCNAME "__lambda_func" /* {{{ proto string create_function(string args, string code) Creates an anonymous function, and returns its name (funny, eh?) */ ZEND_FUNCTION(create_function) @@ -1028,6 +1074,7 @@ static int add_constant_info(zend_constant *constant, void *arg TSRMLS_DC) return 0; } + /* {{{ proto array get_loaded_extensions(void) Return an array containing names of loaded extensions */ ZEND_FUNCTION(get_loaded_extensions) |