Show
Ignore:
Timestamp:
09/15/06 17:01:01 (2 years ago)
Author:
bart
Message:

Only put the function that has the same name as the class as contructor

if there isn't a construct function. This fixes ticket #172

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/branches/0.9.5/ea_restore.c

    r270 r271  
    759759        Bucket *p = to->function_table.pListHead; 
    760760 
     761    to->constructor = NULL; 
     762 
    761763        while (p != NULL) { 
    762764                f = p->pData; 
     
    764766                fname_lc = zend_str_tolower_dup(f->common.function_name, fname_len); 
    765767                 
    766                 if (fname_len == cname_len && !memcmp(fname_lc, cname_lc, fname_len) && f->common.scope != to->parent) { 
     768        /* only put the function that has the same name as the class as contructor if there isn't a __construct function */ 
     769                if (fname_len == cname_len && !memcmp(fname_lc, cname_lc, fname_len) && f->common.scope != to->parent 
     770                && to->constructor == NULL) { 
    767771                        to->constructor = f; 
    768772                } else if (fname_lc[0] == '_' && fname_lc[1] == '_' && f->common.scope != to->parent) {