i would like to access an variable, which is in an class (not as an instance of an class) For example
class myclas
{
private $list=array(\'1\',\'2\',\'3\');
[...
It's a private variable. If you made it a public static variable you should be able to access it:
class myclas {
public static $list = array('1','2','3');
}
myclas::$list;
See this beautiful guide: http://php.net/manual/en/language.variables.scope.php
For your edit, see this other beatiful guide about classes and visibility:
http://www.php.net/manual/en/language.oop5.visibility.php
class myclas
{
public static $list=array('1','2','3');
}
myClass::$list;
It needs to be declared as static.
Example:
class MyClass {
public static $var = 'foo';
}
Then to access: MyClass::$var;