PHP安装parsekit扩展查看opcode
也可以通过VLD查看,具体请看本人写的http://blog.csdn.net/21aspnet/article/details/7002644
安装parsekit扩展
http://pecl.php.net/package/parsekit
下载最新的
#wget http://pecl.php.net/get/parsekit-1.3.0.tgz
安装过程省略
可以参考 本人写的http://blog.csdn.net/21aspnet/article/details/7035392 安装apc扩展是一样的原理
还是自动安装很方便
安装:
# /usr/local/php/bin/pecl install parsekit
配置:
php.ini加extension=parsekit.so
重启:
# /usr/local/apache2/bin/apachectl restart
测试:
# /usr/local/php/bin/php -r "var_dump(parsekit_compile_string('print 1+1;'));"
输出:
array(19) {
["type"]=>
int(4)
["type_name"]=>
string(14) "ZEND_EVAL_CODE"
["fn_flags"]=>
int(0)
["num_args"]=>
int(0)
["required_num_args"]=>
int(0)
["pass_rest_by_reference"]=>
bool(false)
["line_start"]=>
int(0)
["line_end"]=>
int(0)
["return_reference"]=>
bool(false)
["refcount"]=>
int(1)
["last"]=>
int(4)
["size"]=>
int(4)
["T"]=>
int(2)
["last_brk_cont"]=>
int(0)
["current_brk_cont"]=>
int(-1)
["backpatch_count"]=>
int(0)
["done_pass_two"]=>
bool(true)
["filename"]=>
string(17) "Parsekit Compiler"
["opcodes"]=>
array(4) {
[0]=>
array(8) {
["address"]=>
int(457076436)
["opcode"]=>
int(1)
["opcode_name"]=>
string(8) "ZEND_ADD"
["flags"]=>
int(197378)
["result"]=>
array(3) {
["type"]=>
int(2)
["type_name"]=>
string(10) "IS_TMP_VAR"
["var"]=>
int(0)
}
["op1"]=>
array(3) {
["type"]=>
int(1)
["type_name"]=>
string(8) "IS_CONST"
["constant"]=>
&int(1)
}
["op2"]=>
array(3) {
["type"]=>
int(1)
["type_name"]=>
string(8) "IS_CONST"
["constant"]=>
&int(1)
}
["lineno"]=>
int(1)
}
[1]=>
array(7) {
["address"]=>
int(457076556)
["opcode"]=>
int(41)
["opcode_name"]=>
string(10) "ZEND_PRINT"
["flags"]=>
int(770)
["result"]=>
array(3) {
["type"]=>
int(2)
["type_name"]=>
string(10) "IS_TMP_VAR"
["var"]=>
int(1)
}
["op1"]=>
array(3) {
["type"]=>
int(2)
["type_name"]=>
string(10) "IS_TMP_VAR"
["var"]=>
int(0)
}
["lineno"]=>
int(1)
}
[2]=>
array(7) {
["address"]=>
int(457076676)
["opcode"]=>
int(70)
["opcode_name"]=>
string(9) "ZEND_FREE"
["flags"]=>
int(271104)
["op1"]=>
array(4) {
["type"]=>
int(2)
["type_name"]=>
string(10) "IS_TMP_VAR"
["var"]=>
int(1)
["EA.type"]=>
int(0)
}
["op2"]=>
array(3) {
["type"]=>
int(8)
["type_name"]=>
string(9) "IS_UNUSED"
["opline_num"]=>
string(1) "0"
}
["lineno"]=>
int(1)
}
[3]=>
array(7) {
["address"]=>
int(457076796)
["opcode"]=>
int(62)
["opcode_name"]=>
string(11) "ZEND_RETURN"
["flags"]=>
int(16777984)
["op1"]=>
array(3) {
["type"]=>
int(1)
["type_name"]=>
string(8) "IS_CONST"
["constant"]=>
&NULL
}
["extended_value"]=>
int(0)
["lineno"]=>
int(1)
}
}
}
再看输出hello word
# /usr/local/php/bin/php -r "var_dump(parsekit_compile_string('print \"hello word\";'));"
输出:
array(19) {
["type"]=>
int(4)
["type_name"]=>
string(14) "ZEND_EVAL_CODE"
["fn_flags"]=>
int(0)
["num_args"]=>
int(0)
["required_num_args"]=>
int(0)
["pass_rest_by_reference"]=>
bool(false)
["line_start"]=>
int(0)
["line_end"]=>
int(0)
["return_reference"]=>
bool(false)
["refcount"]=>
int(1)
["last"]=>
int(3)
["size"]=>
int(3)
["T"]=>
int(1)
["last_brk_cont"]=>
int(0)
["current_brk_cont"]=>
int(-1)
["backpatch_count"]=>
int(0)
["done_pass_two"]=>
bool(true)
["filename"]=>
string(17) "Parsekit Compiler"
["opcodes"]=>
array(3) {
[0]=>
array(7) {
["address"]=>
int(536780564)
["opcode"]=>
int(41)
["opcode_name"]=>
string(10) "ZEND_PRINT"
["flags"]=>
int(770)
["result"]=>
array(3) {
["type"]=>
int(2)
["type_name"]=>
string(10) "IS_TMP_VAR"
["var"]=>
int(0)
}
["op1"]=>
array(3) {
["type"]=>
int(1)
["type_name"]=>
string(8) "IS_CONST"
["constant"]=>
&string(10) "hello word"
}
["lineno"]=>
int(1)
}
[1]=>
array(7) {
["address"]=>
int(536780684)
["opcode"]=>
int(70)
["opcode_name"]=>
string(9) "ZEND_FREE"
["flags"]=>
int(271104)
["op1"]=>
array(4) {
["type"]=>
int(2)
["type_name"]=>
string(10) "IS_TMP_VAR"
["var"]=>
int(0)
["EA.type"]=>
int(0)
}
["op2"]=>
array(3) {
["type"]=>
int(8)
["type_name"]=>
string(9) "IS_UNUSED"
["opline_num"]=>
string(1) "0"
}
["lineno"]=>
int(1)
}
[2]=>
array(7) {
["address"]=>
int(536780804)
["opcode"]=>
int(62)
["opcode_name"]=>
string(11) "ZEND_RETURN"
["flags"]=>
int(16777984)
["op1"]=>
array(3) {
["type"]=>
int(1)
["type_name"]=>
string(8) "IS_CONST"
["constant"]=>
&NULL
}
["extended_value"]=>
int(0)
["lineno"]=>
int(1)
}
}
}
总结:两种方法 1.如果要查看单句php的opcode# /usr/local/php/bin/php -r "var_dump(parsekit_compile_string('print 1+1;'));"
参考 http://www.php.net/manual/zh/function.parsekit-compile-string.php
2.如果要查看网站下某个php文件的opcode
参考 http://www.php.net/manual/zh/function.parsekit-compile-file.php
# /usr/local/php/bin/php -r "var_dump(parsekit_compile_file('/var/www/tb.php'));"
3.如果要查看某个函数的opcode
参考 http://www.php.net/manual/zh/function.parsekit-func-arginfo.php
<?php
function foo($bar, stdClass $baz, &$bomb, $bling = false) {
}
var_dump(parsekit_func_arginfo('foo'));
?>
相关文章:

