i am php beginner. I had debug a php coding using some editor and an error msg appear, i confuse and dont understand the meaning of the error msg. The error msg as below:
call to undefined function and call to a member function on a non_object
i had reconfigure the apache and yet the error still appear....
TQ
error msg understanding
Moderator: General Moderators
-
fastfingertips
- Forum Contributor
- Posts: 242
- Joined: Sun Dec 28, 2003 1:40 am
- Contact:
This usually encounters when you call a non defined function. For example if you declared a function in another file and you didn't include the file in the current one, where you are calling it you will get this kind of error. Also you should check if there wasn't a typing mistake and you wrote a wrong name.
undefined function - either you're trying to use a PHP function that's part of a newer version than the PHP you're currently running, you don't have the correct extensions enabled, or you're trying to use a function that you made without declaring it first
for example
would spit out an error, whereas this would not
The call to a member function on a non-object means that you're trying to use a function that was inside of a class without first instantiating the object.
You're probably doing something like this
where it should really look like this
for example
Code: Select all
echo my_function("hi");Code: Select all
function my_function($text){
return $text;
}
echo my_function("hi");You're probably doing something like this
Code: Select all
echo $class->doFunction($data);Code: Select all
require 'class.php';
$class = new class();
echo $class->doFunction($data);Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.