Re: [PHP-DEV] Add a constant to reflect --with-curlwrappers

2013-04-05 Thread Pierre Joye
On Thu, Apr 4, 2013 at 9:52 PM, Hannes Magnusson hannes.magnus...@gmail.com wrote: Its not only about maintaining it. This experiment failed a long time ago. Overwriting the core streams has proven itself to be the wrong way. I cannot agree more. If there was a way for userspace to say

RE: [PHP-DEV] a couple of thoughts on the DateTime type debate

2013-04-05 Thread Richard Bradley
On Thu, Apr 4, 2013 at 12:57 PM, Benjamin Eberlei kont...@beberlei.dewrote: structs as in c# don't have methods, however DateTime has them. so this doesn't work. What you can do is just pass all the data in the constructor and then don't change it, and you have your value type that is

Re: [PHP-DEV] a couple of thoughts on the DateTime type debate

2013-04-05 Thread Madara Uchiha
After discussing things over the PHP chat on Stack Overflow, I realized I misread and missed the point. Good suggestion, you have my +1. On Fri, Apr 5, 2013 at 11:01 AM, Richard Bradley richard.brad...@softwire.com wrote: On Thu, Apr 4, 2013 at 12:57 PM, Benjamin Eberlei

Re: [PHP-DEV] a couple of thoughts on the DateTime type debate

2013-04-05 Thread Joe Watkins
On 04/05/2013 09:31 AM, Madara Uchiha wrote: After discussing things over the PHP chat on Stack Overflow, I realized I misread and missed the point. Good suggestion, you have my +1. On Fri, Apr 5, 2013 at 11:01 AM, Richard Bradley richard.brad...@softwire.com wrote: On Thu, Apr 4, 2013 at

Re: [PHP-DEV] Add a constant to reflect --with-curlwrappers

2013-04-05 Thread Julien Pauli
On Fri, Apr 5, 2013 at 8:01 AM, Pierre Joye pierre@gmail.com wrote: On Thu, Apr 4, 2013 at 9:52 PM, Hannes Magnusson hannes.magnus...@gmail.com wrote: Its not only about maintaining it. This experiment failed a long time ago. Overwriting the core streams has proven itself to be the

[PHP-DEV] Inconsistency in class definition/usage order

2013-04-05 Thread Madara Uchiha
After I saw this question on Stack Overflow: http://stackoverflow.com/questions/15688642/how-does-a-class-extension-or-interface-work, I realized that the guy was right. Is there an explanation for this, or is it just one of those things that got overlooked? Should something be done? (i.e.

[PHP-DEV] Re: Inconsistency in class definition/usage order

2013-04-05 Thread Joe Watkins
On 04/05/2013 11:39 AM, Madara Uchiha wrote: After I saw this question on Stack Overflow: http://stackoverflow.com/questions/15688642/how-does-a-class-extension-or-interface-work, I realized that the guy was right. Is there an explanation for this, or is it just one of those things that got

Re: [PHP-DEV] Add a constant to reflect --with-curlwrappers

2013-04-05 Thread Johannes Schlüter
On Fri, 2013-04-05 at 08:01 +0200, Pierre Joye wrote: stream_wrapper_unregister(http); stream_wrapper_register(http, CurlStreamWrapper); and then stream_wrapper_restore(http) to go back to the core streams. I wonder what one will do with open streams during the switches. That can't go

[PHP-DEV] Proposal to document all of Zend and PHP API and SAPI layers

2013-04-05 Thread Joe Watkins
Morning All, Further to discussion in IRC this morning, I'd like to propose what amounts to, I guess, a sub-project to properly document everything, starting with everything declared ZEND_API in /Zend. We put a lot of effort into the generation and maintenance of user land documentation,

[PHP-DEV] Re: Inconsistency in class definition/usage order

2013-04-05 Thread Madara Uchiha
That's not the problem, the problem is when you extend a class with a (defined) interface, you can't use the class before it is defined (the class, not the interface). See the examples on the linked question. On Fri, Apr 5, 2013 at 1:48 PM, Joe Watkins krak...@php.net wrote: On 04/05/2013 11:39