group by 查找订单的最新状态 join
Order:snProcedures:sn,status1、 有订单表和流程表。订单表含有订单的详细信息【假设没有订单状态哈】,每个订单有好多种状态:已付款、处理中、待收货等等。现在的需求可能是查询订单状态是待收货的所有订单的信息。【答】先找到…

Xcache安装与使用
官网:http://xcache.lighttpd.net 最新版本下载地址:http://xcache.lighttpd.net/wiki/Release-1.3.2 安装: # wget http://xcache.lighttpd.net/pub/Releases/1.3.2/xcache-1.3.2.tar.gz # tar zvxf xcache-1.3.2.tar.gz # cd xcache-1.3…

安装mysql_python的适合遇到mysql_config not found解决方案(mac)
为什么80%的码农都做不了架构师?>>> 安装mysql_python的适合遇到mysql_config not found解决方案(mac) 用pip安装MySQL-python时候遇到报错: ------我是分割线------ Complete output from command python setup.py e…

推荐 6 个好用到爆的 Pycharm 插件
作者 | 小欣来源 | Python爱好者集中营相信对于不少的Python程序员们都是用Pycharm作为开发时候的IDE来使用的,今天小编来分享几个好用到爆的Pycharm插件,在安装上之后,你的编程效率、工作效率都能够得到极大地提升。安装方法插件的安装方法一…
Kibana 用户指南(使用Flight仪表盘探索Kibana)
使用Flight仪表盘探索Kibana 你是Kibana的新手并希望尝试一下,只需单击一下,你就可以安装Flights样本数据并开始与Kibana交互。 Flight数据集包含四家航空公司的数据,你可以从Kibana主页加载数据和预配置的仪表盘。 在主页上,单击…

