Re: [PHP-DEV] proc_open() resources and their destruction

2012-07-13 Thread Jille Timmermans
Op 12-07-12 19:02, Ángel González schreef: On 12/07/12 17:30, Johannes Schlüter wrote: Hi, On Thu, 2012-07-12 at 17:09 +0200, Jille Timmermans wrote: An implementation is quite simple: https://github.com/Jille/php-src/commit/31a1aa384c29487e077ccf3fd067eca188cf1201 Without looking at the func

Re: [PHP-DEV] proc_open() resources and their destruction

2012-07-12 Thread Ángel González
On 12/07/12 17:30, Johannes Schlüter wrote: > Hi, > > On Thu, 2012-07-12 at 17:09 +0200, Jille Timmermans wrote: >> An implementation is quite simple: >> https://github.com/Jille/php-src/commit/31a1aa384c29487e077ccf3fd067eca188cf1201 > Without looking at the functional change itself a comment: The

Re: [PHP-DEV] proc_open() resources and their destruction

2012-07-12 Thread Johannes Schlüter
Hi, On Thu, 2012-07-12 at 17:09 +0200, Jille Timmermans wrote: > An implementation is quite simple: > https://github.com/Jille/php-src/commit/31a1aa384c29487e077ccf3fd067eca188cf1201 Without looking at the functional change itself a comment: The patch in this form can not be applied to 5.4 as php

[PHP-DEV] proc_open() resources and their destruction

2012-07-12 Thread Jille Timmermans
Hello, When you create process with proc_open() (or popen()) you'll get a process-resource. The destructor of this resource calls waitpid() (or it's Windows-equivalent) and waits for the childprocess to die. I think it is very counter-intuïtive that when you derefence the resource it will wa