FZE*_*FZE 4 php xdebug opcode php-opcode
我试图通过仅针对我的实现执行本机php函数来了解更深入的PHP内部信息。
但是在每个操作码转储中,我都会看到以下两个操作码:
EXT_NOP :http : //php.net/manual/tr/internals2.opcodes.ext-nop.php
EXT_STMT:http : //php.net/manual/tr/internals2.opcodes.ext-stmt.php
如您在文档中所见,没有详细的解释。
即使在文档中给出的以下示例中,我的转储也不同于文档的特殊化。我真的很想知道为什么每个垃圾场都有这两个摊位吗?它们的功能是什么?
<?php
/*
* no operation
* opcode number: 0
*/
function A(){};
?>
Run Code Online (Sandbox Code Playgroud)
环保化:
LXC
Linux web 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u5 (2015-10-09) x86_64 GNU/Linux
PHP 5.6.15-1~dotdeb+7.1 (cli) (built: Nov 3 2015 16:29:58)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
with Xdebug v2.3.3, Copyright (c) 2002-2015, by Derick Rethans
Run Code Online (Sandbox Code Playgroud)
OpCode转储:
? php -d vld.active=1 -d vld.execute=0 -f nop.php
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename: /root/web/www/optest/nop.php
function name: (null)
number of ops: 5
compiled vars: none
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
2 0 E > EXT_STMT
1 NOP
2 NOP
4 3 EXT_STMT
4 > RETURN 1
branch: # 0; line: 2- 4; sop: 0; eop: 4; out1: -2
path #1: 0,
Function a:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename: /root/web/www/optest/nop.php
function name: A
number of ops: 3
compiled vars: none
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
2 0 E > EXT_NOP
1 EXT_STMT
2 > RETURN null
branch: # 0; line: 2- 2; sop: 0; eop: 2; out1: -2
path #1: 0,
End of function a
Run Code Online (Sandbox Code Playgroud)
EXT_NOP用于以前需要做的事情(即函数声明),但引擎内部已经在处理此事,并用EXT_NOP替换了原始操作码。NOP代表“无操作”。NOP与稍有不同EXT_NOP,因为它是在不同的时间生成的,但它具有相同的作用:无。
EXT_STMT是在语句之间创建的,并允许调试器(例如Xdebug)在安全的位置停止。Xdebug使用“语句处理程序”(https://github.com/derickr/xdebug/blob/master/xdebug.c#L2534)挂接到Zend引擎。Zend Engine会为EXT_STMT遇到的每个操作码调用此处理程序。