background image

 
<?php 

$a

 = "hello world"; 

echo

 

$a

 . PHP_EOL; 

 
使用 cli 来执行,查看生成的 opcode  

代码如下:
 
~/public_html> php -dvld.active=1 test.php 
Finding entry points 
Branch analysis from position: 0 
Return found 
filename: /home/zhanhailiang/public_html/test.php 

function

 name: (null) 

number of ops: 4 
compiled vars: !0 = 

$a

 

line # * op fetch ext 

return

 operands 

--------------------------------------------------------------------------------- 
3 0 > ASSIGN !0, 'hello+world' 
5 1 CONCAT ~1 !0, '%0A' 

ECHO

 ~1 

6 3 > RETURN 1 
branch: # 0; line: 3- 6; sop: 0; eop: 3 
path #1: 0, 
hello world