[PHP-DEV] Re: Inconsistency in class definition/usage order

2013-04-05 Thread Joe Watkins
On 04/05/2013 12:01 PM, Madara Uchiha wrote: That's not the problem, the problem is when you extend a class with a (defined) interface, you can't use the class before it is defined (the class, not the interface). See the examples on the linked question. On Fri, Apr 5, 2013 at 1:48 PM, Joe

Re: [PHP-DEV] Inconsistency in class definition/usage order

2013-04-05 Thread Nikita Popov
On Fri, Apr 5, 2013 at 12:39 PM, Madara Uchiha dor.tchi...@gmail.comwrote: After I saw this question on Stack Overflow: http://stackoverflow.com/questions/15688642/how-does-a-class-extension-or-interface-work , I realized that the guy was right. Is there an explanation for this, or is it

Re: [PHP-DEV] Proposal to document all of Zend and PHP API and SAPI layers

2013-04-05 Thread Ferenc Kovacs
On Fri, Apr 5, 2013 at 1:00 PM, Joe Watkins krak...@php.net wrote: Morning All, Further to discussion in IRC this morning, I'd like to propose what amounts to, I guess, a sub-project to properly document everything, starting with everything declared ZEND_API in /Zend. We

Re: [PHP-DEV] Proposal to document all of Zend and PHP API and SAPI layers

2013-04-05 Thread Johannes Schlüter
On Fri, 2013-04-05 at 14:09 +0200, Ferenc Kovacs wrote: I think that it everybody would support that idea, unfortunatelly not many people have the knowledge AND the time to write up that kind of documentation. That is the key part. There's no worse documentation than wrong documentation.

Re: [PHP-DEV] Re: libmagic 5.14 upgrade

2013-04-05 Thread Anatol Belski
Stas, how does it look with this one? Please let me know whether it's ok for 5.4. I would go with master otherwise. Thanks Anatol On Mon, 2013-04-01 at 19:13 +0200, Anatol Belski wrote: Stas, I've invested more time and here's almost cleaned up patch

Re: [PHP-DEV] Proposal to document all of Zend and PHP API andSAPI layers

2013-04-05 Thread Joe Watkins
On 04/05/2013 01:23 PM, Johannes Schlüter wrote: On Fri, 2013-04-05 at 14:09 +0200, Ferenc Kovacs wrote: I think that it everybody would support that idea, unfortunatelly not many people have the knowledge AND the time to write up that kind of documentation. That is the key part. There's no

Re: [PHP-DEV] a couple of thoughts on the DateTime type debate

2013-04-05 Thread Rasmus Schultz
See the Structs Tutorial at msdn for a brief summary of structs in C# - http://msdn.microsoft.com/en-us/library/aa288471(v=vs.71).aspx Looking at that code sample, yes - that is more or less exactly what I had in mind. I take back my last remark - I don't think the similarity in syntax is

Re: [PHP-DEV] a couple of thoughts on the DateTime type debate

2013-04-05 Thread Rasmus Schultz
If structs were even somehow interchangeable with real arrays, that might be a really useful side gain: $white = new Color(1, 1, 1); $red = $white-r; // it's a struct $green = $white['r']; // it's an array $type = $white['__struct']; // = 'Color' $array = ['r'=1, 'g'=1, 'b'=1,

Re: [PHP-DEV] Proposal to document all of Zend and PHP API andSAPI layers

2013-04-05 Thread Hannes Magnusson
On Fri, Apr 5, 2013 at 5:48 AM, Joe Watkins krak...@php.net wrote: On 04/05/2013 01:23 PM, Johannes Schlüter wrote: On Fri, 2013-04-05 at 14:09 +0200, Ferenc Kovacs wrote: I think that it everybody would support that idea, unfortunatelly not many people have the knowledge AND the time to

RE: [PHP-DEV] a couple of thoughts on the DateTime type debate

