Re: [PHP-DEV] Add interface implementation to class in separate file

2020-09-15 Thread Mike Schinkel
> On Sep 13, 2020, at 3:49 PM, Olle Härstedt wrote: > > 2020-09-13 17:58 GMT, Benjamin Eberlei >: >> On Sat, Sep 12, 2020 at 10:23 PM Olle Härstedt >> wrote: >> >>> Hi internals! >>> >>> Separation of data and behaviour is both a fun and hard discussion, >>> espe

Re: [PHP-DEV] Draft RFC: foreach iteration of keys without values

2020-09-15 Thread Andreas Hennings
On Wed, 16 Sep 2020 at 04:00, Josh Bruce wrote: > > > * If PHP had either convention or special handling for _ or $_ as a > “ignore this” destination, I wouldn’t have made the proposal. However, it > doesn’t; _ can (apparently!) be a constant, and is also a function, and $_ > has no special hand

Re: [PHP-DEV] Draft RFC: foreach iteration of keys without values

2020-09-15 Thread Josh Bruce
> * If PHP had either convention or special handling for _ or $_ as a “ignore > this” destination, I wouldn’t have made the proposal. However, it doesn’t; _ > can (apparently!) be a constant, and is also a function, and $_ has no > special handling (and I bet it’s actually used to contain valu

Re: [PHP-DEV] Compiler Optimizations

2020-09-15 Thread Chase Peeler
On Tue, Sep 15, 2020 at 9:51 AM Benas IML wrote: > Ah, sorry! Misread your post. Anyways, the compiler doesn't transform > `\array_keys()` yet, so there's no optimization for that. > > As for other compiler optimizations, 2 that I know that the compiler does > is: > > 1. Binary OP evaluation i. e

Re: [PHP-DEV] Compiler Optimizations

2020-09-15 Thread Benas IML
Ah, sorry! Misread your post. Anyways, the compiler doesn't transform `\array_keys()` yet, so there's no optimization for that. As for other compiler optimizations, 2 that I know that the compiler does is: 1. Binary OP evaluation i. e. `2 * 2` does not yield `ZEND_ADD` opcode but is instead compu

Re: [PHP-DEV] Compiler Optimizations

2020-09-15 Thread Chase Peeler
I wasn't proposing that my example be supported. I'm totally okay with the fact that it doesn't. My question was about whether or not those kinds of optimizations are documented anywhere so that developers can make sure they don't miss out on them by not fitting the proper pattern. On Tue, Sep 15,

Re: [PHP-DEV] Compiler Optimizations

2020-09-15 Thread Benas IML
Hey, During my free time, I'm implementing that specific `array_keys` optimization. I'm not planning on supporting cases like yours (i. e. indirection through a variable) since there's no point in doing that. And also, it's not feasible to support every use case. Should we also support cases like

[PHP-DEV] Compiler Optimizations

2020-09-15 Thread Chase Peeler
I brought this up on another thread, but it wasn't addressed (which is fine, since it was somewhat off-topic). I thought it might be worth bringing up in its own thread, though. In the other thread, someone had mentioned the following compiler optimization foreach(\array_keys($arr) as $key) { an

Re: [PHP-DEV] PHP 8.0 branch cut

2020-09-15 Thread Christoph M. Becker
On 15.09.2020 at 09:29, Sebastian Bergmann wrote: > Am 15.09.2020 um 09:24 schrieb Benjamin Eberlei: >> The options to talk about and use in docs/posts are the following: >> >> opcache.jit=yes|true|1 >> opcache.jit=tracing >> opcache.jit=function >> >> These differentiate the Tracing-JIT from the

Re: [PHP-DEV] PHP 8.0 branch cut

2020-09-15 Thread Sebastian Bergmann
Am 15.09.2020 um 09:24 schrieb Benjamin Eberlei: The options to talk about and use in docs/posts are the following: opcache.jit=yes|true|1 opcache.jit=tracing opcache.jit=function These differentiate the Tracing-JIT from the Function-JIT. Default is tracing. Thanks! -- PHP Internals - PHP Ru

Re: [PHP-DEV] PHP 8.0 branch cut

2020-09-15 Thread Benjamin Eberlei
On Tue, Sep 15, 2020 at 8:20 AM Brent Roose wrote: > Hey Dmitiry > > Speaking of the JIT. I remember berblei mentioning that the JIT > configuration options were going to change prior to the final 8 release ( > https://www.reddit.com/r/PHP/comments/hjxlh9/jit_benchmarks_on_reallife_web_applicatio