Re: [RFC] Factory for Stream Wrappers
| From: | Gustavo Lopes | Date: | Mon, 12 Sep 2011 13:43:33 +0000 |
| Subject: | Re: [RFC] Factory for Stream Wrappers | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-55385@lists.php.net to get a copy of this message | ||
Em Mon, 12 Sep 2011 12:53:13 +0100, Sebastian Bergmann <sebastian@php.net> escreveu:
Regarding state it is important to notice that PHP does *not* execute the constructor on all low level calls when instantiating the wrapper class - for whatever reason that is the case. Changing that behaviour would cause quite some side effects, with possible quite some BC breaks.This is a bit off-topic, but could you elaborate on this (possibly submitting a bug report)? I see user_wrapper_opener trying to call the constructor: http://lxr.php.net/opengrok/xref/PHP_5_3/main/streams/userspace.c#298 So any failure to do this would be a bug. BTW, another advantage of the proposed change is that you can have stream wrappers with constructors that take arguments. For the record, I'm in favor of this, even though I don't buy the testability claim. My point yesterday was mainly the RFC did not explain the advantages very clearly. -- Gustavo Lopes