查看PHP的opcode

2014-10-18 09:57
1、下载 VLD (Vulcan Logic Dumper)的源码 svn co svn://svn.xdebug.org/svn/php/vld/trunk vld

2、cd vld

3、phppath/php/bin/phpize

4 、./configure --   with-php-config=phppath/bin/php-config --enable-vld

5、make && make install



至此,VLD就安装完了。写个简单的test.php
  1. <?php  
  2.        $a='123';  
  3.        echo $a;  
  4. ?>  
php -dvld.active=1 ./test.php 会看到 Finding entry points Branch analysis from position: 0 Return found filename: /home/kaisha/study/php/test.php function name: (null) number of ops: 4 compiled vars: !0 = $a line # * op fetch ext return operands --------------------------------------------------------------------------------- 2 0 > ASSIGN !0, '123' 3 1 ECHO !0 5 2 > RETURN 1 3* > ZEND_HANDLE_EXCEPTION branch: # 0; line: 2- 5; sop: 0; eop: 3 path #1: 0,
^