Re: [PHP-DEV] Two small const correctness changes

2014-12-04 Thread Xinchen Hui
Hey: On Fri, Dec 5, 2014 at 8:08 AM, Levi Morrison wrote: > These changes make ZVAL_COPY and ZVAL_COPY_VALUE work without warning > for places where the zval that is copied is const: > https://gist.github.com/morrisonlevi/69156fdf93e6bc82f9a0 > > In the default build there do not seem to be any p

[PHP-DEV] Re: Only variables can be passed by reference

2014-12-04 Thread Yasuo Ohgaki
Hi all, On Thu, Dec 4, 2014 at 5:28 PM, Yasuo Ohgaki wrote: > I think we can get rid of this error now when literal is returned. > The reason we have E_STRICT error is that legacy PHP didn't > support this, I suppose. > > http://3v4l.org/8fISj > > Is it possible to allow literal as referenced pa

[PHP-DEV] Two small const correctness changes

2014-12-04 Thread Levi Morrison
These changes make ZVAL_COPY and ZVAL_COPY_VALUE work without warning for places where the zval that is copied is const: https://gist.github.com/morrisonlevi/69156fdf93e6bc82f9a0 In the default build there do not seem to be any places where this causes a warning, but I noticed it in an extension I

Fwd: Re: [PHP-DEV] Re: Only variables can be passed by reference

2014-12-04 Thread Chris Wright
Forgot to cc list, see below -- Forwarded message -- From: "Chris Wright" Date: 4 Dec 2014 14:09 Subject: Re: [PHP-DEV] Re: Only variables can be passed by reference To: "Andrea Faulds" Cc: > On 4 December 2014 at 12:26, Andrea Faulds wrote: >> >> >> > On 4 Dec 2014, at 10:38,

Re: [PHP-DEV] Re: Only variables can be passed by reference

