Can you use static constants in PHP?

后端 未结 6 1048
面向向阳花
面向向阳花 2021-02-01 12:55

I expected the following to work but it doesn\'t seem to.



        
6条回答
  •  情歌与酒
    2021-02-01 13:05

    How are you trying to access the constants?

    I believe this would work:

    echo Patterns::$EMAIL; //shows "/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-...."
    

    If you just declare it as static.

提交回复
热议问题