VLD是php的一個(gè)擴(kuò)展,用于查看php的Opcode級(jí)的操作。
VLD包的下載網(wǎng)址:http://pecl.php.net/package/vld
用php的pecl安裝方法:pecl install channel://pecl.php.net/vld-0.10.1
使用方法如:
1、用于測(cè)試的文件為testvld.php,內(nèi)容如下
<?php
function _count($num){
if($num==0){
return 0;
}else{
return $num + _count($num-1);
}
}
echo _count(10);
?>
專(zhuān)注于為中小企業(yè)提供成都網(wǎng)站制作、網(wǎng)站設(shè)計(jì)、外貿(mào)網(wǎng)站建設(shè)服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)靖遠(yuǎn)免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動(dòng)了上千余家企業(yè)的穩(wěn)健成長(zhǎng),幫助中小企業(yè)通過(guò)網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。
2、根據(jù)各自的環(huán)境來(lái)用php命令加-dvld.active=1來(lái)執(zhí)行文件,如本人環(huán)境中執(zhí)行命令:/usr/local/php-5.6.4/bin/php -c /usr/local/php-5.6.4/php.ini -dvld.active=1 testvld.php
3、通過(guò)vld對(duì)testvld.php執(zhí)行結(jié)果如下:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename: /home/file/testvld.php
function name: (null)
number of ops: 5
compiled vars: none
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
2 0 E > NOP
9 1 SEND_VAL 10
2 DO_FCALL 1 $0 '_count'
3 ECHO $0
11 4 > RETURN 1
branch: # 0; line: 2- 11; sop: 0; eop: 4; out1: -2
path #1: 0,
Function _count:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
Jump found. Position 1 = -2
Branch analysis from position: 5
Jump found. Position 1 = -2
filename: /home/file/testvld.php
function name: _count
number of ops: 12
compiled vars: !0 = $num
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
2 0 E > RECV !0
3 1 IS_EQUAL ~0 !0, 0
2 > JMPZ ~0, ->5
4 3 > > RETURN 0
5 4* JMP ->11
6 5 > INIT_FCALL_BY_NAME '_count'
6 SUB ~1 !0, 1
7 SEND_VAL ~1
8 DO_FCALL_BY_NAME 1 $2
9 ADD ~3 !0, $2
10 > RETURN ~3
8 11* > RETURN null
branch: # 0; line: 2- 3; sop: 0; eop: 2; out1: 3; out2: 5
branch: # 3; line: 4- 4; sop: 3; eop: 3; out1: -2
branch: # 5; line: 6- 8; sop: 5; eop: 11
path #1: 0, 3,
path #2: 0, 5,
End of function _count
重點(diǎn)分析:
number of ops: Opcode級(jí)的操作總個(gè)數(shù)
列表中的op:具體的操作名
本文題目:PHP用VLD查看php的Opcode級(jí)執(zhí)行
瀏覽路徑:http://aaarwkj.com/article2/pegsic.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供做網(wǎng)站、靜態(tài)網(wǎng)站、軟件開(kāi)發(fā)、網(wǎng)站內(nèi)鏈、、自適應(yīng)網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)