Re: [PHP-DEV] Grafts, Traits, horizontal reuse

2008-11-26 Thread Alan Pinstein
On Nov 24, 2008, at 9:27 PM, Christopher Vogt wrote: Interfaces are helpful in combination with type hinting, but for people who prefer duck typing, it is reasonable to not explicitly define them. It sounds like you are saying that if you prefer duck typing then interfaces have no use. I

Re: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP

2008-11-11 Thread Alan Pinstein
ith the "use" keyword, but something like: use HelloworldExtras; Would be a lightweight way to make sure that the autoloader would add the category into the runtime. Looking forward to your comments. Also, I will be at php|works in Atlanta Thursday and Friday if anyone is

Re: [PHP-DEV] 16-bit reference count in PHP 4's zval

2006-01-09 Thread Alan Pinstein
It seems that the problem you're encountering could be fixed trivially by moving the initialization of $stuff into the constructor. However, it's difficult to tell from the provided code whether $stuff is intended as a static member... but if it's not, seems like a very simple fix... I d

Re: [PHP-DEV] debugging APC - bit over my head; clue desired

2006-01-06 Thread Alan Pinstein
Yes, I'd be interested in this, too. I filed a bug report for a segfault under similar conditions and I'd be happy to help find the bug if I had any idea how to help... Alan On Jan 5, 2006, at 7:44 AM, Jochem Maas wrote: Rasmus, I have a quick question which if you are able to give an ans

Re: [PHP-DEV] exceptions in the destructor

2005-12-20 Thread Alan Pinstein
I also would like someone to tell me why exceptions cannot be called in the destructor? Since they can't, this means the reliability of a destructor is uncontrolled and nothing can be done to see if this completes successfully. Your question is kindof wrong... you can always throw exception

Re: [PHP-DEV] exceptions in the destructor

2005-12-20 Thread Alan Pinstein
Your last post also indicates, that because the destructors are only called after script termination, the scope of an object is global, always. Is this true? This isn't true, at least empirically. Destructors are called when the GC frees the object. For many objects, this is at script term

Re: [PHP-DEV] $this->this and avoiding circular references

2005-12-10 Thread Alan Pinstein
e indirect) but also for arrays. This is a side-effect of reference counting systems, but within the way PHP is used within a request/response paradigm, it shouldn't be a real limiting factor in real-life usage. On the contrary, for these kind of apps, garbage collecting systems have potential to

Re: [PHP-DEV] $this->this and avoiding circular references

2005-12-09 Thread Alan Pinstein
regarding the actually topic of this thread I'm very interested in the concept of 'weak references' (as Apple seems to call them), what '$this->this' is all about, and whether using reference notation with object variable assignment is even allowed, whether it it makes a difference and what the fu

Re: [PHP-DEV] $this->this and avoiding circular references

2005-12-08 Thread Alan Pinstein
by using the indirect property access. Might not be perfect but it's quite doable. Awesome! Could you tell me what "indirect property access" is? I googled for it but there's nothing... Thanks, Alan Andi At 09:21 PM 12/8/2005, Alan Pinstein wrote: Generally speaking

Re: [PHP-DEV] $this->this and avoiding circular references

2005-12-08 Thread Alan Pinstein
Generally speaking, if you create a circular reference (whether by reference or by value), then you will have a "memory leak" until the end of the request. This is not only true for objects (and circular references might be indirect) but also for arrays. sure, of course... This is a side-e

Re: [PHP-DEV] $this->this and avoiding circular references

2005-12-07 Thread Alan Pinstein
ipulating $this; that is, creating weak references. Alan On Dec 7, 2005, at 11:27 AM, Antony Dovgal wrote: On 07.12.2005 18:40, Alan Pinstein wrote: Hi all- Please use php-general@lists.php.net for questions regarding development *in* PHP. -- Wbr, Antony Dovgal -- PHP Intern

Re: [PHP-DEV] $this->this and avoiding circular references

2005-12-07 Thread Alan Pinstein
om/ASPN/Mail/Message/php-Dev/1555640 Plus, this is kind of an *internals* question because the topic not documented publicly and it has to do with things that are opaque to userland like refcounts and how "$this" works. Alan On Dec 7, 2005, at 11:27 AM, Antony Dovgal wrote: On

Re: [PHP-DEV] $this->this and avoiding circular references

2005-12-07 Thread Alan Pinstein
are you using ph4 or php5? PHP5 are you setting $this->this yourself or 'is it just there'? No, I'm not setting it, just reading it (see addChildObject() code below), if that's what you mean. -Alan Alan Pinstein wrote: Hi all- I've been trying to avoid

[PHP-DEV] $this->this and avoiding circular references

2005-12-07 Thread Alan Pinstein
Hi all- I've been trying to avoid circular references in some data import scripts and finally figured out how to do it. However, I wanted to ask you guys to make sure that what I'm doing is something that's legit and can be relied on into the future. Also, please note that I tried searchi