Hi,
I have got three questions:
first:
how to access a uninstanciated (abstract) class (I´m using php 5 rc1) if the classname is beeing hold in a string variable?
class foo
{
public static $INT_Count=999;
}
$x="foo";
echo "INT_Count is ".$x::$INT_Count;//trying to access $INT_Count in foo doesn´t work
Is this already implemented? Are there any reasons not to implement it?
My seconds question is if you guys know an article about classes in php where the pros and cons
of instanciating(foo=new bar()) or not instanciating a class(foo::bar()) are beeing discussed?
Third:
This is my current class hierarchitecture:
abstract class core //loads all other classes in it´s own scope
{
public function Init($STR_File) {...} //Includes php file which loads the classes below
abstract class filesystem //which may extend other related classes
abstract class database //which may extend other related classes
abstract class login //which may extend other related classes
abstract class session //which may extend other related classes
[...]
}
core::Init("batch/normal.inc.php");
Currently all classes are abstract and accessed via the :: operator.
Is this bad coding? Are there any reasons to make an instance of the core class?
Instanciating needs more memory and consumes more cpu, is this correct?
So if I don´t need multiple instances of an object, I really don´t need one instance at all, right?
How would you do it-what´s the common way of doing it "right"?
Thank you