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: 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. |
|
|
|
kajzur [PHP]Dziwny błąd 2.05.2009, 11:28:32
decha-design może dasz trochę wiecej kodu co? 2.05.2009, 11:43:59
kajzur Hm, a da się wymusić jakoś typ? Hm? 2.05.2009, 13:42:06
wookieb Na poziomie składni php to nie. Musisz dodać odpow... 2.05.2009, 13:45:24
kajzur Kurcze szkoda.. Dzięki 2.05.2009, 13:46:53 ![]() ![]() |
|
Aktualny czas: 31.12.2025 - 18:09 |