On Tue, May 1, 2012 at 8:46 PM, Yader Hernandez <yader.hernan...@gmail.com>wrote:
> Hello, > > I was wondering how to create a new object from a function call? > > By this I mean if I call foo() from a script, that should return a new > instance of an object. If I call foo() again, it should be a new instance > of an object as well. > > I haven't been able to find any good examples from the code I've been > reading. > > Does anyone know of a good place to find an example? > > thanks > To be a little clearer I mean that in my extension, I can call my custom object. So any calls from a script will be able to do $o = new Foo(). I registered my struct in zend_objects_store_put, so I understand how the instantiate is happening. But now I'm implementing a ZEND_METHOD that requires a new instance of Foo and I've been stuck for a few days trying to find a nice clean example. I was wondering if someone knew of a good place look into? thanks