如何获得PHP的操作码? [英] How to get opcodes of PHP?

查看:112
本文介绍了如何获得PHP的操作码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  <?php
      $show_value   = 123;
      echo 'sing_quote'.$show_value;
      echo "double_quote{$show_value}";

  ?>

它的操作码是:

1: <?php
2: $show_value   = 123;
        0  ASSIGN              !0, 123
3: echo 'sing_quote'.$show_value;
        1  CONCAT              'sing_quote', !0 =>RES[~1]     
        2  ECHO                ~1
4: echo "double_quote{$show_value}";
        3  ADD_STRING          'double_quote' =>RES[~2]     
        4  ADD_VAR             ~2, !0 =>RES[~2]     
        5  ECHO                ~2
        6  RETURN              1

推荐答案

查看 Vulcan Logic Disassembler

Check out the Vulcan Logic Disassembler PECL extension - see author's home page for more info.

Vulcan Logic Disassembler挂钩 进入Zend Engine并转储所有 脚本的操作码(执行单元). 它被写为 编码器,但我没有时间 那.它可以用来看看是什么 在Zend Engine中进行.

The Vulcan Logic Disassembler hooks into the Zend Engine and dumps all the opcodes (execution units) of a script. It was written as as a beginning of an encoder, but I never got the time for that. It can be used to see what is going on in the Zend Engine.

安装后,您可以像这样使用它:

Once installed, you can use it like this:

php -d vld.active=1 -d vld.execute=0 -f yourscript.php

另请参见关于操作码提取的有趣博客文章,以及列出了可用操作码的PHP手册页.

这篇关于如何获得PHP的操作码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