Hello, Jakub. > > I thought about this quite a bit and I think we should first try to clarify the primary design that we want to go for. > What I mean is whether we would like to ever support a true concurrency (threads) in it. > If we think it would be worth it (even thought it wouldn't be initially supported), then we should take it into the account from the beginning and add restrictions to prevent race conditions. >
If you mean multitasking, i.e., executing coroutines in different OS threads, then this feature is far beyond the scope of this RFC and would require significant changes to the PHP core (Memory manager first). And even if we imagine that such changes are made, eliminating data races without breaking the language is, to put it mildly, a questionable task from the current perspective. Although this RFC raises the question of whether a concurrent version without multitasking is worth implementing at all, my opinion is positive. For PHP, this could be sufficient as a language primarily used in the context of asynchronous I/O, whereas a multitasking version may never happen. I will likely pose this as a direct question in the final part of this RFC. Thanks! Ed. >