# [PATCH] Zend_API.c error message tweak

- Thread: https://externals.io/message/13680
- Original archive: https://news-web.php.net/php.internals/13680
- Started by Joe Orton on 2004-11-02T12:46:32+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #13680 — Joe Orton — 2004-11-02T12:46:32+00:00

URL: https://externals.io/message/13680#13680

HEAD/ext/spl is generating a warning at startup though it was hard to
work out which extension was to blame without the below patch!

PHP Warning: Function registration failed - duplicate name -
InfiniteIterator::next in Unknown on line 0

Index: Zend/zend_API.c
===================================================================
RCS file: /repository/ZendEngine2/zend_API.c,v
retrieving revision 1.268
diff -u -r1.268 zend_API.c
--- Zend/zend_API.c	29 Sep 2004 20:57:07 -0000	1.268
+++ Zend/zend_API.c	2 Nov 2004 12:42:41 -0000
@@ -1397,7 +1397,8 @@
 		}
 		while (ptr->fname) {
 			if (zend_hash_exists(target_function_table, ptr->fname, strlen(ptr->fname)+1)) {
-				zend_error(error_type, "Function registration failed - duplicate name - %s", ptr->fname);
+				zend_error(error_type, "Function registration failed - duplicate name - %s%s%s", 
+						   scope ? scope->name : "", scope ? "::" : "", ptr->fname);
 			}
 			ptr++;
 		}

---

## #13682 — Derick Rethans — 2004-11-02T12:56:03+00:00

URL: https://externals.io/message/13680#13682 · In reply to: #13680

> HEAD/ext/spl is generating a warning at startup though it was hard to
> work out which extension was to blame without the below patch!
>
> PHP Warning: Function registration failed - duplicate name -
> InfiniteIterator::next in Unknown on line 0

I'd say feel free to commit this, if you also adjust the test cases that
might now fail due to the changed error messages.

regards,
Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org

---

## #13684 — Joe Orton — 2004-11-02T13:02:52+00:00

URL: https://externals.io/message/13680#13684 · In reply to: #13682

> 
> 
> > […]
> 
> I'd say feel free to commit this, if you also adjust the test cases that
> might now fail due to the changed error messages.

I don't have commit access to Zend - and I can't find any test cases
which check for this error text.  The test suite is failing all over the
shop anyway because this error is printed on every invocation.

joe

---

## #13685 — Sebastian Bergmann — 2004-11-02T13:11:57+00:00

URL: https://externals.io/message/13680#13685 · In reply to: #13684

Joe Orton wrote:
> I don't have commit access to Zend

 I tested and committed it, will MFH to PHP_5_0 in a second.

-- 
Sebastian Bergmann                      http://www.sebastian-bergmann.de/
GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69
