On Thu, Aug 25, 2011 at 11:46 AM, Sebastian Bergmann sebast...@php.net wrote:
I have attached a patch to https://bugs.php.net/bug.php?id=55490 that
implements ReflectionClass::newInstanceWithoutConstructor() to create an
object a class without invoking the constructor.
As there are
Am 26.08.2011 09:51, schrieb Ferenc Kovacs:
would this method give the same result as
unserialize(O:8:\stdClass\:0:{}) for example?
That is the whole point of it, yes.
--
Sebastian BergmannCo-Founder and Principal Consultant
http://sebastian-bergmann.de/
I have attached a patch to https://bugs.php.net/bug.php?id=55490 that
implements ReflectionClass::newInstanceWithoutConstructor() to create an
object a class without invoking the constructor.
As there are certain internal classes that would crash when their
constructor is not invoked, this
hi,
On Thu, Aug 25, 2011 at 11:46 AM, Sebastian Bergmann sebast...@php.net wrote:
I have attached a patch to https://bugs.php.net/bug.php?id=55490 that
implements ReflectionClass::newInstanceWithoutConstructor() to create an
object a class without invoking the constructor.
As there are
On Thu, 25 Aug 2011 10:46:21 +0100, Sebastian Bergmann sebast...@php.net
wrote:
I have attached a patch to https://bugs.php.net/bug.php?id=55490 that
implements ReflectionClass::newInstanceWithoutConstructor() to create
an
object a class without invoking the constructor.
As there
2011/8/25 Sebastian Bergmann sebast...@php.net:
I have attached a patch to https://bugs.php.net/bug.php?id=55490 that
implements ReflectionClass::newInstanceWithoutConstructor() to create an
object a class without invoking the constructor.
As there are certain internal classes that would
On 25 August 2011 10:46, Sebastian Bergmann sebast...@php.net wrote:
I have attached a patch to https://bugs.php.net/bug.php?id=55490 that
implements ReflectionClass::newInstanceWithoutConstructor() to create an
object a class without invoking the constructor.
As there are certain
On 08/25/2011 02:26 PM, Richard Quadling wrote:
Wouldn't ReflectionClass::newMockInstance() be a better name?
It is not specific to stubbing/mocking.
What other use cases exists?
ORM and stubbing/mocking should be enough.
--
Sebastian BergmannCo-Founder and Principal
Hi,
On Thu, Aug 25, 2011 at 11:46, Sebastian Bergmann sebast...@php.net wrote:
I have attached a patch to https://bugs.php.net/bug.php?id=55490 that
implements ReflectionClass::newInstanceWithoutConstructor() to create an
object a class without invoking the constructor.
To me this feature
On 08/25/2011 01:46 PM, Gustavo Lopes wrote:
What about userland classes that extend internal classes?
Good point. How would I implement such a check?
--
Sebastian BergmannCo-Founder and Principal Consultant
http://sebastian-bergmann.de/
On 08/25/2011 02:39 PM, Etienne Kneuss wrote:
To me this feature makes no sense. But if people find use for it and
it remains in Reflection, I won't object to it, so +0.
It should only be used for meta programming, of course ;-)
If an internal class can't behave well without a constructor
Hi
2011/8/25 Sebastian Bergmann sebast...@php.net:
Good point. How would I implement such a check?
Speaking of which, wouldn't it be easier to check all our internal
classes for such failures and fix them accordingly with this addition
(Fix the dont-crash-without-calling-constructor)?
We
On 08/25/2011 02:47 PM, Kalle Sommer Nielsen wrote:
Speaking of which, wouldn't it be easier to check all our internal
classes for such failures and fix them accordingly with this addition
(Fix the dont-crash-without-calling-constructor)?
We could do like that of above and cast an exception
Hi,
On Thu, Aug 25, 2011 at 14:43, Sebastian Bergmann sebast...@php.net wrote:
On 08/25/2011 02:39 PM, Etienne Kneuss wrote:
To me this feature makes no sense. But if people find use for it and
it remains in Reflection, I won't object to it, so +0.
It should only be used for meta
On Thu, Aug 25, 2011 at 2:41 PM, Sebastian Bergmann sebast...@php.net wrote:
On 08/25/2011 01:46 PM, Gustavo Lopes wrote:
What about userland classes that extend internal classes?
Good point. How would I implement such a check?
Checking the same thing than what instanceof does
Cheers,
--
Hi,
On Thu, Aug 25, 2011 at 14:49, Sebastian Bergmann sebast...@php.net wrote:
On 08/25/2011 02:47 PM, Kalle Sommer Nielsen wrote:
Speaking of which, wouldn't it be easier to check all our internal
classes for such failures and fix them accordingly with this addition
(Fix the
On Thu, Aug 25, 2011 at 14:54, Etienne Kneuss col...@php.net wrote:
Hi,
On Thu, Aug 25, 2011 at 14:49, Sebastian Bergmann sebast...@php.net wrote:
On 08/25/2011 02:47 PM, Kalle Sommer Nielsen wrote:
Speaking of which, wouldn't it be easier to check all our internal
classes for such failures
On Thu, 25 Aug 2011 13:41:27 +0100, Sebastian Bergmann sebast...@php.net
wrote:
On 08/25/2011 01:46 PM, Gustavo Lopes wrote:
What about userland classes that extend internal classes?
Good point. How would I implement such a check?
You could fetch the parent and do the same check, and
On 08/25/2011 02:54 PM, Gustavo Lopes wrote:
You could fetch the parent and do the same check, and so on. I think you
might be able to just check whether ce.create_object is not NULL, because
if the internal class doesn't replace create_object, there's no chance of
that class of crashes
Thanks for working on this Sebastian, its really appreciated! +1 from me!
On Thu, Aug 25, 2011 at 3:27 PM, Sebastian Bergmann sebast...@php.netwrote:
On 08/25/2011 02:54 PM, Gustavo Lopes wrote:
You could fetch the parent and do the same check, and so on. I think you
might be able to just
Sebastian,
This is a hidden gem for us! =D
Thanks a lot for putting your effort into this.
Cheers,
On Thu, Aug 25, 2011 at 11:03 AM, Benjamin Eberlei kont...@beberlei.de wrote:
Thanks for working on this Sebastian, its really appreciated! +1 from me!
On Thu, Aug 25, 2011 at 3:27 PM,
2011/8/25 Gustavo Lopes glo...@nebm.ist.utl.pt:
You could fetch the parent and do the same check, and so on.
Checking only the topmost should be enough if traversing the whole
inheritance could be avoided.
I think you
might be able to just check whether ce.create_object is not NULL, because
2011/8/25 Patrick ALLAERT patrickalla...@php.net:
2011/8/25 Gustavo Lopes glo...@nebm.ist.utl.pt:
You could fetch the parent and do the same check, and so on.
Checking only the topmost should be enough if traversing the whole
inheritance could be avoided.
Well, of course I highly second the
23 matches
Mail list logo