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 > > 98e

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" : > > 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 only have s

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

2014-09-24 Thread Andrea Faulds
> On 25 Sep 2014, at 02:17, Stas Malyshev 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 >> actively harm

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.

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. Righ

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 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

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 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 > optimisation of the en

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] 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 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 Faulds http://ajf.

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

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 wrote: > > > Taking this sample code::: > > > > > class C { > >function __toString() { > >return "C"; > >} > > } > > > > $a = []; > > > > $c1 = new C(); > > $c2 = new C(); > >

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 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. Just read the docs

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 20:56, Stas Malyshev 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. via spl_object

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,

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 i

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 wrote: > Taking this sample code::: > > 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 this lea

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 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 problems that prevente

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 lon

[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] [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 E_RECOVE

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

2014-09-24 Thread Andrea Faulds
On 24 Sep 2014, at 16:04, Rowan Collins 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 surrou

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'

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

2014-09-24 Thread Andrea Faulds
On 24 Sep 2014, at 01:22, Stas Malyshev 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 bugs it could fi

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 wrote: > > > > On Tue, Sep 23, 2014 at 4:41 PM, Julien Pauli wrote: >> >> On Tue, Sep 23, 2014 at 3:24 PM, Ferenc Kovacs wrote: >> > >> > >> > On Tue, Sep 23, 2014 at 7:39 AM, Daniel Lowrey wrote: >> >> >> >> >> Hi, >> >> >> >> >> >> That's a bad t

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

2014-09-24 Thread Ferenc Kovacs
On Wed, Sep 24, 2014 at 2:33 PM, Leigh 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=revision&revision=331339 > > I can safely say that while I

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

2014-09-24 Thread Leigh
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=revision&revision=331339 I can safely say that while I don't necessarily love kittens, I accept that they are a nec

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::: There the assumption would be that this leads to an array $a w

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

2014-09-24 Thread Ferenc Kovacs
On Sat, Sep 20, 2014 at 3:26 PM, Leigh T 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 checked for sanity.

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 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). (David > > Zue

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 wrote: > On Tue, Sep 23, 2014 at 3:24 PM, Ferenc Kovacs wrote: > > > > > > On Tue, Sep 23, 2014 at 7:39 AM, Daniel Lowrey > wrote: > >> > >> >> Hi, > >> >> > >> >> That's a bad thing we need to fix ASAP. > >> >> > >> >> I think for 5.6.1 we'll rever

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" 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 a

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 uni

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.

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 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 entry: > > >