Can custom functions be written in php member methods? I have defined a function in a method, but an error is reported during the call. this is the method that reports the following error. However, I have another method that also writes the function and performs recursion, but no error is reported. Which of the following methods can be used to call custom functions in the Member methods of... php?
I have defined a function in a method, but an error is reported during the call.
This is the method for reporting the error.
Solution:
1. check the error message. your code has a getTree method and cannot be redefined. Rename or define your getTree to different namespaces.
II.
Remove the function that reports the error first. Write a piece of code to check whether the getTree () function already exists:
If (function_exists ('gettree') {echo 'The getTree () function already exists'} else {echo 'The getTree () function does not exist '}