加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

Php <<<是什么意思?

发布时间:2020-12-13 14:15:06 所属栏目:PHP教程 来源:网络整理
导读:在 http://us2.php.net/manual/en/language.oop5.properties.php的以下代码中象征意味着? ?phpclass SimpleClass{ // invalid property declarations: public $var1 = 'hello ' . 'world'; public $var2 = EODhello worldEOD; public $var3 = 1+2; public $
在 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,可用于分配字符串值.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读