LoginSignup
0

More than 5 years have passed since last update.

posted at

updated at

Arrays are not allowed in class constants in....

PHPでsyntaxcheckを行った際の出来事。
gitで他のソースをマージして、コミットしようとしたら(コミットする際にシンタックスチェックが走る)以下のエラーが…

PHP Fatal error:  Arrays are not allowed in class constants in /PATH/TO/FILE.php on line 10

調べてみると、クラス内変数として,
const $arr = array();
と宣言できるようになったのは,PHP5.6からみたいです.

ちなみにMacOS10.11ではPHP5.5が初期インストールされている様です。

PHP 5.5.38 (cli) (built: Aug 21 2016 21:48:49)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies

PHPは最新に上げてこうな!

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
0