[PHP-DEV] [RFC] Fix "foreach" behavior

2015-01-29 Thread Dmitry Stogov
Hi, I'd like to start discussion about fixing inconsistent "foreach" statement behavior. The implementation is almost done. It not only fixes inconsistencies in a defined by RFC way but also improves performance in most usual cases, because now foreach by value over array doesn't require array dup

Re: [PHP-DEV] [RFC] [DISCUSSION] pecl_http

2015-01-29 Thread Michael Wallner
Hi Daniel! > On 30 01 2015, at 07:28, Daniel Lowrey wrote: > > Hi Mike :) > > I'd like to chime in on the discussion ... > > > 1. There is a lot of *really* useful functionality in pecl/http that IMO > should be bundled with the standard PHP distribution. > > This, to me, means things like p

RE: [PHP-DEV] Use "caller" keyword, to access object caller.

2015-01-29 Thread François Laupretre
> De : Larry Garfield [mailto:la...@garfieldtech.com] > > Having an object that behaves differently depending on an implicit > relationship with where it happened to be called from is full of all > kinds of impossible to debug magic. I don't even know how you'd unit > test it. I can think of no u

[PHP-DEV] Re: [RFC] [DISCUSSION] pecl_http

2015-01-29 Thread Daniel Lowrey
On Thu, Jan 29, 2015 at 8:14 PM, Michael Wallner wrote: > I’ve rewritten the RFC for pecl_http and hopefully addressed most of the > things mentioned previously. > > I you still find anything lacking, please let me know, so I can expand the > RFC accordingly. > > And of course, everything else is

Re: [PHP-DEV] Is it a good idea to have a "strict" mode?

2015-01-29 Thread Yasuo Ohgaki
Hi Cesar, On Fri, Jan 30, 2015 at 2:16 PM, César Rodas wrote: > I'm wondering if it would be a good idea to have a `strict` mode in PHP. > Many language have them and it is a good idea. > > I think it should be a bit different in PHP, it should encourage the > following things: > > - Avoid depr

[PHP-DEV] Is it a good idea to have a "strict" mode?

2015-01-29 Thread César Rodas
Hi! I'm wondering if it would be a good idea to have a `strict` mode in PHP. Many language have them and it is a good idea. I think it should be a bit different in PHP, it should encourage the following things: - Avoid deprecated things, it should throw an exception. - Avoid explicit conversio

Re: [PHP-DEV] Use "caller" keyword, to access object caller.

2015-01-29 Thread Larry Garfield
On 01/29/2015 10:30 PM, S.A.N wrote: I will clarify the benefits of the keyword. Single instance of the class can reused in different contexts calls. object = $c; $b->object = $c; $a->object->getCaller(); // return A $b->object->getCaller(); // return B $c->getCaller(); // Fatal Error - undefi

Re: [PHP-DEV] Use "caller" keyword, to access object caller.

2015-01-29 Thread S.A.N
I will clarify the benefits of the keyword. Single instance of the class can reused in different contexts calls. object = $c; $b->object = $c; $a->object->getCaller(); // return A $b->object->getCaller(); // return B $c->getCaller(); // Fatal Error - undefined caller context ?> 2015-01-30 5:50

Re: [PHP-DEV] Use "caller" keyword, to access object caller.

2015-01-29 Thread S.A.N
Yes. But this creates a static link that will not be constantly changing context to the calls, the keyword will give a dynamic abstract communication. 2015-01-30 5:50 GMT+02:00 Juan Basso : > Usually it is solved sending the $this instance to class C constructor and > C object storing it in some

Re: [PHP-DEV] Use "caller" keyword, to access object caller.

2015-01-29 Thread Juan Basso
Usually it is solved sending the $this instance to class C constructor and C object storing it in some attribute, solving the problem. I don't think a new keyword would help. Juan Basso On Thu, Jan 29, 2015 at 9:53 PM, S.A.N wrote: > The reason for creating circular references, usually due to t

[PHP-DEV] Use "caller" keyword, to access object caller.

2015-01-29 Thread S.A.N
The reason for creating circular references, usually due to the need to bind objects. But this relationship can often be obtained from the context of the call. It will be very convenient to have a keyword that will return reference to an object, which caused this object. Sorry for my English, I'

Re: [PHP-DEV] Use of {} with member.

