[PHP-DEV] Re: Fixing return value memory leaks upon exceptions in opcode operand freeing

2016-12-02 Thread Dmitry Stogov
On Dec 1, 2016 12:46 PM, Dmitry Stogov wrote: > > On Dec 1, 2016 12:21 PM, Bob Weinand wrote: > > > > > >> Am 01.12.2016 um 08:15 schrieb Dmitry Stogov : > >> > >> Hi, > >> > >> I see, the patch is merged, but I didn't see Nikita's opinion and > >> agreement. > >> Nikita, did you give a green li

Re: [PHP-DEV] php.net mailing setup owner?

2016-12-02 Thread Andreas Heigl
Hi Davey, hi All Am 02.12.16 um 03:10 schrieb Davey Shafik: > On Thu, Dec 1, 2016 at 2:48 PM, Rasmus Lerdorf > wrote: > > On Thu, Dec 1, 2016 at 8:00 AM, Derick Rethans > wrote: > > > > I think it's time to retire Ecelerity. Nobod

[PHP-DEV] [Concept] Magic Casting

2016-12-02 Thread Alex Bowers
Hello All, In PHP we currently have the ability to type hint classes in method signatures, however, sometimes it would be useful to convert the items to a different instance / type. An example is collections and arrays. If implemented properly, an array and a collection could be used interchangea

[PHP-DEV] Re: [Concept] Magic Casting

2016-12-02 Thread Alex Bowers
Sorry, forgot a little bit of information. If the type passed is already satisfactory (an instance), then __cast is NOT called.

[PHP-DEV] Re: [Concept] Magic Casting

2016-12-02 Thread Alex Bowers
And because the email formatting appears bad (at least in externals.io) Here it is in a gist: https://gist.github.com/alexbowers/9520c8df746249ecae2d9c7aad2e54ae

Re: [PHP-DEV] Re: [RFC] Debugging PDO Prepared Statement Emulation v2

2016-12-02 Thread Matteo Beccati
On 02/12/2016 08:36, Thomas Nunninger wrote: > Hi, > >> So, if I only want to get the emulated prepared statement, I have to do >> ob_start()/ob_get_clean(), then use a regexp to fetch it ? I want v1 >> back T_T > > I second that. Why do you print it directly? Wouldn't it be better to > return a

Re: [PHP-DEV] Re: [Concept] Magic Casting

2016-12-02 Thread Andrey Andreev
Hi, On Fri, Dec 2, 2016 at 3:44 PM, Alex Bowers wrote: > And because the email formatting appears bad (at least in externals.io) > > Here it is in a gist: > https://gist.github.com/alexbowers/9520c8df746249ecae2d9c7aad2e54ae > There's been a few times I've wanted something like that, but I don'

Re: [PHP-DEV] [Concept] Magic Casting

