[TYPO3-core] RFC #10454: t3lib_div::makeInstanceClassName() allows to bypass checks for t3lib_Singleton

Ingo Renner ingo at typo3.org
Thu Feb 19 13:30:59 CET 2009


Jeff Segars wrote:

Hi Jeff,

>> well to me this particular exception is pretty clear: language 
>> actually doesn't have a constructor - at least not an explicit one...
>>
>> If the message solely resulted from that, than I think it's ok. Could 
>> you test it with a different class again, a class that has a 
>> constructor, but doesn't expect arguments...
> 
> I agree the message is clear; my only (very small) problem is that it 
> differs from happens with the when I create an object directly with 
> "new" and do not get a fatal error.
> 
> After some more testing, the fatal error only occurs when there's not a 
> constructor at all.  If there is a constructor with no arguments but 
> arguments are unexpectedly passed to the constructor, it works fine.

So this is a rather rare case as it seems to me. As 
t3lib_div::makeInstance() is a quit central method and Reflection isn't 
the fastest I'd like to suggest to ignore these cases for now. We can 
(and of course should) address this issue when it really becomes an 
often occuring error. I'd also argue that this is a bug with reflection 
if the behavior is different from just using new.

I'll attach your patch to the BT issue, so that it doesn't get lost in 
case we need it.


all the best
Ingo

-- 
Ingo Renner
TYPO3 Core Developer, Release Manager TYPO3 4.2


More information about the TYPO3-team-core mailing list