php扩展xdebug安装以及用kcachegrind系统分析
一:安装 安装方法一:编译安装1、下载PHP的XDebug扩展,网址:http://xdebug.org/# wget http://pecl.php.net/get/xdebug-2.1.2.tgz# tar -xzf xdebug-2.1.2.tgz# xdebug-2.1.2# cd xdebug-2.1.2# /usr/local/php/bin/phpize# ./con…

Meta AI 新研究,统一模态的自监督新里程碑
作者 | 青苹果来源 | 数据实战派虽然 AI 领域不断涌现出新的突破和进展,却始终难以逃离单一领域的束缚——一种用于个性化语音合成的新颖方法,却并不能用于识别人脸的表情。为了解决这个问题,不少研究人员正在致力于开发功能更强大、应用更广…

细说Debug和Release区别
VC下Debug和Release区别 最近写代码过程中,发现 Debug 下运行正常,Release 下就会出现问题,百思不得其解,而Release 下又无法进行调试,于是只能采用printf方式逐步定位到问题所在处,才发现原来是给定的一个…

26期20180601目录管理
6月1日任务2.1/2.2 系统目录结构2.3 ls命令2.4 文件类型2.5 alias命令系统目录结构ls - list所有的用户在系统里都有自己的家目录,比如现在登陆的是root用户,登陆进去就是在root的家目录中,可以看到之前创建的公钥文件也是在这。但是如果是其…

thttpd安装与调试
http://www.acme.com/software/thttpd/ thttpd是一个非常小巧的轻量级web server,它非常非常简单,仅仅提供了HTTP/1.1和简单的CGI支持,在其官方网站上有一个与其他web server(如Apache, Zeus等)的对比图Benchmark&…

7 款可替代 top 命令的工具!(二)
作者 | JackTian来源 | 杰哥的IT之旅上一篇文章中给大家介绍了《11 款可替代 top 命令的工具!》,今天我再来给大家推荐 7 款可替代 top 命令的工具,看完这两篇替代品的文章相信能让你对 Linux 操作系统下一个小小的命令大开眼界。一、atopato…

Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException
异常Log: Error:Execution failed for task ‘:app:dexDebug’. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘/Library/……/java” finished with non-zero exit value 2 错误原因&am…

# 学号 2017-2018-20172309 《程序设计与数据结构》第十一周学习总结
---恢复内容开始--- 学号 2017-2018-20172309 《程序设计与数据结构》第十一周学习总结 教材学习内容总结 第23章 初识Android操作系统:一个多用户的Linux系统,一个运用程序运行时与其他的运用运行是独立的。发展:在Android4.4之前所有的应用…

php扩展xdebug基本使用
官网:http://www.xdebug.org/ 使用:http://www.xdebug.org/docs/安装 http://blog.csdn.net/21aspnet/article/details/7036087使用1.获取文件名,行号,函数名 xdebug_call_class() <?php function fix_string($a) { …

基于 Opencv 实现眼睛控制鼠标
作者 | 小白来源 | 小白学视觉如何用眼睛来控制鼠标?一种基于单一前向视角的机器学习眼睛姿态估计方法。在此项目中,每次单击鼠标时,我们都会编写代码来裁剪你们的眼睛图像。使用这些数据,我们可以反向训练模型,从你们…

linux 安装安装rz/sz 和 ssh
安装rz,sz yum install lrzsz; 安装ssh yum install openssh-server 查看已安装包 rpm -qa | grep ssh 更新yum源 1、备份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/ CentO…

css左固定右自适应常用方法
下面是几种方法的公用部分(右自适应也是一样的,换一下方向) html: <div class"demo"> <div class"sidebar">我是固定的</div> <div class"content">我是自适应的</div> </di…

