Anyone seen an Inline::C implementation in php
| From: | George Schlossnagle | Date: | Wed, 18 Sep 2002 22:40:25 +0000 |
| Subject: | Anyone seen an Inline::C implementation in php | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-9184@lists.php.net to get a copy of this message | ||
I'm considering implementing something like perl's Inline::C in php, but I want to avoid re-inventing the wheel. Anyone see anything thike this? Basically the goal would be able to write something like:
<?pseudocode
$function_def = <<<EOF
php_function(times){
int i,j; return if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &i,&j) = FAILURE)
RETURN_LONG(i*j);
}
EOF
Inline_C($function_def);
times(2,2);
?>
Inline_C would take the block of code, wrap it in module glue, compile it, cache the binary somewhere, the call dl() on it.
Anyone seen anything like this for php?