CVS update: php3
| From: | zeev | Date: | Wed, 07 Oct 1998 19:41:13 +0000 |
| Subject: | CVS update: php3 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-1722@lists.php.net to get a copy of this message | ||
Date: Wednesday October 7, 1998 @ 15:41
Author: zeev
Update of /repository/php3
In directory asf:/u2/tmp/cvs-serv6778
Modified Files:
control_structures_inline.h
Log Message:
Inherit the parent's constructor.
Index: php3/control_structures_inline.h
diff -c php3/control_structures_inline.h:1.190 php3/control_structures_inline.h:1.191
*** php3/control_structures_inline.h:1.190 Sun Oct 4 08:26:59 1998
--- php3/control_structures_inline.h Wed Oct 7 15:41:12 1998
***************
*** 29,35 ****
*/
! /* $Id: control_structures_inline.h,v 1.190 1998/10/04 12:26:59 zeev Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
--- 29,35 ----
*/
! /* $Id: control_structures_inline.h,v 1.191 1998/10/07 19:41:12 zeev Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
***************
*** 1070,1081 ****
--- 1070,1091 ----
php3_error(E_ERROR,"%s is already a function or class",classname->value.str.val);
}
if (parent) { /* inheritance */
+ pval *ctor_ptr, ctor;
+
if (_php3_hash_find(&GLOBAL(function_table), parent->value.str.val,
parent->value.str.len+1, (void **) &parent_ptr) == FAILURE) {
php3_error(E_ERROR, "Cannot extend non existant class %s",
parent->value.str.val);
return;
}
new_class = *parent_ptr;
pval_copy_constructor(&new_class);
+
+ if (_php3_hash_find(new_class.value.ht, parent->value.str.val, parent->value.str.len+1,
(void **) &ctor_ptr)==SUCCESS) {
+ ctor = *ctor_ptr;
+ pval_copy_constructor(&ctor);
+ _php3_hash_update(new_class.value.ht, classname->value.str.val,
classname->value.str.len+1, &ctor, sizeof(pval), NULL);
+ _php3_hash_del(new_class.value.ht, parent->value.str.val, parent->value.str.len+1);
+ }
+
} else {
new_class.type = IS_CLASS;
new_class.value.ht = (HashTable *) emalloc(sizeof(HashTable));
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net