Non-static method .... should not be called statically

Do you have questions regarding Pecl or Pear? ask here!

Moderators: macek, egami, gesf

jcurtis81
New php-forum User
New php-forum User
Posts: 2
Joined: Tue May 29, 2012 6:38 am

Non-static method .... should not be called statically

Postby jcurtis81 » Tue May 29, 2012 11:33 am

Does anyone know how to fix the error cause by this:
$options = &PEAR::getStaticProperty('DB_DataObject','options');

Non-static method .... should not be called statically

User avatar
Nullsig
php-forum Fan User
php-forum Fan User
Posts: 981
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Re: Non-static method .... should not be called statically

Postby Nullsig » Tue May 29, 2012 11:42 am

You should not be calling the non-static method statically.

jcurtis81
New php-forum User
New php-forum User
Posts: 2
Joined: Tue May 29, 2012 6:38 am

Re: Non-static method .... should not be called statically

Postby jcurtis81 » Tue May 29, 2012 12:19 pm

Yes, I know but this site was written including libraries that uses this feature this way. Apparently, the older versions of php you could use a reference ( i.e $foo = &FOO2::method(); ). Is it a way to use this method in a newer version of php.

thanks ahead

User avatar
LordMatt
New php-forum User
New php-forum User
Posts: 7
Joined: Tue Apr 30, 2013 4:16 pm
Location: UK
Contact:

Re: Non-static method .... should not be called statically

Postby LordMatt » Tue Apr 30, 2013 5:18 pm

If the method is explicitly declared as static then it should be fine... However, yes, as you are discovering, the standards of coding from PHP4 to PHP5 have shifted.


Return to “PEAR and PECL”

Who is online

Users browsing this forum: No registered users and 0 guests

cron