PHP creating static variables via static function in same class?

Martin

New member
Here's my code:
<?php

class vars
{
private static $javascript = null;
private static $style = null;
private static $content = array();
private static $dummy = 'dum';
public static function out ($var)
{
return self::$$var;
}
public static function in ($var, $value)
{
self::$$var = $value;
}
}

?>

echo vars::out('dummy'); //dum
vars::in('dummy2', 'qwerty');//Fatal error
echo vars::out('dummy2');

echo vars::out('dummy'); //dum
vars::in('dummy', 'qwerty');
echo vars::out('dummy');//qwerty

How should I create variable using function in(). Variable itself should only be available in this class.
Any ideas would be appreciated,
Martin
Colanth method doesn't work, obviously...
 
Back
Top