2014-12-04 Thread Yasuo Ohgaki
Hi Levi, On Fri, Dec 5, 2014 at 8:14 AM, Levi Morrison wrote: > > Even when there is parameter to pass, user has to create variable always. > > > > select_select([$a], [$b], [$c], 10); > > > > fails with E_ERROR, while > > > > $x = [$a]; > > $y = [$b]; > > $z = [$c]; > > stream_select($x, $y, $z

Re: [PHP-DEV] Only variables can be passed by reference

2014-12-04 Thread Andrea Faulds
> On 4 Dec 2014, at 19:58, Kalle Sommer Nielsen wrote: > > I think we should solve these on a case-by-case basis, I can think of > one reason why the warning exists, and that is because it modifies the > array pointer and the argument is sent by reference. But I think we > can safely remove the

Re: [PHP-DEV] Re: Only variables can be passed by reference

2014-12-04 Thread Levi Morrison
> Even when there is parameter to pass, user has to create variable always. > > select_select([$a], [$b], [$c], 10); > > fails with E_ERROR, while > > $x = [$a]; > $y = [$b]; > $z = [$c]; > stream_select($x, $y, $z, 10); > > works, but It does not look nice. >From the documentation: "Also do not f

Re: [PHP-DEV] Re: Only variables can be passed by reference

2014-12-04 Thread Yasuo Ohgaki
Hi Andrea, Stas and all On Thu, Dec 4, 2014 at 9:26 PM, Andrea Faulds wrote: > > > $sock = fsockopen('www.php.net', '80'); > > var_dump($sock); > > > > $socks = array($sock); > > var_dump(stream_select($socks, $socks, $socks, 1)); > > > > //var_dump(stream_select(array($sock), array($sock), arr

Re: [PHP-DEV] Only variables can be passed by reference

2014-12-04 Thread Levi Morrison
> Thoughts? The only reason to take a parameter by reference is because you modify the variable that the caller is passing in. Passing in constants is *almost certainly* an error. I would rather have the warnings than remove them. -- PHP Internals - PHP Runtime Development Mailing List To unsubs

Re: [PHP-DEV] Only variables can be passed by reference

2014-12-04 Thread Kalle Sommer Nielsen
Hi Yasuo 2014-12-04 9:28 GMT+01:00 Yasuo Ohgaki : > Any comments? > > Regards, > > -- > Yasuo Ohgaki > yohg...@ohgaki.net I think we should solve these on a case-by-case basis, I can think of one reason why the warning exists, and that is because it modifies the array pointer and the argument is

Re: [PHP-DEV] [RFC] Turn gc_collect_cycles into a function pointer

2014-12-04 Thread Chris Wright
On 4 December 2014 at 14:26, Ferenc Kovacs wrote: > On Thu, Dec 4, 2014 at 1:17 PM, Julien Pauli wrote: > > > On Thu, Dec 4, 2014 at 12:39 PM, Ferenc Kovacs wrote: > > > > > > > > > On Thu, Dec 4, 2014 at 11:53 AM, Julien Pauli wrote: > > >> > > >> On Thu, Dec 4, 2014 at 9:30 AM, Benjamin Eber

Re: [PHP-DEV] [RFC] Turn gc_collect_cycles into a function pointer

2014-12-04 Thread Benjamin Eberlei
On Thu, Dec 4, 2014 at 3:26 PM, Ferenc Kovacs wrote: > > > On Thu, Dec 4, 2014 at 1:17 PM, Julien Pauli wrote: > >> On Thu, Dec 4, 2014 at 12:39 PM, Ferenc Kovacs wrote: >> > >> > >> > On Thu, Dec 4, 2014 at 11:53 AM, Julien Pauli wrote: >> >> >> >> On Thu, Dec 4, 2014 at 9:30 AM, Benjamin Ebe

Re: [PHP-DEV] [RFC] Turn gc_collect_cycles into a function pointer

2014-12-04 Thread Ferenc Kovacs
On Thu, Dec 4, 2014 at 1:17 PM, Julien Pauli wrote: > On Thu, Dec 4, 2014 at 12:39 PM, Ferenc Kovacs wrote: > > > > > > On Thu, Dec 4, 2014 at 11:53 AM, Julien Pauli wrote: > >> > >> On Thu, Dec 4, 2014 at 9:30 AM, Benjamin Eberlei > >> wrote: > >> > Good morning, > >> > > >> > This is just a

Re: [PHP-DEV] [RFC] Turn gc_collect_cycles into a function pointer

2014-12-04 Thread Julien Pauli
On Thu, Dec 4, 2014 at 1:17 PM, Julien Pauli wrote: > On Thu, Dec 4, 2014 at 12:39 PM, Ferenc Kovacs wrote: >> >> >> On Thu, Dec 4, 2014 at 11:53 AM, Julien Pauli wrote: >>> >>> On Thu, Dec 4, 2014 at 9:30 AM, Benjamin Eberlei >>> wrote: >>> > Good morning, >>> > >>> > This is just a very small

Re: [PHP-DEV] Re: Only variables can be passed by reference

2014-12-04 Thread Andrea Faulds
> On 4 Dec 2014, at 10:38, Yasuo Ohgaki wrote: > > > Yet another sample code. This cannot be executed on 3v4l.org for security > reasons. > > $sock = fsockopen('www.php.net', '80'); > var_dump($sock); > > $socks = array($sock); > var_dump(stream_select($socks, $socks, $socks, 1)); > > //var

Re: [PHP-DEV] [RFC] Turn gc_collect_cycles into a function pointer

2014-12-04 Thread Julien Pauli
On Thu, Dec 4, 2014 at 12:39 PM, Ferenc Kovacs wrote: > > > On Thu, Dec 4, 2014 at 11:53 AM, Julien Pauli wrote: >> >> On Thu, Dec 4, 2014 at 9:30 AM, Benjamin Eberlei >> wrote: >> > Good morning, >> > >> > This is just a very small change, I propose this RFC for discussion to >> > turn >> > the

Re: [PHP-DEV] [RFC] Turn gc_collect_cycles into a function pointer

2014-12-04 Thread Ferenc Kovacs
On Thu, Dec 4, 2014 at 11:53 AM, Julien Pauli wrote: > On Thu, Dec 4, 2014 at 9:30 AM, Benjamin Eberlei > wrote: > > Good morning, > > > > This is just a very small change, I propose this RFC for discussion to > turn > > the C function "gc_collect_cycles" into a pointer. > > > > https://wiki.php

Re: [PHP-DEV] [RFC] Turn gc_collect_cycles into a function pointer

2014-12-04 Thread Julien Pauli
On Thu, Dec 4, 2014 at 9:30 AM, Benjamin Eberlei wrote: > Good morning, > > This is just a very small change, I propose this RFC for discussion to turn > the C function "gc_collect_cycles" into a pointer. > > https://wiki.php.net/rfc/gc_fn_pointer > > Composer's garbage collection optimization sho

[PHP-DEV] Re: [PHP] PHP 5.6.4 RC1 is ready for testing

2014-12-04 Thread Ferenc Kovacs
On Wed, Dec 3, 2014 at 7:44 PM, The Doctor wrote: > On Fri, Nov 28, 2014 at 12:49:59AM +0100, Ferenc Kovacs wrote: > > Hello > > > > PHP 5.6.4 RC1 is available for testing. > > > > You can download it from > > > > *http://downloads.php.net/~tyrael/ * > > > > The

[PHP-DEV] Re: Only variables can be passed by reference

2014-12-04 Thread Yasuo Ohgaki
Hi all, Sorry for multiple posts. This would be the last one. On Thu, Dec 4, 2014 at 7:08 PM, Yasuo Ohgaki wrote: > On Thu, Dec 4, 2014 at 5:28 PM, Yasuo Ohgaki wrote: > >> I think we can get rid of this error now when literal is returned. >> The reason we have E_STRICT error is that legacy PH

[PHP-DEV] Re: Only variables can be passed by reference

2014-12-04 Thread Yasuo Ohgaki
Hi all, On Thu, Dec 4, 2014 at 5:28 PM, Yasuo Ohgaki wrote: > I think we can get rid of this error now when literal is returned. > The reason we have E_STRICT error is that legacy PHP didn't > support this, I suppose. > > http://3v4l.org/8fISj > > Is it possible to allow literal as referenced pa

Re: [PHP-DEV] [RFC] Turn gc_collect_cycles into a function pointer

2014-12-04 Thread Xinchen Hui
Hey: On Thu, Dec 4, 2014 at 4:30 PM, Benjamin Eberlei wrote: > Good morning, > > This is just a very small change, I propose this RFC for discussion to turn > the C function "gc_collect_cycles" into a pointer. yeah, this idea is better than add hardly getimeofday into gc thanks > > https://wiki.

Re: [PHP-DEV] Only variables can be passed by reference

2014-12-04 Thread Yasuo Ohgaki
Hi Andrea, On Thu, Dec 4, 2014 at 5:32 PM, Andrea Faulds wrote: > > I think we can get rid of this error now when literal is returned. > > The reason we have E_STRICT error is that legacy PHP didn't > > support this, I suppose. > > > > http://3v4l.org/8fISj > > Hmm, I think there’s some logic to

RE: [PHP-DEV] Only variables can be passed by reference

2014-12-04 Thread Christian Stoller
From: Andrea Faulds [mailto:a...@ajf.me], Thursday, December 04, 2014 9:33 AM > >> On 4 Dec 2014, at 08:28, Yasuo Ohgaki wrote: >> >> Hi all, >> >> I think we can get rid of this error now when literal is returned. >> The reason we have E_STRICT error is that legacy PHP didn't >> support this,

Re: [PHP-DEV] Only variables can be passed by reference

2014-12-04 Thread Andrea Faulds
> On 4 Dec 2014, at 08:28, Yasuo Ohgaki wrote: > > Hi all, > > I think we can get rid of this error now when literal is returned. > The reason we have E_STRICT error is that legacy PHP didn't > support this, I suppose. > > http://3v4l.org/8fISj Hmm, I think there’s some logic to having a warn

[PHP-DEV] [RFC] Turn gc_collect_cycles into a function pointer

2014-12-04 Thread Benjamin Eberlei
Good morning, This is just a very small change, I propose this RFC for discussion to turn the C function "gc_collect_cycles" into a pointer. https://wiki.php.net/rfc/gc_fn_pointer Composer's garbage collection optimization showed that PHP Profilers fail to capture the dynamics of GC and we need

[PHP-DEV] Only variables can be passed by reference

2014-12-04 Thread Yasuo Ohgaki
Hi all, I think we can get rid of this error now when literal is returned. The reason we have E_STRICT error is that legacy PHP didn't support this, I suppose. http://3v4l.org/8fISj Is it possible to allow literal as referenced parameter for PHP7? It's better to remove needless restrictions wher