Using __set with arrays solved, but why?

后端 未结 3 1249
萌比男神i
萌比男神i 2021-01-12 16:50

Having done a bit of research, I eventually came across the answer to a question I was soon to ask here anyways; How do you work with arrays via the __get and <

3条回答
  •  借酒劲吻你
    2021-01-12 17:32

    In PHP when you return a value from a function you can consider it making a copy of that value (unless it's a class). In the case of __get unless you return the actual thing you want to edit, all the changes are made to a copy which is then discarded.

提交回复
热议问题