Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]wymuszanie odpowiedniego typu zmienne w php
siegfried
post
Post #1





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 20.02.2008

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


witam
u mnie na windowsie z serwerem php 5.2.5 ponizszy skrypt dziala a u kolegi na krasnalu wystepuje blad:
Kod
Parse error: syntax error, unexpected T_ARRAY, expecting '&' or T_VARIABLE in


czy moze mi ktos powiedziec dlaczego?

Kod
public function render(array $a_model)


Ten post edytował siegfried 29.12.2008, 15:51:18
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
mike
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

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


PHP Manual :: Opis języka :: Classes and Objects (PHP 5) :: Type Hinting
Cytat
Type Hinting

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). However, if NULL is used as the default parameter value, it will be allowed as an argument for any later call.
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: 16.10.2025 - 01:33