php vld 安装使用


cvs -d :pserver:cvsread@cvs.xdebug.org:/repository login
# passwd = srmread
cvs -d :pserver:cvsread@cvs.xdebug.org:/repository co -d vld vle
cd vld
./configure && make && make install
php -dextension=vld.so -dvld.active=1 script.php



能够看到编译后的OPCODE
执行:
php -dextension=vld.so -dvld.active=1 xml.php

<?php
$xw = new xmlWriter();
$xw->openMemory();
$xw->startDocument('1.0','UTF-8');
$xw->startElement('html');
$xw->startElement('head');
$xw->writeElement('title', 'Hello World!');
$xw->endElement();
$xw->startElement('body');
$xw->text('Hello World!');
$xw->endElement();
$xw->endElement();
$xw->endDocument();
echo $xw->outputMemory(true);
?>


Branch analysis from position: 0
Return found
filename: /home/hanyh/workspace/php/learn/xml.php
function name: (null)
number of ops: 40
compiled vars: !0 = $xw
line # op fetch ext return operands
-------------------------------------------------------------------------------
2 0 ZEND_FETCH_CLASS :0 'xmlWriter'
1 NEW $1 :0
2 DO_FCALL_BY_NAME 0
3 ASSIGN !0, $1
3 4 ZEND_INIT_METHOD_CALL $4 !0, 'openMemory'
5 DO_FCALL_BY_NAME 0
4 6 ZEND_INIT_METHOD_CALL $6 !0, 'startDocument'
7 SEND_VAL '1.0'
8 SEND_VAL 'UTF-8'
9 DO_FCALL_BY_NAME 2
5 10 ZEND_INIT_METHOD_CALL $8 !0, 'startElement'
11 SEND_VAL 'html'
12 DO_FCALL_BY_NAME 1
6 13 ZEND_INIT_METHOD_CALL $10 !0, 'startElement'
14 SEND_VAL 'head'
15 DO_FCALL_BY_NAME 1
7 16 ZEND_INIT_METHOD_CALL $12 !0, 'writeElement'
17 SEND_VAL 'title'
18 SEND_VAL 'Hello+World%21'
19 DO_FCALL_BY_NAME 2
8 20 ZEND_INIT_METHOD_CALL $14 !0, 'endElement'
21 DO_FCALL_BY_NAME 0
9 22 ZEND_INIT_METHOD_CALL $16 !0, 'startElement'
23 SEND_VAL 'body'
24 DO_FCALL_BY_NAME 1
10 25 ZEND_INIT_METHOD_CALL $18 !0, 'text'
26 SEND_VAL 'Hello+World%21'
27 DO_FCALL_BY_NAME 1
11 28 ZEND_INIT_METHOD_CALL $20 !0, 'endElement'
29 DO_FCALL_BY_NAME 0
12 30 ZEND_INIT_METHOD_CALL $22 !0, 'endElement'
31 DO_FCALL_BY_NAME 0
13 32 ZEND_INIT_METHOD_CALL $24 !0, 'endDocument'
33 DO_FCALL_BY_NAME 0
14 34 ZEND_INIT_METHOD_CALL $26 !0, 'outputMemory'
35 SEND_VAL true
36 DO_FCALL_BY_NAME 1
37 ECHO $27
16 38 RETURN 1
39* ZEND_HANDLE_EXCEPTION

<?xml version="1.0" encoding="UTF-8"?>
<html><head><title>Hello World!</title></head><body>Hello World!</body></html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值