2015-01-29 Thread Yasuo Ohgaki
Hi all, On Fri, Jan 30, 2015 at 8:51 AM, Rasmus Lerdorf wrote: > On 01/29/2015 01:32 PM, Yasuo Ohgaki wrote: > > Hi all, > > > > I came across with bug #68947 https://bugs.php.net/bug.php?id=68947 > > and realized small inconsistency. > > > > http://3v4l.org/ldZKl > > > > $obj->${array[$key]}; /

Re: [PHP-DEV] Use of {} with member.

2015-01-29 Thread Rasmus Lerdorf
On 01/29/2015 01:32 PM, Yasuo Ohgaki wrote: > Hi all, > > I came across with bug #68947 https://bugs.php.net/bug.php?id=68947 > and realized small inconsistency. > > http://3v4l.org/ldZKl > > $obj->${array[$key]}; // Syntax error > $obj->{$array[$key]}; // Works > > $obj->${key}; // E_NOTICE. D

Re: [PHP-DEV] Use of {} with member.

2015-01-29 Thread Andrey Andreev
Hi, On Fri, Jan 30, 2015 at 12:49 AM, Yasuo Ohgaki wrote: > Hi Andrea, > > On Fri, Jan 30, 2015 at 7:17 AM, Andrea Faulds wrote: >> >> I would expect that anything within ${} works the same as it does outside >> it. Having $obj->${array[$key]} do something different to $key = >> array[$key], $ob

Re: [PHP-DEV] Use of {} with member.

2015-01-29 Thread Yasuo Ohgaki
Hi Andrea, On Fri, Jan 30, 2015 at 7:17 AM, Andrea Faulds wrote: > I would expect that anything within ${} works the same as it does outside > it. Having $obj->${array[$key]} do something different to $key = > array[$key], $obj->${$key} would make no sense to me. Good point! I forgot about var

Re: [PHP-DEV] Use of {} with member.

2015-01-29 Thread Andrea Faulds
Hi Yasuo, > On 29 Jan 2015, at 22:14, Yasuo Ohgaki wrote: > > Hi Andrey, > > On Fri, Jan 30, 2015 at 6:43 AM, Andrey Andreev wrote: >> >> Is somebody actually recommending the latter form? I'm surprised that >> it even works ... that should be a syntax error IMO. > > > Do you mean > > echo

Re: [PHP-DEV] Use of {} with member.

2015-01-29 Thread Yasuo Ohgaki
Hi Andrey, On Fri, Jan 30, 2015 at 6:43 AM, Andrey Andreev wrote: > > Is somebody actually recommending the latter form? I'm surprised that > it even works ... that should be a syntax error IMO. Do you mean echo "${array[$key]}"; // Works should be errror? This form is common in shell scripti

Re: [PHP-DEV] Use of {} with member.

2015-01-29 Thread Andrey Andreev
Hi, On Thu, Jan 29, 2015 at 11:32 PM, Yasuo Ohgaki wrote: > Hi all, > > I came across with bug #68947 https://bugs.php.net/bug.php?id=68947 > and realized small inconsistency. > > http://3v4l.org/ldZKl > > $obj->${array[$key]}; // Syntax error > $obj->{$array[$key]}; // Works > > $obj->${key}; //

[PHP-DEV] Use of {} with member.

2015-01-29 Thread Yasuo Ohgaki
Hi all, I came across with bug #68947 https://bugs.php.net/bug.php?id=68947 and realized small inconsistency. http://3v4l.org/ldZKl $obj->${array[$key]}; // Syntax error $obj->{$array[$key]}; // Works $obj->${key}; // E_NOTICE. Does not work $obj->{$key}; // Works echo "${array[$key]}"; // Wor

Re: [PHP-DEV] [RFC] [DISCUSSION] pecl_http

2015-01-29 Thread Yasuo Ohgaki
Hi all, On Thu, Jan 29, 2015 at 9:18 PM, Crypto Compress < cryptocompr...@googlemail.com> wrote: > possible points: > - PHP-FIG propose no implementations; pecl_http does > - PHP-FIG focus on frameworks; pecl_http in core is useable without > dependencies by every simple script > - PSR-7 is a mov

[PHP-DEV] Re: [RFC] [DISCUSSION] pecl_http