nginx或httpd实现负载均衡tomcat(三)
接博客nginx或httpd实现反向代理tomcat并实现会话保持(二)实例四:使用httpd负载均衡后端tomcat服务第一步:准备两个tomcat服务器节172.16.240.203修改tomcat的server.xml配置文件,添加一个host。<Host name"to…

为 PHP 应用提速、提速、再提速
原文地址: http://www.ibm.com/developerworks/cn/opensource/os-php-fastapps1/ http://www.ibm.com/developerworks/cn/opensource/os-php-fastapps2/index.html为 PHP 应用提速、提速、再提速!PHP 是一种脚本语言,常用于创建 Web 应用程序…

冬奥会夺金的背后杀手锏,竟是位 AI 虚拟教练
整理 | 禾木木 出品 | AI科技大本营(ID:rgznai100) 近日,一则消息登上了热搜: 2月14日晚,在北京冬奥会自由式滑雪女子空中技巧决赛中,徐梦桃为中国代表团再添一金。她选择了难度系数4.293的动作,…

Socket-实例
import socket,os,time server socket.socket() server.bind(("localhost",9999)) server.listen()while True:conn,addrserver.accept()print("new conn",addr)while True:print("等待新指令")data conn.recv(1024)if not data:print("客…

kcachegrind安装
http://kcachegrind.sourceforge.net/cgi-bin/show.cgi/KcacheGrindDownload http://hi.baidu.com/wangxinhui419/blog/item/4a7409c78c22b4c8d100608a.html http://wxiner.blog.sohu.com/156841393.html说明:linux下如果安装不上,直接下载windows版的吧…

Java【小考】
课上, 老师出了一个题: 考察:1、类的定义 2、类的属性 3、类的方法、重载、构造方法、代码块 题目是这样的: 设计 一个 类:Tree 要求: 1、包含main方法 2、属性:静态: String name ; double hei…

首个深度强化学习AI,能控制核聚变,成功登上《Nature》
编译 | 禾木木 出品 | AI科技大本营(ID:rgznai100) 最近,DeepMind 开发出了世界上第一个深度强化学习 AI ,可以在模拟环境和真正的核聚变装置中实现对等离子体的自主控制。 这项研究成果登上了《Nature》杂志。 托卡马克是一种用于…

windows下安装mysql8.0压缩版
下面总结下安装过程: 首先解压下载好的压缩版本。将解压后mysql的bin文件目录配置系统环境path变量中使用cmd打开命令窗口,输入mysqld --initialize命令初始化mysql的data数据目录,记住初始化完毕后,会在解压目录下生成一个data文…

Linux实时监控工具Nmon使用
官网:http://nmon.sourceforge.net/pmwiki.php?nMain.HomePage 下载:http://sourceforge.net/projects/nmon/files/nmon_linux_14g.tar.gz 解压: #chmod ux nmon_x86_64_sles11 #chmod 777 nmon_x86_64_sles11 版本不同,对应文件…

英特尔2022年投资者大会:公布技术路线图及重要节点
在英特尔2022年投资者大会上,英特尔CEO帕特基辛格和各业务部门负责人概述了公司发展战略及长期增长规划的主要内容。在半导体需求旺盛的时代,英特尔的多项长期规划将充分把握转型增长的机遇。在演讲中,英特尔公布了其主要业务部门的产品路线图…

20151102adonet2
实现增删改查 ExecuteNonQuery:执行增删改语句,返回值为该命令所影响的行数. ExecuteReader:执行查询,并返回 一个DataReader对象. ExecuteScalar:执行查询,返回查询数.(删除修改时判断记录是否存在) string strSql string.Format("select count(*) from RNews where New…

day07 -文件的基本操作
1、什么是文件? 文件是操作系统为用户或应用程序提供的一个读写硬盘的虚拟单位文件的操作核心就:读、写即我们只需要对于进行读写操作,就是对操作系统发起请求,然后由操作系统将用户或者应用程序对文件的读写操作转换成具体的硬盘…

淘宝Tengine服务器开源
http://tengine.taobao.org/index_cn.htmlTengine是由 淘宝核心系统部基于Nginx开发的Web服务器,它在 Nginx的基础上,针对大访问量网站的需求,添加了很多功能和特性。Tengine的性能和稳定性已经在大型的网站如 淘宝网, 淘宝商城等…