[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

[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

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 yohg...@ohgaki.net 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

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 yohg...@ohgaki.net 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

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 a...@ajf.me 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] [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 kont...@beberlei.de 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

[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 yohg...@ohgaki.net 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

[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 yohg...@ohgaki.net wrote: On Thu, Dec 4, 2014 at 5:28 PM, Yasuo Ohgaki yohg...@ohgaki.net wrote: I think we can get rid of this error now when literal is returned. The reason we have

[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 doc...@doctor.nl2k.ab.ca 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/ http://downloads.php.net/~tyrael/*

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 kont...@beberlei.de 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

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 jpa...@php.net wrote: On Thu, Dec 4, 2014 at 9:30 AM, Benjamin Eberlei kont...@beberlei.de 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.

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 tyr...@gmail.com wrote: On Thu, Dec 4, 2014 at 11:53 AM, Julien Pauli jpa...@php.net wrote: On Thu, Dec 4, 2014 at 9:30 AM, Benjamin Eberlei kont...@beberlei.de wrote: Good morning, This is just a very small change, I propose this RFC for

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 yohg...@ohgaki.net wrote: Yet another sample code. This cannot be executed on 3v4l.org for security reasons. ?php $sock = fsockopen('www.php.net', '80'); var_dump($sock); $socks = array($sock); var_dump(stream_select($socks, $socks, $socks,

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 jpa...@php.net wrote: On Thu, Dec 4, 2014 at 12:39 PM, Ferenc Kovacs tyr...@gmail.com wrote: On Thu, Dec 4, 2014 at 11:53 AM, Julien Pauli jpa...@php.net wrote: On Thu, Dec 4, 2014 at 9:30 AM, Benjamin Eberlei kont...@beberlei.de wrote: Good

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 jpa...@php.net wrote: On Thu, Dec 4, 2014 at 12:39 PM, Ferenc Kovacs tyr...@gmail.com wrote: On Thu, Dec 4, 2014 at 11:53 AM, Julien Pauli jpa...@php.net wrote: On Thu, Dec 4, 2014 at 9:30 AM, Benjamin Eberlei kont...@beberlei.de wrote:

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 tyr...@gmail.com wrote: On Thu, Dec 4, 2014 at 1:17 PM, Julien Pauli jpa...@php.net wrote: On Thu, Dec 4, 2014 at 12:39 PM, Ferenc Kovacs tyr...@gmail.com wrote: On Thu, Dec 4, 2014 at 11:53 AM, Julien Pauli jpa...@php.net wrote: On

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 tyr...@gmail.com wrote: On Thu, Dec 4, 2014 at 1:17 PM, Julien Pauli jpa...@php.net wrote: On Thu, Dec 4, 2014 at 12:39 PM, Ferenc Kovacs tyr...@gmail.com wrote: On Thu, Dec 4, 2014 at 11:53 AM, Julien Pauli jpa...@php.net wrote: On

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 yohg...@ohgaki.net: 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

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

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 a...@ajf.me wrote: ?php $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),

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

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 ka...@php.net 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

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 le...@php.net 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, 10);

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 c...@daverandom.com Date: 4 Dec 2014 14:09 Subject: Re: [PHP-DEV] Re: Only variables can be passed by reference To: Andrea Faulds a...@ajf.me Cc: On 4 December 2014 at 12:26, Andrea Faulds a...@ajf.me wrote:

[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

[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 yohg...@ohgaki.net 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

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 le...@php.net 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