在以下代碼中,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