Mantis - Quercus
Viewing Issue Advanced Details
1773 minor always 05-31-07 17:30 06-07-07 05:17
nam  
nam  
normal  
closed 3.1.1  
fixed  
none    
none 3.1.2  
0001773: Exceptions should be thrown for accessing members from static context
(rep by U. Wohlfeil)

Case 1:
//Code
class bar
{
private $value="test";
public static function get()
{
//access attribute from static context
return $this->value;
}
}
bar::get();

Does not throw any exception like expected.

----

Case 2:
//Code
class bar
{
private $instance=null;

private function __construct(){}

public static function get()
{
if(!$this->instance)
$this->instance=new bar();
return $this->instance;
}
}
echo get_class(bar::get())

Notes
(0002023)
nam   
06-07-07 05:17   
php/096h
php/396h