On Oct 3, 2006, at 12:09 AM, Gavin Vess wrote:
In conclusion, no one has yet proposed a solution that fits the
ideal above. I've summarized various syntactical ways of working
with factories in PHP:
http://framework.zend.com/wiki/display/ZFDEV/Factories
<rant>
Whoever suggested this particular tidbit ...
for ($i = 0; $i < $argsCount; $i++) {
$argsString .= ($comma ? ', ' : '') . "\$args[$i]";
$comma = true;
}
return eval("return new $className($argsString);");
... should feel embarrassed for even daring to suggest it as anything
other than as something to avoid at all costs.
My brain tried to pull my eyes out of their sockets and up into my
skull to keep me from having to look at it; it's that bad.
</rant>
-- pmj