This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

Pages

2012年5月28日月曜日

PHPのクラスプロパティでのヒアドキュメントについて

Parse error: syntax error, unexpected T_START_HEREDOC in (ファイルPATH) on line (行数)

こんなエラーが頻発してはまってしまった。

実際の処理行はこんな感じ

public $template =<<<EOF
test
EOF;

1ヶ月前に全く同じ書き方で他のプロジェクトで利用していたので、原因不明。。
と思って調べていたら、PHPの公式マニュアルにありました。


ヒアドキュメント構文を、クラスのプロパティの初期化に用いることはできません。 PHP 5.3 以降では、変数を含まないヒアドキュメントではこの制約はなくなりました。     
あー、この前のシステムは5.3だったのか。
今のは5.2だったや。

結局ヒアドキュメントを使わず書き直すはめに。
めんどくさ。