找源码首页 - 技术文章

OPCODE的功能列表

更新日期:2014-09-27 11:12:34
Opcode代码ver含义
ZEND_NOP0空操作
ZEND_ADD1
ZEND_SUB2
ZEND_MUL3
ZEND_DIV4
ZEND_MOD5求模
ZEND_SL6左移位 Shift Left
ZEND_SR7右移位 Shift Right
ZEND_CONCAT8字符串连接
ZEND_BW_OR9按位或
ZEND_BW_AND10按位与
ZEND_BW_XOR11按位异或
ZEND_BW_NOT12按位非
ZEND_BOOL_NOT13逻辑非!
ZEND_BOOL_XOR14逻辑异或 XOR
ZEND_IS_IDENTICAL15===
ZEND_IS_NOT_IDENTICAL16!==
ZEND_IS_EQUAL17==
ZEND_IS_NOT_EQUAL18<>,!=
ZEND_IS_SMALLER19
ZEND_IS_SMALLER_OR_EQUAL20<=
ZEND_CAST21类型强制转换,目标类型extend_value
ZEND_QM_ASSIGN22?: 操作赋值
ZEND_ASSIGN_ADD23+=
ZEND_ASSIGN_SUB24-=
ZEND_ASSIGN_MUL25*=
ZEND_ASSIGN_DIV26/=
ZEND_ASSIGN_MOD27%=
ZEND_ASSIGN_SL28<<=
ZEND_ASSIGN_SR29>>=
ZEND_ASSIGN_CONCAT30.=
ZEND_ASSIGN_BW_OR31|=
ZEND_ASSIGN_BW_AND32&=
ZEND_ASSIGN_BW_XOR33^=
ZEND_PRE_INC34++前自增 ++$a
ZEND_PRE_DEC35--前自减 --$a
ZEND_POST_INC36后自增++ $a ++
ZEND_POST_DEC37后自减-- $a--
ZEND_ASSIGN38赋值=
ZEND_ASSIGN_REF39引用赋值 =&
ZEND_ECHO40ECHO
ZEND_PRINT41PRINT
ZEND_JMP42无条件跳转指令
ZEND_JMPZ43条件跳转
ZEND_JMPNZ44
ZEND_JMPZNZ45
ZEND_JMPZ_EX46
ZEND_JMPNZ_EX47
ZEND_CASE48CASE操作符
ZEND_SWITCH_FREE49SWITCH
ZEND_BRK50BREAK
ZEND_CONT51CONTINUE
ZEND_BOOL52BOOL转换
ZEND_INIT_STRING53初始化字符串
ZEND_ADD_CHAR54将字符加到字符串
ZEND_ADD_STRING55将字符串加到字符串
ZEND_ADD_VAR56将变量加到字符串
ZEND_BEGIN_SILENCE57错误屏蔽开始
ZEND_END_SILENCE58错误屏蔽结束
ZEND_INIT_FCALL_BY_NAME59初始化通过名称调用函数
ZEND_DO_FCALL60函数调用
ZEND_DO_FCALL_BY_NAME61通过名称调用函数
ZEND_RETURN62函数返回
ZEND_RECV63函数声明时传递参数
ZEND_RECV_INIT64函数声明时传递参数,用默认值初始化
ZEND_SEND_VAL65函数调用时传递值作为参数
ZEND_SEND_VAR66函数调用时传递变量作为参数
ZEND_SEND_REF67函数调用时传递引用作为参数
ZEND_NEW68new 操作
ZEND_INIT_NS_FCALL_BY_NAME695.3命名空间函数调用
ZEND_FREE70free操作
ZEND_INIT_ARRAY71数组初始化
ZEND_ADD_ARRAY_ELEMENT72添加数组元素
ZEND_INCLUDE_OR_EVAL73include/require/eval操作
ZEND_UNSET_VAR745.1UNSET操作
ZEND_UNSET_DIM755.1
ZEND_UNSET_OBJ765.1
ZEND_FE_RESET775.1FOREACH操作
ZEND_FE_FETCH78FOREACH操作
ZEND_EXIT79EXIT
ZEND_FETCH_R80这一系列OPCODE用于获取各种类型的变量地址,分别用于不同的操作。R:只读,W:只写,RW:读写。DIM – 数组OBJ – 对象
ZEND_FETCH_DIM_R81
ZEND_FETCH_OBJ_R82
ZEND_FETCH_W83
ZEND_FETCH_DIM_W84
ZEND_FETCH_OBJ_W85
ZEND_FETCH_RW86
ZEND_FETCH_DIM_RW87
ZEND_FETCH_OBJ_RW88
ZEND_FETCH_IS89取出变量地址,用于IS*测试。IS*测试指的是对变量进行ISSET 或ISEMPTY测试。
ZEND_FETCH_DIM_IS90
ZEND_FETCH_OBJ_IS91
ZEND_FETCH_FUNC_ARG92获取函数参数地址
ZEND_FETCH_DIM_FUNC_ARG93
ZEND_FETCH_OBJ_FUNC_ARG94
ZEND_FETCH_UNSET95获取变量地址,用于UNSET
ZEND_FETCH_DIM_UNSET96
ZEND_FETCH_OBJ_UNSET97
ZEND_FETCH_DIM_TMP_VAR98
ZEND_FETCH_CONSTANT995.0取得常量地址
ZEND_GOTO1005.3GOTO 操作
ZEND_EXT_STMT101extension statement
ZEND_EXT_FCALL_BEGIN102extension function call begin
ZEND_EXT_FCALL_END103extension function call end
ZEND_EXT_NOP104extension noop
ZEND_TICKS105TICKS函数,5.3中过时,6.0取消
ZEND_SEND_VAR_NO_REF106参数传递
ZEND_CATCH1075.0异常处理捕获异常
ZEND_THROW108异常处理抛出异常
ZEND_FETCH_CLASS109使用对象名称获取对象指针
ZEND_CLONE110对象克隆
ZEND_INIT_METHOD_CALL112对象方法调用初始化
ZEND_INIT_STATIC_METHOD_CALL113对象静态方法调用初始化
ZEND_ISSET_ISEMPTY_VAR114标量类型变量IS*测试
ZEND_ISSET_ISEMPTY_DIM_OBJ115数组或对象类型变量IS*测试
ZEND_PRE_INC_OBJ132对象属性前自增 ++$obj->prop
ZEND_PRE_DEC_OBJ133对象属性前自减 --$obj->prop
ZEND_POST_INC_OBJ134对象属性后自增 $obj->prop++
ZEND_POST_DEC_OBJ135对象属性后自减 $obj->prop--
ZEND_ASSIGN_OBJ136对象赋值
ZEND_INSTANCEOF138instanceof操作符
ZEND_DECLARE_CLASS139类声明
ZEND_DECLARE_INHERITED_CLASS140继承类声明
ZEND_DECLARE_FUNCTION141函数声明
ZEND_RAISE_ABSTRACT_ERROR142实例化抽象类错误
ZEND_DECLARE_CONST1435.3常数声明
ZEND_ADD_INTERFACE144类声明时添加接口
ZEND_DECLARE_INHERITED_CLASS_DELAYED145声明继承类,使用delayed early binding
ZEND_VERIFY_ABSTRACT_CLASS146抽象类验证
ZEND_ASSIGN_DIM147数组元素赋值
ZEND_ISSET_ISEMPTY_PROP_OBJ148对象属性IS*测试
ZEND_HANDLE_EXCEPTION149异常处理
ZEND_USER_OPCODE1505.1用户自定义OPCODE处理器
ZEND_U_NORMALIZE1516.0规范化标识符名
ZEND_JMP_SET1525.3无条件跳转,并设置RESULT
ZEND_DECLARE_LAMBDA_FUNCTION1535.3声明LAMBDA函数