note 33628 rejected from zend.creating by vrana

From: Date: Tue, 15 Mar 2005 10:09:14 +0000
Subject: note 33628 rejected from zend.creating by vrana
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-86461@lists.php.net to get a copy of this message
Note Submitter: Carl ---- I had some problems with "undefined function". Fatal error: Call to undefined function: csgetmap() while trying to access by ZEND FUNCTION csGetMap I the problem fixed it by making ALL FUNCTIONS LOWER CASE. eg: [SNIP------------------------------------------] /* include standard header */ #include "php.h" /* declaration of functions to be exported */ ZEND_FUNCTION(first_module); ZEND_FUNCTION(cs_get_map); ZEND_FUNCTION(cs_get_stats); /* compiled function list so Zend knows what's in this module */ zend_function_entry coreSO_functions[] = { ZEND_FE(first_module, NULL) ZEND_FE(cs_get_map, NULL) ZEND_FE(cs_get_stats, NULL) {NULL, NULL, NULL} }; /* compiled module information */ zend_module_entry coreSO_module_entry = { STANDARD_MODULE_HEADER, "First Module", coreSO_functions, NULL, NULL, NULL, NULL, NULL, NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; /* implement standard "stub" routine to introduce ourselves to Zend */ #if COMPILE_DL_FIRST_MODULE ZEND_GET_MODULE(coreSO) #endif /* implement function that is meant to be made available to PHP */ ZEND_FUNCTION(first_module) { long parameter; if (zend_parse_parameters (ZEND_NUM_ARGS() TSRMLS_CC, "l", &parameter) == FAILURE) return; RETURN_LONG(parameter); } ZEND_FUNCTION(cs_get_map) { /* my code */ . . . } ZEND_FUNCTION(cs_get_stats) { /* my other code */ . . . } [/SNIP---------------------------------------------] Like I said, I tried before with function names like this: csGetMap cdGetStats It didnt work until I made them lower case. (Note - I added the underscores to the names to aid readability after I deleted the capital letters from the function names) Something to do with zend internals. Its probably documented somewhere but I couldnt easily find it. Its just the sort of "gotcha" that I thought would be useful in this forum. I hope that saved someone some trouble. ;)

« previous php.notes (#86461) next »