Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> {SOLVED} Non-abstract method..., huh ??
ennics
post
Post #1





Grupa: Zarejestrowani
Postów: 312
Pomógł: 0
Dołączył: 29.12.2004

Ostrzeżenie: (0%)
-----


próbuję utworzyć prostą klasę
  1. <?php
  2.  
  3. class config
  4. {
  5.   //public $_CONFIG = array();
  6.  
  7.   public function __construct();
  8.   {
  9.     return TRUE;
  10.   }
  11. }
  12.  
  13. $_config = new config();
  14.  
  15. ?>

w odpowiedzi dostaję
Cytat
Fatal error: Non-abstract method config::__construct() must contain body in C:\apache2triad\htdocs\test.php on line 9

szukałem w google ale nie znalazłem, gdzie tkwi problem ?

Ten post edytował ennics 15.06.2005, 12:58:07
Go to the top of the page
+Quote Post
kubatron
post
Post #2





Grupa: Zarejestrowani
Postów: 581
Pomógł: 0
Dołączył: 21.07.2003
Skąd: Jasło

Ostrzeżenie: (0%)
-----


  1. <?php
  2.  
  3. class config
  4. {
  5. //public $_CONFIG = array();
  6.  
  7. public function __construct()
  8. {
  9. return TRUE;
  10. }
  11. }
  12.  
  13. $_config = new config();
  14.  
  15. ?>

po public function __construct() dałes ; a potem { } ;P literówka (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) teraz sprobój.
Go to the top of the page
+Quote Post
ennics
post
Post #3





Grupa: Zarejestrowani
Postów: 312
Pomógł: 0
Dołączył: 29.12.2004

Ostrzeżenie: (0%)
-----


oh shit ;] dzięki...

czym zdjąc bielmo z moich oczu ? ;]
Go to the top of the page
+Quote Post
bela
post
Post #4


Administrator PHPedia.pl


Grupa: Developerzy
Postów: 1 102
Pomógł: 2
Dołączył: 14.09.2003

Ostrzeżenie: (0%)
-----


miales srednik po __construct, czytaj ze zrozumieniem błędy
Go to the top of the page
+Quote Post
aleksander
post
Post #5





Grupa: Przyjaciele php.pl
Postów: 742
Pomógł: 0
Dołączył: 14.12.2003
Skąd: Gdańsk, Trójmiasto

Ostrzeżenie: (0%)
-----


btw od kiedy konstruktor może cokolwiek zwracać (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg) (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)
Go to the top of the page
+Quote Post
NuLL
post
Post #6





Grupa: Zarejestrowani
Postów: 2 262
Pomógł: 21
Dołączył: 3.05.2004
Skąd: Sopot, Krakow, W-wa

Ostrzeżenie: (0%)
-----


A singleton to pies :?:

EDIT
Boze ale ja głupote napisałem (IMG:http://forum.php.pl/style_emoticons/default/sleepysmiley03.gif)
Go to the top of the page
+Quote Post
bela
post
Post #7


Administrator PHPedia.pl


Grupa: Developerzy
Postów: 1 102
Pomógł: 2
Dołączył: 14.09.2003

Ostrzeżenie: (0%)
-----


@NuLL singleton przecież to zwykła statyczna metoda, a nie konstruktor (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.12.2025 - 22:54