文件 php-5.6.26/Zend/zend_vm_execute.hphp
ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS_DC) { DCL_OPLINE zend_bool original_in_execution; original_in_execution = EG(in_execution); // 保存現場 EG(in_execution) = 1; // 正在執行中 if (0) { zend_vm_enter: execute_data = i_create_execute_data_from_op_array(EG(active_op_array), 1 TSRMLS_CC); } LOAD_REGS(); LOAD_OPLINE(); while (1) { int ret; #ifdef ZEND_WIN32 if (EG(timed_out)) { zend_timeout(0); } #endif if ((ret = OPLINE->handler(execute_data TSRMLS_CC)) > 0) { // execute_data.opline->handler(execute_data TSRMLS_CC) // 操做碼對應的處理函數 switch (ret) { case 1: EG(in_execution) = original_in_execution; // 還原現場 return; case 2: goto zend_vm_enter; // 進入虛擬機 break; case 3: execute_data = EG(current_execute_data); // 當前正在執行的數據 break; default: break; } } } zend_error_noreturn(E_ERROR, "Arrived at end of main loop which shouldn't happen"); } ZEND_API void zend_execute(zend_op_array *op_array TSRMLS_DC) { if (EG(exception)) { return; } zend_execute_ex(i_create_execute_data_from_op_array(op_array, 0 TSRMLS_CC) TSRMLS_CC); // zend_execute_ex = execute_ex }