为什么输出的是“string”,而不是“stringpublic C++“?
<?PHP
class Test
{
public $str = "public C++";
function __construct()
{
echo "string";
echo $str;
}
}$test = new Test();
?>
<?PHP
class Test
{
public $str = "public C++";
function __construct()
{
echo "string";
echo $str;
}
}$test = new Test();
?>
class Test
{
public $str = "public C++";
function __construct()
{
echo "string";
echo $this->str;
}
}$test = new Test();
?>