![]() ![]() |
Post
#1
|
|
|
Grupa: Zarejestrowani Postów: 385 Pomógł: 26 Dołączył: 22.03.2008 Skąd: TM Ostrzeżenie: (0%)
|
Catchable fatal error: Argument 2 passed to goods::addGoods() must be an instance of integer, integer given, called in C:\Program Files\WebServ\httpd-users\all\index.php on line 16 and defined in C:\Program Files\WebServ\httpd-users\all\class.php on line 140
Dostaje taki błąd.. Dziwny ponieważ można przetłumaczyć go jakos: argument drugi podany do goods::addGoods() musi być typem integer, integer podany, w C:\Program Files\WebServ\httpd-users\all\index.php on line 16 and defined in C:\Program Files\WebServ\httpd-users\all\class.php on line 140 O co mu chodzi jeśli kurde dałem mu integer a w deklaracji klasy również jest integer:
|
|
|
|
Post
#2
|
|
|
Grupa: Zarejestrowani Postów: 415 Pomógł: 46 Dołączył: 26.05.2007 Skąd: Sandomierz Ostrzeżenie: (0%)
|
może dasz trochę wiecej kodu co?
|
|
|
|
Post
#3
|
|
|
Grupa: Moderatorzy Postów: 8 989 Pomógł: 1550 Dołączył: 8.08.2008 Skąd: Słupsk/Gdańsk |
http://pl.php.net/oop5.typehinting
Cytat Functions are now able to force parameters to be objects (by specifying the name of the class in the function prototype) or arrays (since PHP 5.1). U ciebie coś takiego oznacza że parametr musi być egzemplarzem klasy integer. A twój parametr jest zmienna typu integer a nie egzemplarzem klasy. |
|
|
|
Post
#4
|
|
|
Grupa: Zarejestrowani Postów: 385 Pomógł: 26 Dołączył: 22.03.2008 Skąd: TM Ostrzeżenie: (0%)
|
Hm, a da się wymusić jakoś typ? Hm?
|
|
|
|
Post
#5
|
|
|
Grupa: Moderatorzy Postów: 8 989 Pomógł: 1550 Dołączył: 8.08.2008 Skąd: Słupsk/Gdańsk |
|
|
|
|
Post
#6
|
|
|
Grupa: Zarejestrowani Postów: 385 Pomógł: 26 Dołączył: 22.03.2008 Skąd: TM Ostrzeżenie: (0%)
|
Kurcze szkoda.. Dzięki (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
|
|
|
|
![]() ![]() |
|
Aktualny czas: 23.12.2025 - 09:00 |