Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Levi Morrison
On Wed, Feb 17, 2016 at 12:48 PM, Kevin Gessner wrote: > On Wed, Feb 17, 2016 at 10:26 AM, Levi Morrison wrote: >> >> I want to add my personal experience with traits: every time I create >> a trait it is to implement an interface. Here is a publicly available >> [example with >> OuterIterator](h

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Fleshgrinder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 2/17/2016 9:01 PM, Kevin Gessner wrote: > > I'm not clear on the motivation for this principle. Is there > anything I could read up about explicit vs implicit in PHP design? > This is not so much about implicit vs. explicit PHP design for me.

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Kevin Gessner
On Wed, Feb 17, 2016 at 1:17 PM, Fleshgrinder wrote: > I agree with the others having a class implementing the interface > automatically just because a trait implements it is not a good idea. > The class should always decide on its own if it wants to implement an > interface or not. > I'm not cl

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Kevin Gessner
On Wed, Feb 17, 2016 at 10:26 AM, Levi Morrison wrote: > I want to add my personal experience with traits: every time I create > a trait it is to implement an interface. Here is a publicly available > [example with OuterIterator]( > https://github.com/morrisonlevi/Ardent/blob/master/src/Collectio

[PHP-DEV] Re: [RFC] Traits with interfaces

2016-02-17 Thread Kevin Gessner
On Wed, Feb 17, 2016 at 9:25 AM, Kevin Gessner wrote: > Hello internals team! I'd like to propose an RFC to allow traits to > implement interfaces. > I've created a proper RFC wiki page here with the draft: https://wiki.php.net/rfc/traits-with-interfaces It includes more detail and several exa

Re: [PHP-DEV] Re: Class constants on object references have variable-inconsistent accessibility

2016-02-17 Thread kelerest123
Hi Andrea, I am sorry I haven't checked this before. I am using 5.5.12 as that's also the production environment I am mostly working with. I am planning upgrade to 7.x in a long-term. Anyways, thanks for correcting me. Very best regards, Kubis Pandian-Fowler Od: Andrea Faulds Odosla

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Fleshgrinder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 2/17/2016 3:25 PM, Kevin Gessner wrote: > I've noticed s pattern in Etsy's code and elsewhere, where a trait > provides a common implementation of an interface. Classes that use > the trait are required to also explicitly declare the interface to

[PHP-DEV] Re: Class constants on object references have variable-inconsistent accessibility

2016-02-17 Thread Andrea Faulds
Hi Jakub, Jakub Kubíček wrote: I have encountered an inconsistence, or rather a bug, in PHP's syntax. The thing is, in PHP you can access constants defined on a class using reference to an instance of this class, stored in variable. So we have a code: Which will nicely pass. But things will g

[PHP-DEV] Class constants on object references have variable-inconsistent accessibility

2016-02-17 Thread Jakub Kubíček
Dear internals! I have encountered an inconsistence, or rather a bug, in PHP's syntax. The thing is, in PHP you can access constants defined on a class using reference to an instance of this class, stored in variable. So we have a code: Which will nicely pass. But things will go wrong having a

Re: [PHP-DEV] PCRE jit bug with UTF-8 and lookbehind assertion

2016-02-17 Thread Rasmus Lerdorf
On 02/17/2016 05:06 AM, Christian Schneider wrote: > Hi there, > we just ran into a version of the bug "JIT bug with lookbehind assertion": > https://bugs.exim.org/show_bug.cgi?id=1189 > > To reproduce it you can use > php -n -r 'ini_set("pcre.jit", 0); echo > preg_replace("/\b(11|21|

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Arne Blankerts
Hi Kevin,   Hi all, On Mi, 2016-02-17 at 09:25 -0500, Kevin Gessner wrote: >  > I've noticed s pattern in Etsy's code and elsewhere, where a trait > provides a common implementation of an interface.  Classes that use > the trait are required to also explicitly declare the interface to > benefit.  

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Markus Fischer
Hello, On 17.02.16 15:25, Kevin Gessner wrote: > I've noticed s pattern in Etsy's code and elsewhere, where a trait provides > a common implementation of an interface. Classes that use the trait are > required to also explicitly declare the interface to benefit. I propose > that traits be permit

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Levi Morrison
On Wed, Feb 17, 2016 at 7:25 AM, Kevin Gessner wrote: > Hello internals team! I'd like to propose an RFC to allow traits to > implement interfaces. > > I've noticed s pattern in Etsy's code and elsewhere, where a trait provides > a common implementation of an interface. Classes that use the trai

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Kevin Gessner
On Wed, Feb 17, 2016 at 9:34 AM, Sebastian Bergmann wrote: > Am 17.02.2016 um 15:25 schrieb Kevin Gessner: > > Hello internals team! I'd like to propose an RFC to allow traits to > > implement interfaces. > > I think that would violate "The Flattening Property" [1], meaning > that the fact tha

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Chase Peeler
I agree. with Sebastian. I'm personally a big fan of using traits as the implementation mechanism for interfaces (i.e. implement the interfaces methods in a trait, then use that trait in a class that implements the interface), but I don't think there is anything positive to gain from having the tra

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Sebastian Bergmann
Am 17.02.2016 um 15:25 schrieb Kevin Gessner: > Hello internals team! I'd like to propose an RFC to allow traits to > implement interfaces. I think that would violate "The Flattening Property" [1], meaning that the fact that a class uses a trait must not be noticable by a user of that class.

[PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Kevin Gessner
Hello internals team! I'd like to propose an RFC to allow traits to implement interfaces. I've noticed s pattern in Etsy's code and elsewhere, where a trait provides a common implementation of an interface. Classes that use the trait are required to also explicitly declare the interface to benef

[PHP-DEV] BAD Benchmark Results for PHP Master 2016-02-17

2016-02-17 Thread lp_benchmark_robot
Results for project PHP master, build date 2016-02-17 06:31:41+02:00 commit: 3244d3c previous commit:77ca527 revision date: 2016-02-16 09:15:25+01:00 environment:Haswell-EP cpu:Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB

[PHP-DEV] PCRE jit bug with UTF-8 and lookbehind assertion

2016-02-17 Thread Christian Schneider
Hi there, we just ran into a version of the bug "JIT bug with lookbehind assertion": https://bugs.exim.org/show_bug.cgi?id=1189 To reproduce it you can use php -n -r 'ini_set("pcre.jit", 0); echo preg_replace("/\b(11|21|41)\b/u", "z", "x°11\n");' vs. php -n -r 'ini_set("pc