How to check if a function is public or protected in PHP

后端 未结 3 1735
天命终不由人
天命终不由人 2020-12-15 16:32

I am building an API where the user requests a \'command\', which is passed into a class. Assuming the command matches a PUBLIC function, it will execute successfully. If th

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-15 16:52

    You can use the is_callable function to determine if the protection level should limit you: Example:

提交回复
热议问题