LoginSignup
0
0

More than 5 years have passed since last update.

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

Last updated at Posted at 2017-03-29

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は最新に上げてこうな!

0
0
0

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
  3. You can use dark theme
What you can do with signing up
0
0