Getting an error using constants

后端 未结 4 1528
南旧
南旧 2020-12-12 01:26

I have a lot of pages, all of which require the file characters.php. This file contains constants which define many things in my website. They are

4条回答
  •  鱼传尺愫
    2020-12-12 02:21

    A constant must not have any $ sign at the beginning. Try const HUMAN_HEALTH = 1.1 instead.

    As Marc B mentioned, const outside classes is only available up from PHP 5.3.

提交回复
热议问题