Extending ArrayObject in PHP properly?

前端 未结 3 1096
傲寒
傲寒 2021-02-09 08:02

Problem: I am trying to extend PHP\'s ArrayObject as shown below. Unfortunately I can\'t get it to work properly when setting multi-dimensional obj

3条回答
  •  渐次进展
    2021-02-09 08:21

    Implement the offsetGet method. If you are accessing a non exist property, you can create one as you like.

    As you are extend ArrayObject, you should use the array way [] to set or get.

提交回复
热议问题