在以下代码中,http://us2.php.net/manual/en/language.oop5.properties.php符号是什么意思?Php <<<是什么意思?
<?php
class SimpleClass
{
// invalid property declarations:
public $var1 = 'hello ' . 'world';
public $var2 = <<<EOD
hello world
EOD;
public $var3 = 1+2;
public $var4 = self::myStaticMethod();
public $var5 = $myVar;
// valid property declarations:
public $var6 = myConstant;
public $var7 = array(true, false);
// This is allowed only in PHP 5.3.0 and later.
public $var8 = <<<'EOD'
hello world
EOD;
}
?>
张贴,代码是不正确的 - 'EOD;'行不允许缩进。请注意,您链接到的页面没有缩进该部分。 – Amber 2010-05-06 10:03:31