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'));
?>
PHP安装parsekit扩展查看opcode相关推荐
- linux系统php安装sockets扩展
linux系统php安装sockets扩展 php安装sockets扩展 查看是否开启了socket php安装sockets扩展 原php安装文件下的sockets目录 cd /home/php-5 ...
- compose安装单个扩展_将自动化测试扩展到单个项目之外
compose安装单个扩展 This article shows corporations that have more than one application how to increase th ...
- linux环境下php安装sqlsrv扩展连接mssql
以下示例以CentOs7.8 + php7.3 为例,可根据实际情况切换其他版本,注意版本之间的对应关系即可 第一步,安装Microsoft ODBC driver for SQL Server (L ...
- PHP安装与使用VLD查看opcode代码【PHP安装第三方扩展的方法】
需要分析PHP代码的性能,或者说实现同样功能的代码到底哪个更好呢?或者说想知道底层的实现可以使用VLD查看opcode 下载与安装VLD # wget http://pecl.php.net/get/ ...
- php7 opcode,php7最小化安装 vld扩展安装并查看php代码的opcode ast测试
php7最小化安装 && vld扩展安装并查看php代码的opcode && ast测试 最小化安装php7 cd ~/software/ cd php-src git ...
- linux php7扩展查看,linux安装PHP7以及扩展
Linux下安装PHP7 事先升级gcc4.8,然后安装PHP7,安装步骤参考:CentOS安装PHP7 1.Linux下编译的php没有php.ini 解决办法:从源代码目录中复制php.ini-d ...
- php如何查看openssl扩展安装成功,php如何安装openssl扩展
php如何安装openssl扩展 php安装openssl扩展的方法:首先在PHP安装包中找到curl扩展目录:然后将config0.m4文件重命名:接着运行phpize:最后编译安装,并设置PHP配 ...
- php查看curl扩展重新安装,关于php安装curl扩展
php安装curl扩展的方法:首先下载源码包并解压:然后进行预编译并指定安装位置:接着通过"make && make install"安装扩展:最后修改php.in ...
- PHP安装扩展mcrypt以及相关依赖项 【PHP安装PECL扩展的方法】
一:Mcrypt简介 Mcrypt是PHP的一个扩展,完成了常用加密算法的封装.其实该扩展是对mcrypt标准类库的封装,mcrypt完成了相当多的常用加密算法,如DES, TripleDES, Bl ...
最新文章
- [SpringBoot之Druid]
- Markdown 图片助手-MarkdownPicPicker
- c语言迷宫算法设计,基于C语言的可连通迷宫算法设计及实现(毕业学术论文设计).doc...
- sql int 转string_由String引发的思考
- 极品飞车ol服务器维护,《极品飞车OL》配件升级常见问题介绍
- python输入数字成数组_python – Numpy:将数值插入数组的最快方法,使得数组按顺序排列...
- 信息学奥赛一本通(1158:求1+2+3+...)
- yaml文件解析:nodejs篇
- Linux内存管理:转换后备缓冲区(TLB)原理
- redis 端口_「建议收藏」手把手教你搭建redis集群
- 文件摆渡是什么意思_小白学炒股:除权、填权、贴权是个什么东东?
- 使用Java复制文件及显示进度
- 【侯捷】C++面向对象高级编程(下)
- 重装系统:cdboot:couldn't find ntldr
- Polkadot波卡链众筹成本价与总量、创始人团队简介
- Zephyr网络协议
- Redis介绍及5种数据类型的使用
- 码云上比较好的java项目
- 学术-物理:克莱因瓶
- PS一键磨皮插件:dr5白金版for mac 支持ps2021
热门文章
- linux判断是否能上网_母亲提醒女儿:判断一个男人是否值得嫁,从这两点就能轻易看出...
- vfp中,函数subs(计算机管理信息系统,7)返回的结果是,VFP选择题库(可发学生).xls...
- 【python语言基础】疑难点整理2
- 【opencv】(7) 图像匹配、直方图、图像均衡化
- Matlab人脸检测算法详解
- win10 mbr下装linux,在Win10下安装Ubuntu 18.04双系统(MBR+Legacy)
- SLAM综述(3)-视觉与惯导,视觉与深度学习SLAM
- 解决uni-app ios唤起扫码操作,总是要刷新才可以唤起的问题
- 在Ubuntu 16.04.5 LTS上利用python 2.7中的PIL模块智能等比例压缩过大的图片集实操
- Ubuntu 14.04 64位上安装Adobe reader 9.5.5