PHP set magic method with array as names

前端 未结 4 1455
無奈伤痛
無奈伤痛 2020-12-21 09:13

I am creating a class which I will use to store and load some settings. Inside the class all settings are stored in an array. The settings can be nested, so the settings arr

4条回答
  •  爱一瞬间的悲伤
    2020-12-21 09:39

    The part $foo->bar is actually calling __get, this function should (in your case) return an array.

    returning the right array in the __get would then be your solution.

提交回复
热议问题