Has anyone ever used the zend_compile_string() within the c code for compiling
internally created php? Is it frowned upon or has it never come up before?
In writing the accessors code I have several parts that are effectively just
mimicking what a simple zend_compile_string() would accomplish in a single
line. It may be just as efficient as writing the
zend_do_begin_variable_parse() ... etc lines myself but would have the added
benefit of changing as the language changed as well.
More specific example:
Automatic implementation for a getter, would be something like this:
public $a {
get; /* Equivalent to "return $this->__a */
set; /* Equivalent to "$this->__a = $value; */
}
I would simply CG(active_op_array) = zend_compile_string("return $this->__a;",
...);
Thoughts?
-Clint