2015-01-29 Thread Michael Wallner
> On 29 01 2015, at 12:14, Michael Wallner wrote: > > Hi! > > I’ve rewritten the RFC for pecl_http and hopefully addressed most of the > things mentioned previously. > > I you still find anything lacking, please let me know, so I can expand the > RFC accordingly. > > And of course, everythi

Re: [PHP-DEV] Improvements to for-each implementation

2015-01-29 Thread Dmitry Stogov
Hi, I've solved most of the reported problems and started working on RFC. Nikta, please take a look into: https://wiki.php.net/rfc/php7_foreach https://github.com/php/php-src/pull/1034 and especially commit 15a23b1 Only iteration by value over plain objects is not completely consistent now. Howe

Re: [PHP-DEV] [RFC] [DISCUSSION] pecl_http

2015-01-29 Thread Larry Garfield
On 1/29/15 6:40 AM, Andrea Faulds wrote: On 29 Jan 2015, at 12:18, Crypto Compress wrote: * Why should we have our own HTTP API and not follow PSR-7? possible points: - PHP-FIG propose no implementations; pecl_http does - native implementations should be faster I don’t see how that’s re

Re: [PHP-DEV] PHP 7 installation issues.

2015-01-29 Thread Ferenc Kovacs
On Thu, Jan 29, 2015 at 4:42 PM, Levi Morrison wrote: > > About the man page: what files do you have in php/man/man1 ? > > php.1 php-cgi.1 php-config.1 phpize.1 > > ^ Those four. Normally there are two more (phar.1 and phar.phar.1) > from looking my 5.6.3 install. Aside from that I'm

Re: [PHP-DEV] PHP 7 installation issues.

2015-01-29 Thread Levi Morrison
> About the man page: what files do you have in php/man/man1 ? php.1 php-cgi.1 php-config.1 phpize.1 ^ Those four. Normally there are two more (phar.1 and phar.phar.1) from looking my 5.6.3 install. Aside from that I'm not sure what else could be different. I'm not very familiar with

Re: [PHP-DEV] php7dev Vagrant box

2015-01-29 Thread Jan Schneider
Zitat von Ferenc Kovacs : On Thu, Jan 29, 2015 at 11:03 AM, Jan Schneider wrote: _Zitat von Ferenc Kovacs :_ _On Thu, Jan 29, 2015 at 9:57 AM, Jan Schneider wrote:_ _Zitat von Rasmus Lerdorf :_ _As a follow-up to my PHP7 Homework post last week, here is a bit of spoon-feeding for all

Re: [PHP-DEV] [RFC] [VOTE] pecl_http

2015-01-29 Thread Martin Keckeis
2015-01-29 14:07 GMT+01:00 Pavel Kouřil : > On Wed, Jan 28, 2015 at 1:17 PM, Michael Wallner wrote: > > Hi, > > > > Discussion has been very low on this topic since it was proposed on > > August 19th, so I just opened the vote on the RFC whether to add > > pecl_http to the core. The vote will be

Re: [PHP-DEV] [RFC] [VOTE] pecl_http

2015-01-29 Thread Pavel Kouřil
On Wed, Jan 28, 2015 at 1:17 PM, Michael Wallner wrote: > Hi, > > Discussion has been very low on this topic since it was proposed on > August 19th, so I just opened the vote on the RFC whether to add > pecl_http to the core. The vote will be open until about 12:00 UTC on > Friday, February 6th. >

Re: [PHP-DEV] PHP 7 installation issues.

2015-01-29 Thread Ferenc Kovacs
On Thu, Jan 29, 2015 at 3:49 AM, Levi Morrison wrote: > When doing `make install` with a prefix of `/apps/php/7.0.0-dev` I get: > > Installing shared extensions: > /apps/php/7.0.0-dev/lib/php/extensions/no-debug-non-zts-20141001/ > Installing PHP CLI binary:/apps/php/7.0.0-dev/bin/ > Inst

Re: [PHP-DEV] [RFC] [DISCUSSION] pecl_http

2015-01-29 Thread Andrea Faulds
> On 29 Jan 2015, at 12:18, Crypto Compress > wrote: > > >> * Why should we have our own HTTP API and not follow PSR-7? > > possible points: > - PHP-FIG propose no implementations; pecl_http does > - native implementations should be faster I don’t see how that’s relevant: I’m talking here ab

