Re: Code References
| From: | George Schlossnagle | Date: | Mon, 19 May 2003 15:22:23 +0000 |
| Subject: | Re: Code References | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-1716@lists.php.net to get a copy of this message | ||
On Monday, May 19, 2003, at 11:13 AM, Zeev Suraski wrote:
At 16:41 19/05/2003, Sterling Hughes wrote:I'm on neither side of this, but the create funciton code certainly looks like it does an eval:Well, its much more than a lookup, its an eval.No it isn't. It's a lookup.
eval_code_length = sizeof("function " LAMBDA_TEMP_FUNCNAME)
+Z_STRLEN_PP(z_function_args)
+2 /* for the args parentheses */
+2 /* for the curly braces */
+Z_STRLEN_PP(z_function_code);
eval_code = (char *) emalloc(eval_code_length);
sprintf(eval_code, "function " LAMBDA_TEMP_FUNCNAME "(%s){%s}", Z_STRVAL_PP(z_function_args), Z_STRVAL_PP(z_function_code));
eval_name = zend_make_compiled_string_description("runtime-created function" TSRMLS_CC);
retval = zend_eval_string(eval_code, NULL, eval_name TSRMLS_CC);