diff options
| author | Andi Gutmans <andi@php.net> | 2001-12-27 12:23:03 +0000 |
|---|---|---|
| committer | Andi Gutmans <andi@php.net> | 2001-12-27 12:23:03 +0000 |
| commit | a5f7a383bf001d373b8733e76883f8152d3ecc0f (patch) | |
| tree | 8a29c38833119bd89d3addc82c66638a39571b0f /Zend/zend_compile.c | |
| parent | bc7bc41e6f97563df78cc724bbdaab403ea295b5 (diff) | |
| download | php-git-a5f7a383bf001d373b8733e76883f8152d3ecc0f.tar.gz | |
- Support unified constructor name _construct()
Diffstat (limited to 'Zend/zend_compile.c')
| -rw-r--r-- | Zend/zend_compile.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index d9aeb00c17..8cdf8cb93a 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -761,6 +761,8 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n zend_hash_update(&CG(active_class_entry)->function_table, name, name_len+1, &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array)); if ((CG(active_class_entry)->name_length == (uint) name_len) && (!memcmp(CG(active_class_entry)->name, name, name_len))) { CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array); + } else if ((function_name->u.constant.value.str.len == sizeof("_construct")-1) && (!memcmp(function_name->u.constant.value.str.val, "_construct", sizeof("_clone")))) { + CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array); } else if ((function_name->u.constant.value.str.len == sizeof("_clone")-1) && (!memcmp(function_name->u.constant.value.str.val, "_clone", sizeof("_clone")))) { CG(active_class_entry)->clone = (zend_function *) CG(active_op_array); } |