Re: [PHP-DEV] php7dev Vagrant box

2015-01-29 Thread Ferenc Kovacs
On Thu, Jan 29, 2015 at 11:03 AM, Jan Schneider wrote: > Zitat von Ferenc Kovacs : > > > > On Thu, Jan 29, 2015 at 9:57 AM, Jan Schneider wrote: > >> >> Zitat von Rasmus Lerdorf : >> >> >> As a follow-up to my PHP7 Homework post last week, here is a bit of >>> spoon-feeding for all you lurkers

Re: [PHP-DEV] [RFC] [DISCUSSION] pecl_http

2015-01-29 Thread Crypto Compress
* Why should we have our own HTTP API and not follow PSR-7? possible points: - PHP-FIG propose no implementations; pecl_http does - PHP-FIG focus on frameworks; pecl_http in core is useable without dependencies by every simple script - PSR-7 is a moving target; pecl_http exists for ten years

Re: [PHP-DEV] [RFC] [DISCUSSION] pecl_http

2015-01-29 Thread Lester Caine
On 29/01/15 11:40, Andrea Faulds wrote: > * Why do we need pecl/http? > * Why should pecl/http be merged into PHP core? > * Why should pecl/http be enabled by default? > * Why should we have our own HTTP API and not follow PSR-7? > * What does it offer over PHP’s existing HTTP capabilities? > * Why

Re: [PHP-DEV] [RFC] [DISCUSSION] pecl_http

2015-01-29 Thread Andrea Faulds
Hi Mike, > On 29 Jan 2015, at 11:14, Michael Wallner wrote: > > I’ve rewritten the RFC for pecl_http and hopefully addressed most of the > things mentioned previously. > > I you still find anything lacking, please let me know, so I can expand the > RFC accordingly. The RFC is an improvement

Re: [PHP-DEV] [RFC] [DISCUSSION] pecl_http

2015-01-29 Thread Michael Wallner
On 29/01/15 12:32, Yasuo Ohgaki wrote: > Hi Mike, > > Awesome work! > > On Thu, Jan 29, 2015 at 8:14 PM, Michael Wallner > wrote: > > I’ve rewritten the RFC for pecl_http and hopefully addressed most of > the things mentioned previously. > > I you still find an

Re: [PHP-DEV] [RFC] [DISCUSSION] pecl_http

2015-01-29 Thread Yasuo Ohgaki
Hi Mike, Awesome work! On Thu, Jan 29, 2015 at 8:14 PM, Michael Wallner wrote: > I’ve rewritten the RFC for pecl_http and hopefully addressed most of the > things mentioned previously. > > I you still find anything lacking, please let me know, so I can expand the > RFC accordingly. > > And of c

[PHP-DEV] [RFC] [DISCUSSION] pecl_http

2015-01-29 Thread Michael Wallner
Hi! I’ve rewritten the RFC for pecl_http and hopefully addressed most of the things mentioned previously. I you still find anything lacking, please let me know, so I can expand the RFC accordingly. And of course, everything else is up for discussion. Thanks, Mike -- PHP Internals - PHP Runt

Re: [PHP-DEV] [RFC] [VOTE] pecl_http

