On 12/19/2008 17:39, Robin Burchell wrote:
Ugh. Apparantly I forgot to CC the list on those last two mails..
Sorry. Pasted so others stay in on the conversation:
On Fri, Dec 19, 2008 at 3:18 PM, troels knak-nielsen wrote:
That's an interesting mail, expresses a viewpoint I hadn't considered,
Ugh. Apparantly I forgot to CC the list on those last two mails..
Sorry. Pasted so others stay in on the conversation:
On Fri, Dec 19, 2008 at 3:18 PM, troels knak-nielsen wrote:
>
That's an interesting mail, expresses a viewpoint I hadn't considered,
so, thanks for that.
However: If PHP provid
Robin Burchell wrote:
Hmm. How would it break it?
By leaving 'function' to mean variant, it's only adding new
functionality by overriding types to replace 'function', which should
have no issue with older code, surely?
To clarify:
current method declaration:
function foo()
public static functi
On Fri, Dec 19, 2008 at 2:40 PM, troels knak-nielsen wrote:
> PHP is loosely typed. Adding typehints to primitives would change
> this. The only reason that it is working with object types, is because
> you can't automatically coerce object types anyway.
>
> --
> troels
I'm not sure what you are
On Fri, Dec 19, 2008 at 3:31 PM, Nathan Rixham wrote:
> type hints are all ready there so adding primitives /should/ be possible
> without any bc issues
PHP is loosely typed. Adding typehints to primitives would change
this. The only reason that it is working with object types, is because
you can
Hmm. How would it break it?
By leaving 'function' to mean variant, it's only adding new
functionality by overriding types to replace 'function', which should
have no issue with older code, surely?
To clarify:
current method declaration:
function foo()
public static function foo()
public function
Robin Burchell wrote:
Just a random thought I have from reading over that:
Would it not be more 'natural' to change 'function' to indicate a
method with a variant return type, and allow e.g.
'int somefunc()' instead of 'function (int) somefunc()' to indicate an
int return?
it would break all
Just a random thought I have from reading over that:
Would it not be more 'natural' to change 'function' to indicate a
method with a variant return type, and allow e.g.
'int somefunc()' instead of 'function (int) somefunc()' to indicate an
int return?
It would be a bit more in fitting with tradi
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
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
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
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
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
> 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
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
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
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
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
Graham Kelly wrote:
Hi,
I think the reason there aren't more primitive types in PHP is because of
the nature of the language. One of the main features of PHP over say, C (and
even Java), is that the memory managment is completely transparent to the
devloper. This means that it really shouldent m
Hi,
I think the reason there aren't more primitive types in PHP is because of
the nature of the language. One of the main features of PHP over say, C (and
even Java), is that the memory managment is completely transparent to the
devloper. This means that it really shouldent matter to the devloper
20 matches
Mail list logo