Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [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
potreb
post
Post #2





Grupa: Zarejestrowani
Postów: 1 568
Pomógł: 192
Dołączył: 7.03.2005
Skąd: Warszawa

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


Krasnal? Chyba nie ma PHP 5
Go to the top of the page
+Quote Post
siegfried
post
Post #3





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

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


krasnal ma 5.0.2 . sprobuje jeszcze na nowszej wersji. moze w php 5.0.2 nie bylo jeszcze takiej mozliwosci ( czy to mozliwe? )
Go to the top of the page
+Quote Post
mike
post
Post #4





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
siegfried
post
Post #5





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

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


dzieki za pomoc:)
Go to the top of the page
+Quote Post

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: 6.10.2025 - 20:38