New zend_compile.c to solve all of the duplicate function problems
| From: | Brian Moon | Date: | Thu, 18 Oct 2001 14:49:21 +0000 |
| Subject: | New zend_compile.c to solve all of the duplicate function problems | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-68234@lists.php.net to get a copy of this message | ||
Ok,
I played with the code in zend_compile.c last night and came up with this
solution. The attached file will only issue a NOTICE for duplicate
functions from the same line and file. It will still issue an ERROR for
duplicate functions of a different file or line number. In either case,
zend_hash_add is never called because zend_hash_find is called first.
Therefore the function is never added to the hash table and the first
version of the function is what is used.
I tested this code against the old with a file with 100000 functions in it.
There is no noticeable speed difference.
I think this may solve all of the problems.
Brian Moon
------------------------------------------
dealnews.com, Inc.
Makers of dealnews & dealmac
http://dealnews.com/ | http://dealmac.com/
Attachment: [application/octet-stream] zend_compile.c
Attachment: [application/octet-stream] zend_compile.c