diff options
author | Zeev Suraski <zeev@php.net> | 2000-08-09 19:22:35 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2000-08-09 19:22:35 +0000 |
commit | c06692e9ec92bdbe22e7a4149b5365635c4ad950 (patch) | |
tree | fb3e7ccb8c5187dd8d39aacd97d2707739982769 /Zend/zend_builtin_functions.c | |
parent | 609577d8826e5a23565eb8fdf5033d60ed505c4e (diff) | |
download | php-git-c06692e9ec92bdbe22e7a4149b5365635c4ad950.tar.gz |
The patch we promised - redesigned the compilation/execution API:
Advantages:
- Smaller memory footprint for the op arrays
- Slightly faster compilation times (due to saved erealloc() calls and faster zend_op
initialization)
- include_once() & require_once() share the same file list
- Consistency between include() and require() - this mostly means that return()
works inside require()'d files just as it does in include() files (it used to
be meaningless in require()'d files, most of the time (see below))
- Made require() consistent with itself. Before, if the argument was not a constant
string, require() took the include() behavior (with return()).
- Removed lots of duplicate code.
Bottom line - require() and include() are very similar now; require() is simply an include()
which isn't allowed to fail. Due to the erealloc() calls for large op arrays, require()
didn't end up being any faster than include() in the Zend engine.
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r-- | Zend/zend_builtin_functions.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 4efedd8b08..27564fa5a2 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -47,7 +47,6 @@ static ZEND_FUNCTION(leak); #ifdef ZEND_TEST_EXCEPTIONS static ZEND_FUNCTION(crash); #endif -static ZEND_FUNCTION(get_required_files); static ZEND_FUNCTION(get_included_files); static ZEND_FUNCTION(is_subclass_of); static ZEND_FUNCTION(get_class_vars); @@ -91,8 +90,8 @@ static zend_function_entry builtin_functions[] = { #ifdef ZEND_TEST_EXCEPTIONS ZEND_FE(crash, NULL) #endif - ZEND_FE(get_required_files, NULL) ZEND_FE(get_included_files, NULL) + ZEND_FALIAS(get_required_files, get_included_files, NULL) ZEND_FE(is_subclass_of, NULL) ZEND_FE(get_class_vars, NULL) ZEND_FE(get_object_vars, NULL) @@ -713,22 +712,6 @@ static int copy_import_use_file(zend_file_handle *fh, zval *array) } -/* {{{ proto array get_required_files(void) - Returns an array with the file names that were require_once()'d */ -ZEND_FUNCTION(get_required_files) -{ - CLS_FETCH(); - - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - array_init(return_value); - zend_hash_apply_with_argument(&CG(used_files), (apply_func_arg_t) copy_import_use_file, return_value); -} -/* }}} */ - - /* {{{ proto array get_included_files(void) Returns an array with the file names that were include_once()'d */ ZEND_FUNCTION(get_included_files) |