On 3/2/07, Jakob Buchgraber <[EMAIL PROTECTED]> wrote:
Marco Kaiser wrote: > Hi Jakob, >> It would be nice if in PHP 6 using constant parameters for functions >> and methods would be possible. This feature is e.g. available in Java. >> >> function doSth (const A) { >> if (defined ("A")) echo "A is a constant"; >> } >> >> doSth ("foo"); >> >> Cheers, >> Jay >> > This makes absolute no sense, why you want this? > > -- MarcoIt's just a way of ensuring that a parameter cannot be changed within a method (e.g. an id). I am using this feature frequently in Java. It actually got no "deeper" sense, but it's just a nice feature I'd like to use in PHP too. :-)
It actually comes from the C/C++ "const" like foo(const char *str). It makes very little sense to have it in PHP. --Pierre -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
