Re: ReflectionClass::newInstanceWithoutConstructor()

From: Date: Thu, 25 Aug 2011 12:49:03 +0000
Subject: Re: ReflectionClass::newInstanceWithoutConstructor()
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-54937@lists.php.net to get a copy of this message
Hi, On Thu, Aug 25, 2011 at 14:43, Sebastian Bergmann <sebastian@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 programming, of course ;-) > >> If an internal class can't behave well without a constructor call, >> that should already be fixed/prevented, as it's already possible by >> extending it. > >  I second that emotion but as long as those internal classes are not >  fixed I think it makes sense to disallow creating objects of internal >  classes without invoking their constructor. It is already possible to do that currently, with or without this feature, so you're not preventing much abuse by doing that here. As I said, artificial distinction. This feature however alters the necessary checks for missing constructor calls (at least the ones implemented in SPL as of 5.4), as those assume a userland subclass. > > -- > Sebastian Bergmann                    Co-Founder and Principal Consultant > http://sebastian-bergmann.de/                       >     http://thePHP.cc/ > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Etienne Kneuss http://www.colder.ch

« previous php.internals (#54937) next »