Accessing private variable from static function in php

后端 未结 3 934
深忆病人
深忆病人 2021-01-13 02:35

I\'ve got a private variable in my class

private $noms = array(
        \"HANNY\",
        \"SYS\",
        \"NALINE\"
);

I want to access

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-13 03:28

    You have to make the noms static, too and access it via self::$noms.

提交回复
热议问题