2015-01-29 Thread Andrey Andreev
Hi, On Thu, Jan 29, 2015 at 12:52 PM, Matteo Beccati wrote: > Hi Andrey, > > On 29/01/2015 10:41, Andrey Andreev wrote: >> >> It's not about whether we like the FIG's direction or what "PSR" >> stands for (which doesn't make sense btw) - that is indeed OT. >> >> My message was different: the PHP

Re: [PHP-DEV] [RFC] [VOTE] pecl_http

2015-01-29 Thread Matteo Beccati
Hi Andrey, On 29/01/2015 10:41, Andrey Andreev wrote: It's not about whether we like the FIG's direction or what "PSR" stands for (which doesn't make sense btw) - that is indeed OT. My message was different: the PHP RFC process can't get blocked because of a third-party group, especially if you

Re: [PHP-DEV] php7dev Vagrant box

2015-01-29 Thread Jan Schneider
Zitat von Ferenc Kovacs : On Thu, Jan 29, 2015 at 9:57 AM, Jan Schneider wrote: Zitat von Rasmus Lerdorf : As a follow-up to my PHP7 Homework post last week, here is a bit of spoon-feeding for all you lurkers on this list. https://atlas.hashicorp.com/_rasmus/boxes/php7dev_ _The descripti

Re: [PHP-DEV] [RFC] [VOTE] pecl_http

2015-01-29 Thread Andrey Andreev
Hi, On Thu, Jan 29, 2015 at 9:48 AM, Matteo Beccati wrote: > Hi Andrey, > > On 28/01/2015 23:50, Andrey Andreev wrote: >> >> You're voting "no" because the FIG can't agree yet? >> They've been discussing this for *at least* an year and iirc the first >> PSR-7 coordinator gave up on it because he

Re: [PHP-DEV] Session: PS(mod)->create() or PS(mod)->read() parameter?

2015-01-29 Thread Yasuo Ohgaki
Hi all, On Thu, Jan 29, 2015 at 5:24 PM, Yasuo Ohgaki wrote: > A new API seems really cleaner. > > > Reasonable discussion. I'll prepare API version patch later. This is the patch. It's not complete as user save handler requires more work. Simply read() is called as create() now. It's a PoC pa

Re: [PHP-DEV] PHP 7 installation issues.

2015-01-29 Thread Florian Anderiasch
On 01/29/2015 03:49 AM, Levi Morrison wrote: > When doing `make install` with a prefix of `/apps/php/7.0.0-dev` I get: > > Installing shared extensions: > /apps/php/7.0.0-dev/lib/php/extensions/no-debug-non-zts-20141001/ > Installing PHP CLI binary:/apps/php/7.0.0-dev/bin/ > Installing PHP

Re: [PHP-DEV] php7dev Vagrant box

2015-01-29 Thread Ferenc Kovacs
On Thu, Jan 29, 2015 at 9:57 AM, Jan Schneider wrote: > > Zitat von Rasmus Lerdorf : > > > As a follow-up to my PHP7 Homework post last week, here is a bit of >> spoon-feeding for all you lurkers on this list. >> >> https://atlas.hashicorp.com/rasmus/boxes/php7dev >> >> The description there sho

Re: [PHP-DEV] php7dev Vagrant box

2015-01-29 Thread Jan Schneider
Zitat von Rasmus Lerdorf : As a follow-up to my PHP7 Homework post last week, here is a bit of spoon-feeding for all you lurkers on this list. https://atlas.hashicorp.com/rasmus/boxes/php7dev The description there should be fairly self-explanatory. If you have a computer running Linux, OSX or

Re: [PHP-DEV] Session: PS(mod)->create() or PS(mod)->read() parameter?

2015-01-29 Thread Yasuo Ohgaki
Hi Remi, On Thu, Jan 29, 2015 at 5:17 PM, Remi Collet wrote: > > If there is no comment, I'll add new parameter since it's simpler. > > Changing a function prototype is very hard to detect at buildtime, > especially when playing with pointer. > > A new API seems really cleaner. Reasonable disc

Re: [PHP-DEV][RFC] Enable error_handler callback parameters to be passed by reference

2015-01-29 Thread Yasuo Ohgaki
Hi Thomas, On Thu, Jan 29, 2015 at 4:55 PM, Thomas Bley wrote: > I think you mean: > function myErrorHandler( int $errno , string $errstr [, string $errfile [, > int $errline [, array $errcontext [, string &$extra_errstr ) > Yes. > > We have these empty-call-filled-on-return parameters i

Re: [PHP-DEV] Session: PS(mod)->create() or PS(mod)->read() parameter?

2015-01-29 Thread Remi Collet
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Le 29/01/2015 08:00, Yasuo Ohgaki a écrit : > If there is no comment, I'll add new parameter since it's simpler. Changing a function prototype is very hard to detect at buildtime, especially when playing with pointer. A new API seems really cleaner.

[PHP-DEV] Re: Session: PS(mod)->create() or PS(mod)->read() parameter?

2015-01-29 Thread Yasuo Ohgaki
Hi all, On Thu, Jan 29, 2015 at 4:00 PM, Yasuo Ohgaki wrote: > I would like to improve session save handler module API for PHP7. > When new session data is created, some save handlers need to create > new session data explicitly. e.g. RDBMS based save handler. > > New session module validates se