Reply to Re: [PHP] function with argument of type array

Your name:

Reply:


Posted by Andrι Medeiros on 09/28/29 11:22

On Thu, 2005-07-28 at 12:45 +0100, Marcus Bointon wrote:
> On 28 Jul 2005, at 12:07, AndrΓ© Medeiros wrote:
>
> > On Thu, 2005-07-28 at 11:08 +0200, marc serra wrote:
> >
> >> Hi, i want to know if it is possible to create a function and declare
> >> that one of its arguments is array type.
> >>
> >> In fact i want to do something like this
> >>
> >> function test(String $litteral, array $foo){
> >
> > There is no way to do that. What you _CAN_ do, to ensure you're
> > getting
> > an array is:
>
> There IS a way to do exactly this. It's called type hinting and it's
> a PHP 5 feature:
>
> http://www.php.net/manual/en/language.oop5.typehinting.php
>
> Marcus
> --
> Marcus Bointon
> Synchromedia Limited: Putting you in the picture
> marcus@synchromedia.co.uk | http://www.synchromedia.co.uk
>

Wow... didn't have a clue it was possible already! Seems as if it's
still a feature under development (only arrays and classes), but they're
on the good way :)

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация