Re: [PHP-DEV] strict-api - Proposing a tool to check and enforce encapsulation

2015-09-12 Thread Bob Weinand
> Am 08.09.2015 um 00:41 schrieb François Laupretre : > > Hi, > > I have written a follow-up to my previous 'zstrict' PR. It is now focused on > a simple mechanism to detect API violations : > > https://github.com/php/php-src/pull/1508 > > This version just implements the

Re: [PHP-DEV] strict-api - Proposing a tool to check and enforce encapsulation

2015-09-12 Thread Sean DuBois
On Sun, Sep 13, 2015 at 12:44:14AM +0200, Bob Weinand wrote: > > Am 08.09.2015 um 00:41 schrieb François Laupretre : > > > > Hi, > > > > I have written a follow-up to my previous 'zstrict' PR. It is now focused > > on a simple mechanism to detect API violations : > > > >

Re: [PHP-DEV] strict-api - Proposing a tool to check and enforce encapsulation

2015-09-12 Thread Kalle Sommer Nielsen
Hi 2015-09-12 17:57 GMT+02:00 Anatol Belski : > Personally I'd be voting yes on the principle. However as the topic brought > controversial opinions in the past, IMHO it is better to solve it through an > RFC. Especially when the idea expands over zend_string API later,

Re: [PHP-DEV] strict-api - Proposing a tool to check and enforce encapsulation

2015-09-12 Thread François Laupretre
Hi Bob, Le 13/09/2015 00:44, Bob Weinand a écrit : While I don't disagree with the idea of making accidental direct access harder, I see a particular disadvantage for debugging. Nobody will like to write "p fbc->op_array.filename->zstrict_field_zend_string_val" (I hope I got it right?) just

Re: [PHP-DEV] strict-api - Proposing a tool to check and enforce encapsulation

2015-09-12 Thread Sean DuBois
On Sun, Sep 13, 2015 at 03:24:13AM +0200, François Laupretre wrote: > Hi Bob, > > Le 13/09/2015 00:44, Bob Weinand a écrit : > >While I don't disagree with the idea of making accidental direct access > >harder, I see a particular disadvantage for debugging. > > > >Nobody will like to write "p >

Re: [PHP-DEV] strict-api - Proposing a tool to check and enforce encapsulation

2015-09-12 Thread François Laupretre
Le 12/09/2015 17:57, Anatol Belski a écrit : Personally I'd be voting yes on the principle. However as the topic brought controversial opinions in the past, IMHO it is better to solve it through an RFC. Especially when the idea expands over zend_string API later, evermore devs and code will

Re: [PHP-DEV] Generic classes and methods RFC

2015-09-12 Thread 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 {} 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

Re: [PHP-DEV] Generic classes and methods RFC

2015-09-12 Thread Dennis Birkholz
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

RE: [PHP-DEV] strict-api - Proposing a tool to check and enforce encapsulation

2015-09-12 Thread Anatol Belski
Hi Francois, > -Original Message- > From: François Laupretre [mailto:franc...@php.net] > Sent: Tuesday, September 8, 2015 12:41 AM > To: PHP internals > Cc: Ferenc Kovacs ; Anthony Ferrara > > Subject: [PHP-DEV] strict-api

Re: [PHP-DEV] Generic classes and methods RFC

2015-09-12 Thread Levi Morrison
> 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:

Re: [PHP-DEV] Generic classes and methods RFC

2015-09-12 Thread Andrea Faulds
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)

Re: [PHP-DEV] Generic classes and methods RFC

2015-09-12 Thread Andrea Faulds
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