I have a function that takes a “callback” argument. This can be either a function or a static class method.
How can I detect if the method is static or not?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I suppose you could do this with reflection, though this will be slow.
Presuming your callback is
$callback:Note that this doesn’t account for times when
$callback[0]is an object, or if you have a lambda function as$callback, or probably all kinds of different circumstances. I don’t really understand what you’re looking for; this may be sufficient.