2016-12-02 Thread Ivan Enderlin
Hello :-), Casting is already a very large surface of unsafety and bugs. Adding “magic” before this is like multiplying the surface by infinite. The only goal I see here is to save a `new Collection(…)`, and this is not a sufficient reason from my point of view. If `array` was a type, and `I

Re: [PHP-DEV] Re: [Concept] Magic Casting

2016-12-02 Thread David Rodrigues
2016-12-02 12:16 GMT-02:00 Alex Bowers : > var_dump was just an example to "show what type the variable is", and > completely untested. Consider replacing that line with anything that would > make it clear to you that it is now no longer an array, but a Collection for > example. Sure, but how the

Re: [PHP-DEV] Re: [RFC] Debugging PDO Prepared Statement Emulation v2

2016-12-02 Thread Thomas Nunninger
Hi, On 12/02/2016 02:54 PM, Matteo Beccati wrote: On 02/12/2016 08:36, Thomas Nunninger wrote: Hi, So, if I only want to get the emulated prepared statement, I have to do ob_start()/ob_get_clean(), then use a regexp to fetch it ? I want v1 back T_T I second that. Why do you print it directl

Re: [PHP-DEV] Re: [Concept] Magic Casting

2016-12-02 Thread David Rodrigues
var_dump() should uses __toString() here, not? 2016-12-02 11:44 GMT-02:00 Alex Bowers : > And because the email formatting appears bad (at least in externals.io) > > Here it is in a gist: > https://gist.github.com/alexbowers/9520c8df746249ecae2d9c7aad2e54ae -- David Rodrigues -- PHP Internal

Re: [PHP-DEV] Re: [Concept] Magic Casting

2016-12-02 Thread Andrey Andreev
Hi again, On Fri, Dec 2, 2016 at 4:19 PM, Alex Bowers wrote: > I don't see how the interface is equivalent. > > The benefit of this, is that you can convert types passed into a method to > the type you expect automagically, Castable wouldn't allow that, only a new > magic method (or reflection a

Re: [PHP-DEV] Re: [RFC] Debugging PDO Prepared Statement Emulation v2

2016-12-02 Thread Matteo Beccati
Hi, On 02/12/2016 15:20, Thomas Nunninger wrote: >> Could you please explain what's the use case? As far as I'm concerned >> such information would only be useful during PDO driver development, >> phpt files and bug reporting / fixing. > > Sometimes I'd like to log what SQL is really used that I

Re: [PHP-DEV] Re: [Concept] Magic Casting

2016-12-02 Thread Alex Bowers
Damn. I must have done that to a lot of emails. Gonna have to resend them all when I get home. Sorry folks for dupes. On 2 December 2016 at 14:46, Andrey Andreev wrote: > Hi again, > > On Fri, Dec 2, 2016 at 4:19 PM, Alex Bowers wrote: > >> I don't see how the interface is equivalent. >> >> The

Re: [PHP-DEV] Re: [Concept] Magic Casting

2016-12-02 Thread Alex Bowers
On 2 December 2016 at 14:46, Andrey Andreev wrote: > A magic method is essentially an implicit interface ... > The interface itself does nothing. But when it is implemented, the engine > will know that the class constructor is public and accepts a single > parameter - thus, also knowing that it c

Re: [PHP-DEV] Re: [Concept] Magic Casting

2016-12-02 Thread Alex Bowers
On 2 December 2016 at 14:46, Andrey Andreev wrote: > What I meant is - you cannot cast to a class that requires more than one > dependency to be instantiated - that's the obvious limitation. Ah yes, that is certainly true, unless the other parameters can be determined / derived (e.g., injection

Re: [PHP-DEV] Re: [Concept] Magic Casting

2016-12-02 Thread Alex Bowers
On 2 December 2016 at 14:46, Andrey Andreev wrote: > It enables magic behavior, that's the opposite of enforcement ... If you > want to enFORCE something, you force the developer to do something, you > don't auto-magically do the thing for them. This magic behaviour would be for enforcement, be

Re: [PHP-DEV] Re: [RFC] Debugging PDO Prepared Statement Emulation v2

2016-12-02 Thread Adam Baratz
> > Could you please revert? Albeit minor, it's a new feature and therefore > it belongs to 7.2. No problem. Reverted.

Fwd: [PHP-DEV] Re: [Concept] Magic Casting

2016-12-02 Thread Alex Bowers
Sorry for forward. Hit reply, not reply-all. -- Forwarded message -- From: Alex Bowers Date: 2 December 2016 at 14:31 Subject: Re: [PHP-DEV] Re: [Concept] Magic Casting To: David Rodrigues Another benefit this would give frameworks / user land code is the ability to mock / simu

Fwd: [PHP-DEV] Re: [Concept] Magic Casting

2016-12-02 Thread Alex Bowers
Sorry for forward, hit reply not reply all. -- Forwarded message -- From: Alex Bowers Date: 2 December 2016 at 14:16 Subject: Re: [PHP-DEV] Re: [Concept] Magic Casting To: David Rodrigues var_dump was just an example to "show what type the variable is", and completely untested.

Re: [PHP-DEV] Re: [Concept] Magic Casting

2016-12-02 Thread Alex Bowers
Sorry for dupe, hit reply not reply-all. I don't see how the interface is equivalent. The benefit of this, is that you can convert types passed into a method to the type you expect automagically, Castable wouldn't allow that, only a new magic method (or reflection and user land code possibly?) wo

Re: [PHP-DEV] Re: [RFC] Debugging PDO Prepared Statement Emulation v2

2016-12-02 Thread Matteo Beccati
Hi, On 01/12/2016 18:38, Adam Baratz wrote: >> >> I'll incorporate it, and the content of this subthread, in the RFC when I >> get my next free five minutes. :) >> > > Done. And because of the scope of the v2 implementation, I changed the > target release to next 7.1.x. Could you please revert?

Re: [PHP-DEV] Re: [Concept] Magic Casting

2016-12-02 Thread Andrey Andreev
On Fri, Dec 2, 2016 at 4:53 PM, Alex Bowers wrote: > > On 2 December 2016 at 14:46, Andrey Andreev wrote: > >> A magic method is essentially an implicit interface ... >> The interface itself does nothing. But when it is implemented, the engine >> will know that the class constructor is public an

Re: [PHP-DEV] Re: [Concept] Magic Casting

2016-12-02 Thread Alex Bowers
On 2 December 2016 at 15:17, Andrey Andreev wrote: > Honestly, I don't see how a new method is in any way beneficial. I see your point now, and actually agree. An interface would be suitable and probably a better way to implement it.

Re: [PHP-DEV] Re: [Concept] Magic Casting

2016-12-02 Thread Alex Bowers
So I guess the new logic is, that the class being casted to, MUST have zero or one required parameter. It must not cast if already the same type. It must not cast to its own type (infinite loop)

[PHP-DEV] PHP 7.1.0 Released

2016-12-02 Thread Tom Worster
I saw "**PHP 7.1.0 Released**" on php.net yay! props to contributors. and thank you. tom

Re: [PHP-DEV] Re: [RFC] Debugging PDO Prepared Statement Emulation v2

2016-12-02 Thread Benoit Schildknecht
Le Fri, 02 Dec 2016 14:54:04 +0100, Matteo Beccati a écrit: On 02/12/2016 08:36, Thomas Nunninger wrote: Hi, So, if I only want to get the emulated prepared statement, I have to do ob_start()/ob_get_clean(), then use a regexp to fetch it ? I want v1 back T_T I second that. Why do you pri