Using CG(class_table) vs. EG(class_table)
| From: | Andrei Zmievski | Date: | Wed, 02 Apr 2003 20:30:15 +0000 |
| Subject: | Using CG(class_table) vs. EG(class_table) | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-615@lists.php.net to get a copy of this message | ||
On Wed, 02 Apr 2003, Andrei Zmievski wrote:
> + if (EG(active_namespace) != ns) {
> + orig_namespace = EG(active_namespace);
> + EG(active_namespace) = ns;
> + CG(class_table) = &ns->class_table;
> + }
> + register_class = zend_register_internal_class_ex(class_entry, parent_ce, NULL TSRMLS_CC);
> + if (orig_namespace) {
> + EG(active_namespace) = orig_namespace;
> + CG(class_table) = &orig_namespace->class_table;
This piece of code was necessary because zend_register_class() uses
CG(class_table) to register the class in. Why are we not using
EG(class_table) instead? It would be more logical, and also make the
code cleaner - just use zend_switch_namespace().
-Andrei http://www.gravitonic.com/
* Reality isn't all it's cracked up to be. *