rfc:direct-execution-opcode
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:direct-execution-opcode [2020/11/13 10:18] – created chopins | rfc:direct-execution-opcode [2020/12/10 12:33] – chopins | ||
---|---|---|---|
Line 13: | Line 13: | ||
When executing, judge whether the loaded PHP file is an opcode file based on the flag. if no flag, will run as it is now.If is opcode file will direct execution without check php source file. | When executing, judge whether the loaded PHP file is an opcode file based on the flag. if no flag, will run as it is now.If is opcode file will direct execution without check php source file. | ||
+ | |||
+ | The **includes()** **includes_once()** and **require()** **require_one()** can load opcode file. So if you include opcode files, the source code must use the compiled file path instead of the source file path. | ||
Change function to: | Change function to: | ||
Line 30: | Line 32: | ||
php---> | php---> | ||
+ | |||
+ | new opcode file format like below: | ||
+ | |||
+ | <PHP> | ||
+ | <? | ||
+ | </ | ||
**opcache exec process:** | **opcache exec process:** | ||
Line 46: | Line 54: | ||
</ | </ | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
- | The change no incompatible. | + | Magic constant **%%__FILE__%%** is the absolute path to the compiled source file, not the path to the opcode file that is currently executing. **%%__DIR__%%** and **%%__LINE__%%** also have this problem. Therefore, applications that rely on these constants are affected. |
+ | |||
+ | The file path obtained by **error reporting**, | ||
===== Proposed PHP Version ===== | ===== Proposed PHP Version ===== | ||
Line 74: | Line 84: | ||
* set 1, default value, different version opcode file exec are prohibited | * set 1, default value, different version opcode file exec are prohibited | ||
* set 0, different version opcode file will report **E_WARNING** message | * set 0, different version opcode file will report **E_WARNING** message | ||
- | |||
- | ===== Future Scope ===== | ||
- | support opcode file in phar. | ||
===== Patches and Tests ===== | ===== Patches and Tests ===== |
rfc/direct-execution-opcode.txt · Last modified: 2021/04/23 18:07 by imsop