Php <<<是什么意思?

前端之家收集整理的这篇文章主要介绍了Php <<<是什么意思?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
http://us2.php.net/manual/en/language.oop5.properties.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;
}
?>
它被称为 Heredoc syntax,可用于分配字符串值.
原文链接:https://www.f2er.com/php/130701.html

猜你在找的PHP相关文章