Re: [PHP-DEV] Improve PHP 7 serialization

2014-09-24 Thread Pierre Joye
On Sep 23, 2014 8:07 PM, Leigh lei...@gmail.com wrote: On 23 September 2014 17:36, Park Framework park.framew...@gmail.com wrote: If you do not update in PHP 7 serialization method, it will never be updated, the default serialization in PHP 7 will be slow. To maintain backward

Re: [PHP-DEV] Invokation on __toString() for object used as array key

2014-09-24 Thread Stas Malyshev
Hi! Well, then let's remove this restriction from resources, too. Not sure what use would it be for resources - resource IDs are not controlled by user code and for all intents and purposes are opaque numbers, which also do not have to be unique over the life of the script. What use would it be

Re: [PHP-DEV] Internationalized Domain Name support in FILTER_VALIDATE_URL

2014-09-24 Thread Pierre Joye
On Wed, Sep 24, 2014 at 2:48 AM, Stas Malyshev smalys...@sugarcrm.com wrote: Hi! I'll implement optional (and not default) support of IDN in filter_var(). Does anyone known if it's better to use libIDN (LGPL) or ICU (custom license deviated from the X license) from a license point of view?

Re: [PHP-DEV] PHP 5.4.33 RC1 = mod_proxy_fcgi still broken

2014-09-24 Thread Ferenc Kovacs
On Mon, Sep 15, 2014 at 8:37 AM, Remi Collet r...@fedoraproject.org wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Le 11/09/2014 09:19, Remi Collet a écrit : Le 11/09/2014 09:16, Remi Collet a écrit : Le 09/09/2014 07:54, Stas Malyshev a écrit : The big issue I see, is the news

Re: [PHP-DEV] PHP 5.4.33 RC1 = mod_proxy_fcgi still broken

2014-09-24 Thread Remi Collet
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Le 24/09/2014 09:33, Ferenc Kovacs a écrit : We could have used the same NEWS entry from 5.6 I suppose: . Fixed bug #67606 (revised fix 67541, broke mod_fastcgi BC). (David Zuelke) I fixed NEWS in 5.4 / 5.5 before the release (5.4.33 / 5.5.17)

Re: [PHP-DEV] Invokation on __toString() for object used as array key

2014-09-24 Thread Michael Wallner
On 24/09/14 08:30, Stas Malyshev wrote: Hi! Well, then let's remove this restriction from resources, too. Not sure what use would it be for resources - resource IDs are not controlled by user code and for all intents and purposes are opaque numbers, which also do not have to be unique

Re: [PHP-DEV] Invokation on __toString() for object used as array key

2014-09-24 Thread Pierre Joye
On Sep 24, 2014 10:19 AM, Michael Wallner m...@php.net wrote: On 24/09/14 08:30, Stas Malyshev wrote: Hi! Well, then let's remove this restriction from resources, too. Not sure what use would it be for resources - resource IDs are not controlled by user code and for all intents and

Re: [PHP-DEV] Re: Re: OpenSSL bug in 5.4.33 and 5.5.17

2014-09-24 Thread Ferenc Kovacs
On Tue, Sep 23, 2014 at 4:41 PM, Julien Pauli jpa...@php.net wrote: On Tue, Sep 23, 2014 at 3:24 PM, Ferenc Kovacs tyr...@gmail.com wrote: On Tue, Sep 23, 2014 at 7:39 AM, Daniel Lowrey rdlow...@gmail.com wrote: Hi, That's a bad thing we need to fix ASAP. I think for

Re: [PHP-DEV] PHP 5.4.33 RC1 = mod_proxy_fcgi still broken

2014-09-24 Thread Ferenc Kovacs
On Wed, Sep 24, 2014 at 10:12 AM, Remi Collet r...@fedoraproject.org wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Le 24/09/2014 09:33, Ferenc Kovacs a écrit : We could have used the same NEWS entry from 5.6 I suppose: . Fixed bug #67606 (revised fix 67541, broke mod_fastcgi BC).

Re: [PHP-DEV] VCS Account Request: leigh

2014-09-24 Thread Ferenc Kovacs
On Sat, Sep 20, 2014 at 3:26 PM, Leigh T leight+...@gmail.com wrote: Over the past 3 years I have made several small code and documentation contributions to the project. I do *not* want php-src commit access. I want to submit all of my contributions via pull request and have them double

Re: [PHP-DEV] Invokation on __toString() for object used as array key

