Re: [PHP-DEV] [RFC] Fiber support (again)

2018-02-08 Thread Haitao Lv
> On Feb 9, 2018, at 06:22, Niklas Keller wrote: > >> >>> - How do you determine when a fiber has returned? Looking at the source, >> it appears Fiber::status() must be used, comparing against constants. >> Separate methods similar to Generator would be better IMO. e.g.: >>

Re: [PHP-DEV] Suggested change: change priority of new and ->

2018-02-08 Thread Haralan Dobrev
I really like the proposal and it's definitely improving more common modern use cases. However, I understand why the precedence is like that now in PHP to begin with and so I think this should target PHP 8. This change would be a bit similar to other weird use cases of variables which were

Re: [PHP-DEV] [RFC] Fiber support (again)

2018-02-08 Thread Niklas Keller
> > > - How do you determine when a fiber has returned? Looking at the source, > it appears Fiber::status() must be used, comparing against constants. > Separate methods similar to Generator would be better IMO. e.g.: > Fiber::alive(), Fiber::suspended(), Fiber::running() > > Offering methods like

[PHP-DEV] Suggested change: change priority of new and ->

2018-02-08 Thread Mcmuffin Mcguffin
Hi, It's a common idiom in object-oriented languages to create an object and then immediately call a method on it, such as (in C# or Java): new DateTime ().ToString () However, PHP grammar does not work this way. You have to put an additional round of parentheses around new clause, such as:

Re: [PHP-DEV] [RFC] Fiber support (again)

2018-02-08 Thread Haitao Lv
> On Feb 8, 2018, at 12:18, Aaron Piotrowski wrote: > >> >> On Feb 7, 2018, at 7:05 PM, Haitao Lv wrote: >> >> Hi internals, >> >> I propose to introduce the Fiber feature AGAIN. >> >> The main purpose of the RFC is to introducing a lightweight stackful