Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> {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
 
Start new topic
Odpowiedzi
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

Posty w temacie


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: 27.12.2025 - 13:29