Check if function has been called yet

前端 未结 5 2116
挽巷
挽巷 2020-12-20 23:02

New to OOP in PHP

One of my functions requires another function to be executed before running. Is there a way I can check this?

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-20 23:42

    Create a third function C that calls A and then B, and use that new function all over the place. In OOP terms, A and B should be protected in your class and C is public, e.g. available for whoever uses your class.

提交回复
热议问题