Re: [PHP-DEV] opcache_compile_file() declares top-level functions

2024-11-21 Thread Daniil Gentili
>> On 21 November 2024 10:48:46 GMT, Daniil Gentili > > wrote: >> >I speak for myself (and some others, as can be seen by pull requests on >> >some FOSS projects, which made pull requests to account for this >> >behaviour), as a user of preloading who has encount

Re: [PHP-DEV] opcache_compile_file() declares top-level functions

2024-11-21 Thread Samuel Melrose
Thanks for reporting this Ilija, I came across the same problem when using `opcache_compile_file`, and agree it's confusing. For an example, please see the code sample in the opening comment of my PR: https://github.com/php/php-src/pull/16551 As part of my change to allow a read-only file based

Re: [PHP-DEV] opcache_compile_file() declares top-level functions

2024-11-21 Thread Rob Landers
On Thu, Nov 21, 2024, at 13:46, Rowan Tommins [IMSoP] wrote: > > > On 21 November 2024 10:48:46 GMT, Daniil Gentili > wrote: > >I speak for myself (and some others, as can be seen by pull requests on some > >FOSS projects, which made pull requests to account for this behaviour), as a > >user

Re: [PHP-DEV] opcache_compile_file() declares top-level functions

2024-11-21 Thread Rowan Tommins [IMSoP]
On 21 November 2024 10:48:46 GMT, Daniil Gentili wrote: >I speak for myself (and some others, as can be seen by pull requests on some >FOSS projects, which made pull requests to account for this behaviour), as a >user of preloading who has encountered this behaviour, understood the reason >

Re: [PHP-DEV] opcache_compile_file() declares top-level functions

2024-11-21 Thread Daniil Gentili
> This reads rather awkwardly, because you're claiming to speak for some > unknown users ("those who used it") and even for the reader of the message > ("it does what you expect it to do"). > I speak for myself (and some others, as can be seen by pull requests on some FOSS projects, which ma

Re: [PHP-DEV] opcache_compile_file() declares top-level functions

2024-11-21 Thread Rowan Tommins [IMSoP]
On 21 November 2024 08:15:12 GMT, Daniil Gentili wrote: >Hi Ilija, >I believe the removal of function caching is a bit of an overreaction: it was >always known, to those who used it, that preloading will cache functions, and >requires an include guard to avoid function redeclaration errors,

Re: [PHP-DEV] opcache_compile_file() declares top-level functions

2024-11-21 Thread Daniil Gentili
Hi Ilija, I believe the removal of function caching is a bit of an overreaction: it was always known, to those who used it, that preloading will cache functions, and requires an include guard to avoid function redeclaration errors, and in fact it is a very useful feature. There is nothing wrong

[PHP-DEV] opcache_compile_file() declares top-level functions

2024-11-20 Thread Ilija Tovilo
Hi everyone We recently received a bug report regarding the behavior of opcache_compile_file() [1]. The documentation specifies: https://www.php.net/manual/en/function.opcache-compile-file.php > This function compiles a PHP script and adds it to the opcode cache without > executing it. This can