summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2001-09-24 18:26:04 +0000
committerAndi Gutmans <andi@php.net>2001-09-24 18:26:04 +0000
commitda339a6eae2e7faa44abc512d0f1be5dc897dba5 (patch)
treeea87ec21b9c5b91962aa9024e15a1953ecdde9b0
parent892f61f1ff0417a7b87b9345359464e36515518e (diff)
downloadphp-git-da339a6eae2e7faa44abc512d0f1be5dc897dba5.tar.gz
- More namespaces work
-rw-r--r--Zend/zend_execute.c12
-rw-r--r--Zend/zend_execute_API.c1
-rw-r--r--Zend/zend_globals.h4
3 files changed, 13 insertions, 4 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 010d181ca4..c2161d4e57 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1758,8 +1758,16 @@ do_fcall_common:
EG(exception) = NULL;
NEXT_OPCODE();
case ZEND_NAMESPACE:
- fprintf(stderr, "Namespace '%s'\n", opline->op1.u.constant.value.str.val);
- NEXT_OPCODE();
+ {
+ Namespace *namespace_ptr;
+
+ if (zend_hash_find(EG(namespaces), opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len + 1, (void **) &namespace_ptr) == FAILURE) {
+ zend_error(E_ERROR, "Internal namespaces error. Please report this!");
+ }
+ EG(function_table) = namespace_ptr->function_table;
+ EG(class_table) = namespace_ptr->class_table;
+ NEXT_OPCODE();
+ }
case ZEND_SEND_VAL:
if (opline->extended_value==ZEND_DO_FCALL_BY_NAME
&& ARG_SHOULD_BE_SENT_BY_REF(opline->op2.u.opline_num, fbc, fbc->common.arg_types)) {
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index abacd87026..2c541d9227 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -129,6 +129,7 @@ void init_executor(TSRMLS_D)
EG(function_table) = CG(function_table);
EG(class_table) = CG(class_table);
+ EG(namespaces) = CG(namespaces);
EG(in_execution) = 0;
diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h
index e5148b7a8f..71161e6218 100644
--- a/Zend/zend_globals.h
+++ b/Zend/zend_globals.h
@@ -87,6 +87,7 @@ struct _zend_compiler_globals {
HashTable *function_table; /* function symbol table */
HashTable *class_table; /* class table */
+ HashTable *namespaces;
HashTable filenames_table;
@@ -119,8 +120,6 @@ struct _zend_compiler_globals {
char *namespace;
int namespace_len;
-
- HashTable *namespaces;
};
@@ -159,6 +158,7 @@ struct _zend_executor_globals {
HashTable *function_table; /* function symbol table */
HashTable *class_table; /* class table */
HashTable *zend_constants; /* constants table */
+ HashTable *namespaces;
long precision;