Re: [PHP-DEV] Q on Primitives

2008-12-18 Thread Kalle Sommer Nielsen
2008/12/18 Nathan Rixham : > Nathan Rixham wrote: > > and strongly typed returns.. nearly forgot > > public static function parseByte( Number $var ):bool { > or > public static function bool parseByte( Number $var ) { > > or such like > Theres already an RFC for this: http://wiki.php.net/rfc/typeh

Re: [PHP-DEV] Q on Primitives

2008-12-18 Thread Nathan Rixham
Nathan Rixham wrote: Dave Ingram wrote: Cristian Rodríguez wrote: class MyTestClass { public function blah(Foo $f); public function blah(Bar $b); public function blah($v); } Looks like you are using the wrong language, you need JAVA instead. Yes, I'll admit it does look like Jav

Re: [PHP-DEV] Q on Primitives

2008-12-18 Thread Nathan Rixham
Dave Ingram wrote: Cristian Rodríguez wrote: class MyTestClass { public function blah(Foo $f); public function blah(Bar $b); public function blah($v); } Looks like you are using the wrong language, you need JAVA instead. Yes, I'll admit it does look like Java (or any C++-like OO

Re: [PHP-DEV] Q on Primitives

2008-12-18 Thread Nathan Rixham
Dave Ingram wrote: I remember that multiple signatures was said to have a possible very difficult implementation. However, a similar behaviour can be achieved by some instanceof(). I thought it probably would be awkward, but we do already have some type hinting that can also be accomplis

Re: [PHP-DEV] Q on Primitives

2008-12-18 Thread Dave Ingram
Cristian Rodríguez wrote: >> class MyTestClass { >> public function blah(Foo $f); >> public function blah(Bar $b); >> public function blah($v); >> } >> > > Looks like you are using the wrong language, you need JAVA instead. > Yes, I'll admit it does look like Java (or any C++-like OO

Re: [PHP-DEV] Q on Primitives

2008-12-18 Thread Dave Ingram
> I remember that multiple signatures was said to have a possible very > difficult implementation. However, a similar behaviour can be achieved by > some instanceof(). > I thought it probably would be awkward, but we do already have some type hinting that can also be accomplished with instanceo

Re: [PHP-DEV] Q on Primitives

2008-12-18 Thread Cristian Rodríguez
Dave Ingram escribió: > class MyTestClass { > public function blah(Foo $f); > public function blah(Bar $b); > public function blah($v); > } Looks like you are using the wrong language, you need JAVA instead. -- "We have art in order not to die of the truth" - Friedrich Nietzsche Cristi

Re: [PHP-DEV] Q on Primitives

2008-12-18 Thread Giorgio Sironi
2008/12/18 Dave Ingram > Nathan Rixham wrote: > > [...] > > > > while I'm here I may as well also ask about further adding type > > hinting for the existing scalars and array. > +1, but I don't know what might have stopped it being implemented before > (time, parsing API changes, etc), so it woul

Re: [PHP-DEV] Q on Primitives

2008-12-18 Thread Nathan Rixham
2008/12/18 Dave Ingram > > Also, what about this case: > > class MyTestClass { > public function blah(Foo $f); > public function blah(Bar $b); > public function blah($v); > } > > I would argue that the most specific function should be called, but how > costly would that be to determine? What i

Re: [PHP-DEV] 2008 is 1s longer than normal.

2008-12-18 Thread Richard Quadling
2008/12/18 Steph Fox : > Hi Richard, > >> In looking at http://en.wikipedia.org/wiki/Leap_second, there have >> been quite a few leap seconds - 34 since Jan 1st 1972. > > I make it 23, according to the info on that page... > >> So, if PHP isn't making any changes does this mean PHP time is 34 >> se

Re: [PHP-DEV] 2008 is 1s longer than normal.

2008-12-18 Thread Steph Fox
No: http://derickrethans.nl/php_lags_23_seconds.php Hm, Wikipedia's apparently less than open there - [12:36] so how come PHP's different? [12:36] olson has information on it, but it's never used - Steph -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://

Re: [PHP-DEV] 2008 is 1s longer than normal.

2008-12-18 Thread Derick Rethans
On Thu, 18 Dec 2008, Richard Quadling wrote: > With 2008 having a leap-second, does PHP handle this? > > In looking at http://en.wikipedia.org/wiki/Leap_second, there have > been quite a few leap seconds - 34 since Jan 1st 1972. > > So, if PHP isn't making any changes does this mean PHP time is

Re: [PHP-DEV] 2008 is 1s longer than normal.

2008-12-18 Thread Steph Fox
Hi Richard, In looking at http://en.wikipedia.org/wiki/Leap_second, there have been quite a few leap seconds - 34 since Jan 1st 1972. I make it 23, according to the info on that page... So, if PHP isn't making any changes does this mean PHP time is 34 seconds behind UTC? No. This would be

Re: [PHP-DEV] 2008 is 1s longer than normal.

2008-12-18 Thread Scott MacVicar
Richard Quadling wrote: > Hi. > > With 2008 having a leap-second, does PHP handle this? > > In looking at http://en.wikipedia.org/wiki/Leap_second, there have > been quite a few leap seconds - 34 since Jan 1st 1972. > > So, if PHP isn't making any changes does this mean PHP time is 34 > seconds

[PHP-DEV] 2008 is 1s longer than normal.

2008-12-18 Thread Richard Quadling
Hi. With 2008 having a leap-second, does PHP handle this? In looking at http://en.wikipedia.org/wiki/Leap_second, there have been quite a few leap seconds - 34 since Jan 1st 1972. So, if PHP isn't making any changes does this mean PHP time is 34 seconds behind UTC? Regards, Richard -- -

Re: [PHP-DEV] Q on Primitives

2008-12-18 Thread Dave Ingram
Nathan Rixham wrote: > [...] > > while I'm here I may as well also ask about further adding type > hinting for the existing scalars and array. +1, but I don't know what might have stopped it being implemented before (time, parsing API changes, etc), so it would be interesting to look into the histo

Re: [PHP-DEV] simpler syntax for arrays

2008-12-18 Thread Christian Schneider
Jay I. wrote: > interesting idea, thanks. but unfortunately it won't help me as i really > need to pass arrays as a single argument like this: > > my_func($param_1,$param_2,array(...)); You can do that. All parameters in a row with => will be merged to one array. You could call myfunc($a

Re: [PHP-DEV] simpler syntax for arrays

2008-12-18 Thread Jay I.
interesting idea, thanks. but unfortunately it won't help me as i really need to pass arrays as a single argument like this: my_func($param_1,$param_2,array(...)); i'm unaware of how to make patches for php so i wonder is it possible to add a dollar sign shortcut for array keyword. like this: my

Re: [PHP-DEV] simpler syntax for arrays

2008-12-18 Thread Christian Schneider
jay wrote: > okey. another syntax: > myfunc($('key1'=>'val1', 'key2'=>'val2', ...)); This has been discussed and rejected several times. If you still want to be able to use this syntax you can use my patch at http://cschneid.com/php/ including a script to convert from and to this syntax.