Page 2 of 2

Posted: Mon Nov 01, 2004 3:54 pm
by andre_c
The problem with that is that the class must be already instantiated in order to do that.
You could do something like:

Code: Select all

<?
function & create() {
  $class_name = __CLASS__;
  return new $class_name;
}
?>
but it would only work if this is define on the subclass that you are instantiating

Posted: Mon Nov 01, 2004 4:49 pm
by LostMyLove
what the "new" does?

Posted: Mon Nov 01, 2004 4:51 pm
by patrikG
it instantiates a class.