傅令江的光影色彩世界
留住记忆的点滴
  • 首页
  • 文学
    • 诗词鉴赏
    • 美文共读
    • 原创
  • 编程
    • php
    • asp
    • .net
    • VB
    • C/C++
    • 易语言
    • js
    • 其他
    • 逆向
  • 运维
    • windows
    • linux
  • 光影色彩
    • 电影
    • 音乐
  • 科技
    • 互联网
    • 手机
  • 生活
    • 情感
  • 微语
9月292022

php parsekit,PHP安装parsekit扩展查看opcode

作者:傅令江   发布:2022-9-29 23:54   分类:php   阅读:1830次   评论:0条  

安装parsekit扩展

下载最新的

安装过程省略

还是自动安装很方便

安装:

# /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;'));"

2.如果要查看网站下某个php文件的opcode

# /usr/local/php/bin/php -r "var_dump(parsekit_compile_file('/var/www/tb.php'));"

3.如果要查看某个函数的opcode

}var_dump(parsekit_func_arginfo('foo'));?>



本文固定链接: https://www.fulingjiang.cn/php/272.html

blogger
该日志由 傅令江 于2022-9-29 23:54 Thursday发表在 php 分类下。
版权所有:《傅令江的光影色彩世界》 → 《php parsekit,PHP安装parsekit扩展查看opcode》;
除特别标注,本博客所有文章均为原创. 互联分享,尊重版权,转载请以链接形式标明本文地址;
本文标签:
上一篇::php parsekit,安装php的parsekit扩展查看opcode
下一篇:孤独的自我

热门文章

  • 兄弟二周年祭

相关文章

  • 通过模板替换生成html文件,mvp其实效率不高的,一个人开发原生最快
  • php直接下载文件,不在浏览器中打开,多个
  • php简单通用的分页类
  • dbMySQL数据源访问类
  • php 获取302跳转后的地址
取消回复

发表评论

亲,头像对么?

提交中,请稍候……


木有头像就木JJ啦!还木有头像吗?点这里申请属于你的个性Gravatar头像吧!


  • 日历

  • 存档

    • 2024年10月(1)
    • 2023年2月(1)
    • 2022年11月(1)
    • 2022年10月(10)
    • 2022年9月(13)
    • 2022年8月(2)
    • 2022年7月(14)
    • 2022年6月(2)
    • 2022年5月(8)
    • 2022年4月(7)
    • 2022年3月(13)
    • 2022年2月(2)
    • 2022年1月(9)
    • 2021年12月(2)
    • 2021年11月(4)
    • 2021年10月(2)
    • 2021年9月(6)
    • 2021年7月(4)
    • 2021年6月(3)
    • 2021年5月(3)
    • 2021年4月(11)
    • 2021年3月(13)
    • 2021年2月(2)
    • 2021年1月(1)
    • 2020年12月(1)
    • 2020年4月(5)
    • 2019年9月(1)
    • 2019年8月(1)
    • 2019年5月(3)
    • 2018年3月(1)
    • 2017年10月(1)
    • 2016年7月(1)
    • 2016年4月(1)
    • 2015年12月(1)
    • 2015年11月(3)
    • 2015年9月(1)
    • 2015年8月(10)
    • 2015年7月(1)
    • 2015年6月(1)
    • 2015年4月(1)
    • 2015年3月(3)
    • 2015年2月(8)
    • 2015年1月(4)
    • 2014年12月(1)
    • 2014年11月(27)
    • 2014年10月(13)
    • 2014年9月(14)
    • 2014年8月(26)
    • 2014年7月(21)
  • 最新评论

    • 令狐江:
      喜欢这首歌是因为可以引起共鸣!
  • 链接

    • 演讲稿网
    • Recollect
    • 演讲稿
    • 祁阳人生活网
    • 我爱演讲稿网
  • 搜索

  • 标签

      函数 自定义方法 SEO 分页 分页函数 分页方法 nginx重新的一些规则
  • 分类

    • 文学(0)
    • 编程(0)
    • 运维(0)
    • 光影色彩(0)
    • 科技(0)
    • 生活(0)
    • 诗词鉴赏(3)
    • 美文共读(1)
    • 原创(10)
    • php(111)
    • asp(1)
    • .net(0)
    • VB(0)
    • C/C++(0)
    • 易语言(0)
    • js(8)
    • 其他(9)
    • 逆向(2)
    • windows(11)
    • linux(121)
    • 电影(0)
    • 音乐(1)
    • 互联网(4)
    • 手机(0)
    • 情感(2)
  • 最新文章热门文章随机文章

    • 兄弟二周年祭
    • openai给的ionCube 解密代码,应该是老版本可以这样
    • WordPress – 5秒盾防CC(PHP通用代码)
    • 我高中最好的朋友今天猝死了-伤心得不行
    • Linux系统中 systemd-journaldCPU占用异常的解决方法
    • SVN Skipped 'xxx' -- Node remains in conflict 错误的解决办法
    • 解决Linux读写nfs共享盘速度慢的问题
    • php 获取302跳转后的地址
    • 让vsftp显示隐藏文件的办法,比如显示 .htaccess
    • 添加自签名https证书到centos系统信任的问题
    • 将数据库内二进制数据导出为图片
    • linux Zend Optimizer 3.3.9 安装方法
    • 一个代码高亮的一个插件
    • 字体做图标,好处很多
    • 上半年创投盘点:创业如何避免早死
Copyright © 2001-2025 傅令江的光影色彩世界. Powered by www.fulingjiang.cn ICP备案:京ICP备14015190号-5