2014-09-24 Thread Johannes Schlüter
Hi, On Tue, 2014-09-23 at 10:04 +0200, Nicolai Scheer wrote: until 5 minutes ago I thought it would be perfectly legal to use an object as an array key, given that its __toString() method is in place. Taking this sample code::: ?php class C { function __toString() { return C;

Re: [PHP-DEV] VCS Account Request: leigh

2014-09-24 Thread Ferenc Kovacs
On Wed, Sep 24, 2014 at 2:33 PM, Leigh lei...@gmail.com wrote: I currently have a patch awaiting review in the online editor. I have done a few in the past but am having trouble locating them. Found a small one: http://svn.php.net/viewvc/?view=revisionamp;revision=331339 I can safely say

Re: [PHP-DEV] Re: Re: OpenSSL bug in 5.4.33 and 5.5.17

2014-09-24 Thread Daniel Lowrey
On Wed, Sep 24, 2014 at 5:41 AM, Ferenc Kovacs tyr...@gmail.com wrote: On Tue, Sep 23, 2014 at 4:41 PM, Julien Pauli jpa...@php.net wrote: On Tue, Sep 23, 2014 at 3:24 PM, Ferenc Kovacs tyr...@gmail.com wrote: On Tue, Sep 23, 2014 at 7:39 AM, Daniel Lowrey rdlow...@gmail.com wrote:

Re: [PHP-DEV] [RFC] ZPP Failure On Overflow

2014-09-24 Thread Andrea Faulds
On 24 Sep 2014, at 01:22, Stas Malyshev smalys...@sugarcrm.com wrote: It would be nice to describe why this change is good. So far the motivation is it is unintuitive which is a fancy way of saying I don't like it. Could you list which use cases this functionality improves, which real-life

Re: [PHP-DEV] [RFC] ZPP Failure On Overflow

2014-09-24 Thread Rowan Collins
Andrea Faulds wrote (on 24/09/2014): Especially a BC break in a form of it worked before but now it fails - this can break code in so many hard to catch ways, where you didn't actually care at the least if the function truncates the arg (common situation in proxy/glue libraries, etc. - they'd be

Re: [PHP-DEV] [RFC] ZPP Failure On Overflow

2014-09-24 Thread Andrea Faulds
On 24 Sep 2014, at 16:04, Rowan Collins rowan.coll...@gmail.com wrote: That said, most cases of garbage in, garbage out would presumably remain so, since most ZPP failures result in a return of NULL or FALSE, which would probably end up cast back to the expected type (int(0), string(''),

Re: [PHP-DEV] [RFC] ZPP Failure On Overflow

2014-09-24 Thread Stas Malyshev
Hi! That said, most cases of garbage in, garbage out would presumably remain so, since most ZPP failures result in a return of NULL or FALSE, which would probably end up cast back to the expected type (int(0), string(''), etc) by the surrounding code. Right. It’s not an

[PHP-DEV] [VOTE] Remove alternative PHP tags

2014-09-24 Thread Nikita Popov
Hi internals! The vote for removal of alternative PHP opening/closing tags in PHP 7 is now open: https://wiki.php.net/rfc/remove_alternative_php_tags#vote Nikita

Re: [PHP-DEV] Invokation on __toString() for object used as array key

2014-09-24 Thread Stas Malyshev
Hi! I also wonder why we still need them. Doing what has been done with gmp for all resources would be a good move for 7. In general, I think we do not - IIRC everything resources do objects can do better now, and the problems that prevented one from using objects instead of resources are long

Re: [PHP-DEV] Invokation on __toString() for object used as array key

2014-09-24 Thread Andrea Faulds
On 24 Sep 2014, at 20:39, Stas Malyshev smalys...@sugarcrm.com wrote: I also wonder why we still need them. Doing what has been done with gmp for all resources would be a good move for 7. In general, I think we do not - IIRC everything resources do objects can do better now, and the

Re: [PHP-DEV] Invokation on __toString() for object used as array key

2014-09-24 Thread Andrea Faulds
On 24 Sep 2014, at 13:24, Johannes Schlüter johan...@schlueters.de wrote: Taking this sample code::: ?php class C { function __toString() { return C; } } $a = []; $c1 = new C(); $c2 = new C(); $a[$c1] = 23; $a[$c2] = 42; ? There the assumption would be that

Re: [PHP-DEV] Invokation on __toString() for object used as array key

2014-09-24 Thread Stas Malyshev
Hi! There the assumption would be that this leads to an array $a with two elements, where in fact there is only one if __toString() is being called. The only thing making sense would be using using the objects identity (i.e. via spl_object_hash()) everything else leads to issues. This is a

Re: [PHP-DEV] Invokation on __toString() for object used as array key

2014-09-24 Thread Stas Malyshev
Hi! I already figured out how to solve the `is_resource()` issue. Create an almost-useless, uninstantiatable class called Resource which any new resource-replacing classes inherit from. Then, make `is_resource()` check whether something is an instance of that class. This is a nice idea, but

Re: [PHP-DEV] Invokation on __toString() for object used as array key

2014-09-24 Thread Andrea Faulds
On 24 Sep 2014, at 20:56, Stas Malyshev smalys...@sugarcrm.com wrote: There the assumption would be that this leads to an array $a with two elements, where in fact there is only one if __toString() is being called. The only thing making sense would be using using the objects identity (i.e.

Re: [PHP-DEV] Invokation on __toString() for object used as array key

2014-09-24 Thread Stas Malyshev
Hi! I’m not sure that’d make much sense. The object isn’t the key, the value the magic method returns is. It would be quite odd to do this: $someArray = [$my__hashImplementingObject = 1]; var_dump($someArray); And see something like this, because we’ve called a hash function:

Re: [PHP-DEV] Invokation on __toString() for object used as array key

2014-09-24 Thread Andrea Faulds
On 24 Sep 2014, at 21:08, Stas Malyshev smalys...@sugarcrm.com wrote: The hash doesn't have to be a nonsensical hex value, it can be something like My Object Number 42 if you want to. The difference is that __toString is for human reading, and it's not always suitable for hashing purposes.

Re: [PHP-DEV] Invokation on __toString() for object used as array key

2014-09-24 Thread Johannes Schlüter
On Wed, 2014-09-24 at 20:45 +0100, Andrea Faulds wrote: On 24 Sep 2014, at 13:24, Johannes Schlüter johan...@schlueters.de wrote: Taking this sample code::: ?php class C { function __toString() { return C; } } $a = []; $c1 = new C(); $c2 = new C();

Re: [PHP-DEV] Little switch improvement: get the used variable

2014-09-24 Thread Rowan Collins
On 23/09/2014 08:29, Sanford Whiteman wrote: The `get_the_used_switch_variable()` is just a placeholder, name can be changed to something natural...maybe a constant. I feel this has diminished utility once you consider that the switch variable is actually an expression and could well include

Re: [PHP-DEV] Invokation on __toString() for object used as array key

2014-09-24 Thread Andrea Faulds
On 24 Sep 2014, at 21:46, Johannes Schlüter johan...@schlueters.de wrote: I don't think there is a clear leader on usage of __toString(), for some it is a debugging feature, for some a normal operation. If people want debugging, there is a method specifically for that, __debugInfo. -- Andrea

Re: [PHP-DEV] Little switch improvement: get the used variable

2014-09-24 Thread Sanford Whiteman
You can already do: $a = 1; $b = 2; switch( $switch_value = $a + $b ) { default: print $switch_value; } No magic or new operator required -- S. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Little switch improvement: get the used variable

2014-09-24 Thread Andrea Faulds
On 24 Sep 2014, at 22:17, Rowan Collins rowan.coll...@gmail.com wrote: Perhaps rather than a magic function or constant, though, the switch statement could be extended with an as argument, which would store the evaluated expression into a normal variable, allowing nesting, and easier

Re: [PHP-DEV] Little switch improvement: get the used variable

2014-09-24 Thread Rowan Collins
On 24/09/2014 22:33, Andrea Faulds wrote: On 24 Sep 2014, at 22:17, Rowan Collins rowan.coll...@gmail.com wrote: Perhaps rather than a magic function or constant, though, the switch statement could be extended with an as argument, which would store the evaluated expression into a normal

Re: [PHP-DEV] [RFC] ZPP Failure On Overflow

2014-09-24 Thread Rowan Collins
On 24/09/2014 18:40, Stas Malyshev wrote: That said, most cases of garbage in, garbage out would presumably remain so, since most ZPP failures result in a return of NULL or FALSE, which would probably end up cast back to the expected type (int(0), string(''), etc) by the surrounding code.

Re: [PHP-DEV] [RFC] ZPP Failure On Overflow

2014-09-24 Thread Stas Malyshev
Hi! So, the problem comes with built-in functions, which have some side effect, which can be usefully run with a bogus value for an integer argument. In contrast, any function which has some side effect which is actively harmful given a bogus value would be a beneficiary of the change. No

Re: [PHP-DEV] [RFC] ZPP Failure On Overflow

2014-09-24 Thread Andrea Faulds
On 25 Sep 2014, at 02:17, Stas Malyshev smalys...@sugarcrm.com wrote: Hi! So, the problem comes with built-in functions, which have some side effect, which can be usefully run with a bogus value for an integer argument. In contrast, any function which has some side effect which is

Re: [PHP-DEV] Invokation on __toString() for object used as array key

2014-09-24 Thread Patrick Schaaf
Am 24.09.2014 22:01 schrieb Andrea Faulds a...@ajf.me: Now, if we were to add actual object key support, that I might like. But if we’re going to keep with just integers and strings, I’d much prefer to just support __toString here. I think users are smart enough to understand that PHP arrays

Re: [PHP-DEV] Re: Re: OpenSSL bug in 5.4.33 and 5.5.17

2014-09-24 Thread Daniel Lowrey
FYI: I've tagged 5.6.1 and I had to revert the following commits for this: 372844918a318ad712e16f9ec636682424a65403 f86b2193a483f56b0bd056570a0cdb57ebe66e2f 30a73658c63a91c413305a4c4d49882fda4dab3e 84a4041ba47e92e7a0ba03938d0ebf88b5fcf6cf 98e67add15a6b889efe152c23ed15a61f022a63a