Hello Jason,
new doesn't expect a string which a constant in fact is. It expects a
class name. Thus the class name cannot be constified. You'd need to use
reflection for that:
$r = new ReflectionClass($name); $o = $r->newInstance();
best regards
marcus
Monday, September 19, 2005, 6:58:31 PM, you wrote:
> On 9/19/05, Xuefer <xuefer@gmail.com> wrote:
>> wrong list. :)
> My question was not "how do I work around this?". I included that in
> my original post. My question was "why is it like this?" which I
> thought was more germane to the internals list.
> An unquoted string would have to first be thought of as the class
> name, but if that does not exist, php is not then checking to see if
> it is actually a defined constant.
> My questions was basically is this a performance issue or just an
> undesired behavior for some other reason?
>
> Regards,
> Jason
> http://blog.casey-sweat.us/
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
Best regards,
Marcus