On Sep 12, 2015 16:57, "Andrea Faulds" wrote:
>
>
> I'm with Levi here, I think type parameters should matter for static
methods. An example might be a list class:
>
Just because you want it, doesn't make it possible ;-)
The class type variables are specified when instantiating the class. Since
Hi Dennis,
Dennis Birkholz wrote:
Am 12.09.2015 um 12:03 schrieb Dennis Birkholz:
Hi together,
1. If we require some keyword instead of the colon to limit which types
the type placeholders can have I would choose:
class Foo {}
Just to save you some lookups in the Hack documentation:
1. Hack
Hey,
Levi Morrison wrote:
On Thu, Sep 10, 2015 at 5:12 PM, Ben Scholzen 'DASPRiD'
wrote:
Hi Dennis,
thanks for your feedback, see my answers below:
1. static methods:
class Foo {
public static function test() {
}
}
how can I call the method:
a) Foo::test()
or
b) Foo::tes
> 4. All type parameters must start with a capital T
It's important to note that the HHVM runtime does not require this (or
at least it didn't when I last checked it out). It's only the Hack
type-checker that cares.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: h
Am 12.09.2015 um 12:03 schrieb Dennis Birkholz:
> Hi together,
>
> 1. If we require some keyword instead of the colon to limit which types
> the type placeholders can have I would choose:
> class Foo {}
Just to save you some lookups in the Hack documentation:
1. Hack uses the "as" keyword:
class
Hi together,
1. If we require some keyword instead of the colon to limit which types
the type placeholders can have I would choose:
class Foo {}
The C#-like syntax "where T1 extends Bla implements Blubb" (proposed in
another thread) has two downsides:
a) It will not fit nicely with generic method
What would prohibit this?
class Factory {
public static function makeFoo() {
return new Foo();
}
}
It's perhaps less generic than what you posted, but this demonstrates
that that a Factory *could* hold the definition on the class and not
the method.
To be
(Please stop top-posting!)
On Fri, Sep 11, 2015 at 10:55 AM, Ben Scholzen wrote:
> Well, with the example, there's a good reason to have them separated:
>
> class Factory
> {
> public static function createFoo()
> {
> return new Foo();
> }
>
> public static function createBar()
> {
Well, with the example, there's a good reason to have them separated:
class Factory
{
public static function createFoo()
{
return new Foo();
}
public static function createBar()
{
return new Bar();
}
}
class Foo {}
class Bar {}
The factory instance does not know to need abo
On Fri, Sep 11, 2015 at 10:00 AM, Korvin Szanto wrote:
> Levi,
> It's my understanding that the "type variable" is a member of the instance
> and not of the class. In at least java, generics are unavailable in static
> context[1] though they can be specifically defined on the static method
> itsel
Levi,
It's my understanding that the "type variable" is a member of the instance
and not of the class. In at least java, generics are unavailable in static
context[1] though they can be specifically defined on the static method
itself[2].
[1]
http://stackoverflow.com/questions/936377/static-method
On Thu, Sep 10, 2015 at 5:12 PM, Ben Scholzen 'DASPRiD'
wrote:
> Hi Dennis,
>
> thanks for your feedback, see my answers below:
>
>> 1. static methods:
>>
>> class Foo {
>> public static function test() {
>> }
>> }
>>
>> how can I call the method:
>> a) Foo::test()
>> or
>> b) Foo:
Hi Ben,
Am 31.08.2015 um 22:31 schrieb Ben Scholzen 'DASPRiD':
> I've written up an RFC for supporting generic classes and methods in
> PHP, and I'd love to hear your thoughts about it.
>
> https://wiki.php.net/rfc/generics
I have some points where I think some clarification is required before
s
Hi Dennis,
thanks for your feedback, see my answers below:
1. static methods:
class Foo {
public static function test() {
}
}
how can I call the method:
a) Foo::test()
or
b) Foo::test()
in case b), would the generic methods not be a duplication?
Case a) is correct here. A s
Hi,
On 05.09.2015 21:48, John LeSueur wrote:
Hi Ben,
Now that I have substantive questions, including the list :)
In the following:
class SomeList {
public static function fromArray(array $a): SomeList {
$list = new SomeList();
$list2 = new SomeList();
return $
Hi,
I would love to see generics in PHP, but I have a few questions for your RFC.
class Bazz
Why did you use this syntax for forcing extending/implementation? I
know this is the syntax C# uses, but it doesn't fit PHP. I think it
should be "extends" or "implements", because in PHP : has a differ
On Tue, Sep 1, 2015 at 2:54 AM, Pavel Kouřil wrote:
> On Mon, Aug 31, 2015 at 10:31 PM, Ben Scholzen 'DASPRiD'
> wrote:
> > Hello,
> >
> > I've written up an RFC for supporting generic classes and methods in PHP,
> > and I'd love to hear your thoughts about it.
> >
> > https://wiki.php.net/rfc/g
On Mon, Aug 31, 2015 at 10:31 PM, Ben Scholzen 'DASPRiD'
wrote:
> Hello,
>
> I've written up an RFC for supporting generic classes and methods in PHP,
> and I'd love to hear your thoughts about it.
>
> https://wiki.php.net/rfc/generics
>
> Cheers,
> --
> Ben Scholzen 'DASPRiD'
> Community Review T
Hello,
I've written up an RFC for supporting generic classes and methods in
PHP, and I'd love to hear your thoughts about it.
https://wiki.php.net/rfc/generics
Cheers,
--
Ben Scholzen 'DASPRiD'
Community Review Team Member | m...@dasprids.de
Zend Framework | http://www.dasprids.
19 matches
Mail list logo