one can init an empty array in class in php like this:
class Foo
{
protected $bar = [];
}
but how can I do this in extension developed with c?
notice that the $bar property is not initialized in constructor.
I've already tried the zend_declare_property function, but I get this error:
Fatal error: Internal zval's can't be arrays, objects or resources in Unknown on line 0
PS: [] is the shortcut for array() in php5.4, and my question is about writing php extension (with c), not about php itself. I know my english is not good enough but if something I've written is hard to understand, please let me know.