我试图通过对我的实现执行本机 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(){};
?>
环境规格:
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
操作码转储:
➜ 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