foutmelding in mijn class

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Gerrit van weele

gerrit van weele

18/06/2015 16:48:05
Quote Anchor link
hallo,

ik krijg deze melding :

PHP Strict Standards: Non-static method users::um_settings() should not be called statically, assuming $this from incompatible context in /var/www/vhosts/14/122093/webspace/httpdocs/trefpoint.com/cms/classes/core/um_class.php on line 15
PHP Strict Standards: Non-static method cms::db_connect() should not be called statically, assuming $this from incompatible context in /var/www/vhosts/14/122093/webspace/httpdocs/trefpoint.com/cms/classes/core/um_class.php on line 103
PHP Strict Standards: Non-static method users::um_settings() should not be called statically, assuming $this from incompatible context in /var/www/vhosts/14/122093/webspace/httpdocs/trefpoint.com/cms/classes/core/um_class.php on line 15
PHP Strict Standards: Non-static method cms::db_connect() should not be called statically, assuming $this from incompatible context in /var/www/vhosts/14/122093/webspace/httpdocs/trefpoint.com/cms/classes/core/um_class.php on line 103


dat zijn deze regels in mijn class :

line 15: users :: um_settings ($table = "um_settings", $prefix = "");
line 103: $db = cms :: db_connect();

kan iemand mij hiermee helpen

gerrit
 
PHP hulp

PHP hulp

27/04/2024 21:34:52
 
Randy vsf

Randy vsf

18/06/2015 17:49:46
Quote Anchor link
De oplossing staat in de foutmelding.
 
Gerrit van weele

gerrit van weele

18/06/2015 19:13:13
Quote Anchor link
hallo,

bedankt voor je reactie, maar dat is het probleem, ik snap hem eve niet..
 
Thomas van den Heuvel

Thomas van den Heuvel

18/06/2015 19:26:24
Quote Anchor link
De methoden (functions) hebben het keyword static niet in de declaratie zitten, maar je gebruikt deze wel alsof dit static methoden zijn. Voeg dus dit keyword toe bij deze methoden.

Vergelijk:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
error_reporting(E_STRICT);

class SomeClass
{
    public function someMethod() {
        // stuff
    }
}


// geeft warning
$test = SomeClass::someMethod();

class SomeClassTwo
{
    public static function someMethod() {
        // stuff
    }
}


// geeft geen warning
$test = SomeClassTwo::someMethod();
?>
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.