2013-04-05 Thread Richard Bradley
On Fri, Apr 5, 2013 at 8:50 AM, Rasmus Schultz ras...@mindplay.dk wrote: See the Structs Tutorial at msdn for a brief summary of structs in C# - http://msdn.microsoft.com/en-us/library/aa288471(v=vs.71).aspx Looking at that code sample, yes - that is more or less exactly what I had in

[PHP-DEV] Re: [lists.php] Re: [PHP-DEV] a couple of thoughts on the DateTime type debate

2013-04-05 Thread ALeX
I imagine the implementation could be something along the lines of checking for the '__struct' key when somebody attempts to use method-call syntax on an array, invoking the appropriate method with $this referencing the array you were using. The rest of the time, a struct, for all intents

Re: [PHP-DEV] Add a constant to reflect --with-curlwrappers

2013-04-05 Thread Julien Pauli
On Fri, Apr 5, 2013 at 12:51 PM, Johannes Schlüter johan...@schlueters.dewrote: On Fri, 2013-04-05 at 08:01 +0200, Pierre Joye wrote: stream_wrapper_unregister(http); stream_wrapper_register(http, CurlStreamWrapper); and then stream_wrapper_restore(http) to go back to the core

[PHP-DEV] Removing old pre_41 zend_module_entry struct checks while loading exts

2013-04-05 Thread Julien Pauli
All is into the title. A patch can be found here https://github.com/jpauli/php-src/compare/remove_dl_php4_support The idea is to get rid of those old stuff, like we did with session.compat some time ago. If you have ideas, improvements ... Joe also talked about adding a header to the

[PHP-DEV] Re: [lists.php] Re: [PHP-DEV] a couple of thoughts on the DateTime type debate

2013-04-05 Thread Rasmus Schultz
On the other hand, I would just use an array. (without any magic like methods on structs, yes you would have to write plain functions and not use OOP like methods). Yeah, that's what people are doing right now - the problem with that, is you have the class-name referenced on every call, e.g.:

[PHP-DEV] Re: [lists.php] Re: [PHP-DEV] a couple of thoughts on the DateTime type debate

2013-04-05 Thread Rasmus Schultz
why not make struct almost like a class except that $this is a copy (on write) - modifying and returning $this would be a new instance of that struct/class. That would give you public/private/static/variables/methods/interfaces/..., but it would lead to another type. As said, I don't know

Re: [PHP-DEV] Add a constant to reflect --with-curlwrappers

2013-04-05 Thread Hannes Magnusson
On Fri, Apr 5, 2013 at 7:14 AM, Julien Pauli jpa...@php.net wrote: On Fri, Apr 5, 2013 at 12:51 PM, Johannes Schlüter johan...@schlueters.de wrote: On Fri, 2013-04-05 at 08:01 +0200, Pierre Joye wrote: stream_wrapper_unregister(http); stream_wrapper_register(http, CurlStreamWrapper);

Re: [PHP-DEV] Proposal to document all of Zend and PHP API and SAPI layers

2013-04-05 Thread Stas Malyshev
Hi! I am also aware of some documentation included in the PHP manual currently, which should also be completed, and included, with all of the API in a searchable format, just like PHP is in userland. That is a good idea. Do it :) Ideally, it would be nice to document the API

[PHP-DEV] Re: Proposal to document all of Zend and PHP API and SAPI layers

2013-04-05 Thread Joe Watkins
On 04/05/2013 12:00 PM, Joe Watkins wrote: Morning All, Further to discussion in IRC this morning, I'd like to propose what amounts to, I guess, a sub-project to properly document everything, starting with everything declared ZEND_API in /Zend. We put a lot of effort into the

Re: [PHP-DEV] Re: [lists.php] Re: [PHP-DEV] a couple of thoughts on the DateTime type debate

2013-04-05 Thread David Muir
On 06/04/2013, at 1:40 AM, Rasmus Schultz ras...@mindplay.dk wrote: why not make struct almost like a class except that $this is a copy (on write) - modifying and returning $this would be a new instance of that struct/class. That would give you