I was just going through the curl library for codeigniter to understand the code. Here is the link. There is this function __call() which I am not sure about. Is it an inbuilt function in CI? I suppose it is called whenever any method of this library is called, for example using
$this->curl->simple_get();
Can someone please shed the light. I couldn’t find much info on the codeigniter user guide.
No – __call() is a php function. It is known as one of the magic methods.
The magic method
__call()is to undeclared methods what__get()and__set()are to undeclared data member.These methods are automatically called internally when the program tires to execute a method that has not been defined within the class at the time of development.
__call()takes two arguments. The first argument is the name of the undeclared method invoked by the program and the second is an array that contains a list of parameters passed to the undeclared arrayExample
Ref