will this work for variables as well?
it would be great, if the following worked:
<?php
class A {
protected static $table = "table";
public static function connect(){
//do some stuff here
echo static::$table;
return static::getInstance(); //function getInstance() now can return classes A or B depending on the context it was called
}
...
}
class B extends A {
protected static $table = "subtable";
...
}
$table = B::connect(); //hopefully the output will be: subtable
?>