Can I use private instance methods as callbacks?

后端 未结 3 524
逝去的感伤
逝去的感伤 2021-01-17 11:18

My particular scenario involves doing some text transformation using regular expressions within a private method. The private method calls preg_replace_callback, but is seem

3条回答
  •  猫巷女王i
    2021-01-17 11:37

    Can you not use protected? I'd need to know what the relationship of these two classes were in relation to each other to be more clear, but you should be able to extend the class and use the new protected methods you have inherited without making them public.

    Hope this helps!

    Cheers

提交回复
热议问题