[Copy to clipboard]
PHP CODE:
class a
{
static protected $c;
protected $a;
protected $b;
private __construct($a="ds",$b="dsaf")
{
$this->a=$a;
$this->b=$b;
}
static function type($m)
{
switch($m)
{
case 1:
if(self::$a=NULL)
self::$a=new a($a,$b);
break;
case 2:
if(self::$a=NULL)
self::$a=new a($a,$b);
break;
default:
self::$a=false;
}
}
function xianshi()
{
return $this->a;
}
}
$a=self::type(1);
$b=$a->xianshi();
echo $b;
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in D:appservwwwjingfeijingfeiexam12.php on line 14