Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php]Problem z array w konstruktorze
Noctrum
post
Post #1





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 12.03.2008

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


Witam

Mam pytanie, co powoduje ze po wpisaniu array:

  1. <?php
  2. public function __construct(array $row) <---- Tak mam w przykladzie i na forum rowniez to zauwazylem
  3. {
  4. ...
  5. }
  6. ?>


otrzymuje taki blad:
  1. <?php
  2. Parse error: syntax error, unexpected T_ARRAY, expecting '&' or T_VARIABLE in c:usrkrasnalwwwpd_oophtmllibclass.xxx.php on line 16
  3. ?>


Ten post edytował Cysiaczek 17.03.2008, 21:37:20
Powód edycji: dodalem tag (cysiaczek)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Sedziwoj
post
Post #2





Grupa: Zarejestrowani
Postów: 793
Pomógł: 32
Dołączył: 23.11.2006
Skąd: Warszawa

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


Cytat
PHP 5 introduces Type Hinting. 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)


Czyli ma być >= 5.1
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: 10.10.2025 - 16:59