Call to a member function on a non-object

The place for "I can't figure out how to..." questions.
Post Reply
soundboy
User
Posts: 2
Joined: Sun Feb 12, 2006 7:13 pm

Call to a member function on a non-object

Post by soundboy » Sun Feb 12, 2006 7:18 pm

Hi... I know this is probably a dumb question since it's 3 simple lines of code, but I can't get this to work.

I did

Code: Select all

require_once ('includes/getid3/getid3.php');
$getID3 = new getID3;
And then

Code: Select all

$fileinfo = $getID3->analyze($path);
And I get
"Fatal error: Call to a member function on a non-object" for that last line of code. I'm not new to PHP, but I am new to objects, so I figure I must be missing something simple here.

soundboy
User
Posts: 2
Joined: Sun Feb 12, 2006 7:13 pm

Post by soundboy » Mon Feb 13, 2006 5:50 am

Nevermind, got it.

I was declaring the new object outside of the function where I was calling it. Didn't know I coulnd't do that.

Thanks anyway.

Post Reply