Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]W jaki sposob moge wywolac 2 konstruktory ?
elmozaur
post
Post #1





Grupa: Zarejestrowani
Postów: 518
Pomógł: 18
Dołączył: 21.07.2008

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


Witam mam taki problem:
sa 2 klasy
  1. class Core{
  2. public $aaa;
  3. function __construct() {
  4. $this->aaa = 10;
  5. }
  6. }
  7.  
  8. class Mod extends Core {
  9. public $bbb
  10. function __construct() {
  11. $this->bbb = 20;
  12. }
  13. }


Pytanie: jesli stworze obj klasy Mod jak w jego konstruktorze wywolac konstruktor klasy Core.
Gdzies kiedys widzialem taki tutorial chyba z parent_construct() ale jakos mi to nie dziala.

moge prosic o podpowiedz
pozdrawiam
G






Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 20.08.2025 - 22:56