There is such code:

class Model_User extends Model_Auth_User { const PHOTO_SIZES = array( 1 => array( 'width' => 122, 'height' => 122 ), 2 => array( 'width' => 60, 'height' => 60 ) ); (тут еще другой код. но он ошибку не выдает. если закомментировать код, который выше, ошибка исчезает.) } 

When starting, it gives an error: "Arrays are not allowed in class constants". How to fix it?

PS if that, I have PHP 7.1 version.

  • one
    And it works for me .. - entithat
  • I also have @entithat: class Model_User { const PHOTO_SIZES = array( 1 => array( 'width' => 122, 'height' => 122 ), 2 => array( 'width' => 60, 'height' => 60 ) ); } var_dump(Model_User::PHOTO_SIZES); class Model_User { const PHOTO_SIZES = array( 1 => array( 'width' => 122, 'height' => 122 ), 2 => array( 'width' => 60, 'height' => 60 ) ); } var_dump(Model_User::PHOTO_SIZES); - Edward
  • one
    Maybe the author is not the version of which he thinks? - entithat
  • one
    @entithat most likely) - Edward
  • 3
    phpinfo() what shows? - Anton Shchyrov

0