编写 PHP 操作码并执行它。怎么办?
如何编写 PHP 操作码,将其保存在文件中并使 Zend 引擎执行它?任何方法或技巧都是受欢迎的,只要它能起到作用。
How can I write PHP opcode, save it in a file and make the Zend Engine execute it? Any method or hack is welcome, as long as it does the trick.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有几个用户空间方法(来自插件)可以处理操作码。
然而,两者都不会生成纯文本,因为操作码不是设计为用户可写的语言(与 Parrot 不同)。
There's a couple of user-space methods (from plugins) that can deal with Opcodes.
Neither produces plain text however because the opcodes are not designed to be a user-writable language (unlike Parrot).
有一个名为 ulopcodes 的扩展,它允许您通过向 PHP 代码公开的函数发出自己的操作码。
例如:
将在当前 oparray 中创建将由 VM 执行的该行。
(免责声明:我是 ulopcodes 的创建者)
There is an extension called ulopcodes that allows you to emit your own opcodes via a function that it exposes to PHP code.
For example:
Will create that line in the current oparray which will be executed by the VM.
(Disclaimer: I am the creator of ulopcodes)