Re: [PHP-DEV] Change yield interpolation behaviour

2021-10-08 Thread Rowan Tommins
On 08/10/2021 12:21, Christoph M. Becker wrote: See also . A couple of other relevant threads: * Adding whitespace inside the braces changes the interpretation (note that the mentioned behaviour of undefined constants has

Re: [PHP-DEV] Change yield interpolation behaviour

2021-10-08 Thread Christoph M. Becker
On 08.10.2021 at 12:57, Kirill Nesmeyanov wrote: > Yes you are right. The same thing happens if you put a function there. > ``` > function hi(): string > { >     return ‘World’; > } >   > echo <<     Hello ${hi()} > MSG; > // Warning: Undefined variable $World! > ``` >   > For some reason, I did

Re: [PHP-DEV] Change yield interpolation behaviour

2021-10-08 Thread Kirill Nesmeyanov
Yes you are right. The same thing happens if you put a function there. ``` function hi(): string {     return ‘World’; }   echo <<> 2 ?? $any }"; // etc ```     > >Пятница, 8 октября 2021, 12:22 +03:00 от Nikita Popov : >  >On Fri, Oct 8, 2021 at 10:55 AM Nesmeyanov Kirill < n...@xakep.ru >

Re: [PHP-DEV] Change yield interpolation behaviour

2021-10-08 Thread Nikita Popov
On Fri, Oct 8, 2021 at 10:55 AM Nesmeyanov Kirill wrote: > Hello Internals! > > > At the moment, there is a feature/bug in the PHP that allows to use > interpolation of generators. > > ``` > > $code = << > Hello ${yield} > > EXAMPLE; > > ``` > > I suspect that initially this functionality

Re: [PHP-DEV] Change yield interpolation behaviour

2021-10-08 Thread Kirill Nesmeyanov
  >Пятница, 8 октября 2021, 12:14 +03:00 от Kirill Nesmeyanov : >  > >  >Hello Internals! > >At the moment, there is a feature/bug in the PHP that allows to use >interpolation of generators. > >``` >$code = << Hello ${yield} >EXAMPLE; >``` > >I suspect that initially this functionality was

[PHP-DEV] Change yield interpolation behaviour

2021-10-08 Thread Kirill Nesmeyanov
  Hello Internals! At the moment, there is a feature/bug in the PHP that allows to use interpolation of generators. ``` $code = << <current(); // Get the value from "yield"    $generator->send('?'); // Insert placeholder } return

[PHP-DEV] Change yield interpolation behaviour

2021-10-08 Thread Nesmeyanov Kirill
Hello Internals! At the moment, there is a feature/bug in the PHP that allows to use interpolation of generators. ``` $code = <