2009/07/07

Call Member function

PHP5 is OO language. For a basic usage, we may not need to understand the concept of OO design in details, so sometimes we may forget how to call a member function defined in a Class. :-(

Got this error this morning:

PHP Fatal error:  Call to undefined function get_tokens()

Haha!

The solution:

$this->get_tokens();

Remember to you must have $this-> to call a member function defined in a Class.

No comments:

Post a Comment