Re: [PHP-DEV] PHP Object-Caching and Reference Counting

2007-01-22 Thread Stanislav Malyshev
I am not familiar with the term: "zval"...My understanding of php comes from extensive usage...Can you give me a specific example? OK, sorry, got a bit into engine-speak, basically zval is the internal representation of a variable, more or less, though $foo and $bar can be linked to the same z

Re: [PHP-DEV] PHP Object-Caching and Reference Counting

2007-01-22 Thread Arnold Daniels
Hi, To get an understanding of zval's and php internal basics, I recommend you read the following tutorials: http://devzone.zend.com/node/view/id/1021 - Part I: Introduction to PHP and Zend http://devzone.zend.com/node/view/id/1022 - Part II: Parameters, Arrays, and ZVALs http://devzone.zend

Re: [PHP-DEV] PHP Object-Caching and Reference Counting

2007-01-22 Thread Lars Schultz
That's correct. However, it is not guaranteed that your unset would delete last reference - there can be references on stack, in temp variables in current expressions being calculated (function call could happen in mid-expression), etc. Of course, it might be that your code is very controlled

Re: [PHP-DEV] PHP Object-Caching and Reference Counting

2007-01-21 Thread Paweł Stradomski
On 21 jan 2007 Lars Schultz wrote: > >Perhaps you could use your own reference counting? > >Keep your "real" objects in private array and instead of returning them > > return a simple object which would forward all methods and properties by > > __get/__set/__call. The constructor would increase you

Re: [PHP-DEV] PHP Object-Caching and Reference Counting

2007-01-21 Thread Lars Schultz
Note that the engine does not guarantee you any particular value of the refcount. Passing parameters around, accessing variables, etc. may change the refcount. One thing the engine guarantees you is that once no links to the variable exist it would be destroyed (which may not happen immediate

Re: [PHP-DEV] PHP Object-Caching and Reference Counting

2007-01-21 Thread Lars Schultz
Perhaps you could use your own reference counting? Keep your "real" objects in private array and instead of returning them return a simple object which would forward all methods and properties by __get/__set/__call. The constructor would increase your internal refcount by one, destructor woul

Re: [PHP-DEV] PHP Object-Caching and Reference Counting

2007-01-19 Thread Paweł Stradomski
Lars Schultz wrote: > I know that a lot of you may say: Why do need to do that?...and I'd have > to think for 3 days and then write for 4 days and would give up. It > seems like a nice solution to me and if any of you have an idea as to > how I could implement this differently, please feel free to

Re: [PHP-DEV] PHP Object-Caching and Reference Counting

2007-01-19 Thread Stanislav Malyshev
As you can see I boldly used the function reference_count(Object) even though it doesn't exist. This is exactly what I'd need to allow my concept to work. I keep thinking of any other solutions, but up until now, I didn't find any better solution for this problem. Of course I can Note that th

[PHP-DEV] PHP Object-Caching and Reference Counting

2007-01-19 Thread Lars Schultz
Hello there... I am making my debut appearance here hoping that I am not giving offense to anyones well honed php-instincts or programming practices with my feature-request. This is what it comes down to, I guess. A Feature Request for some meta-info on the instantiated PHP-Objects. Specifical