本文整理汇总了C#中PHP.Core.PhpStack.PeekReferenceUnchecked方法的典型用法代码示例。如果您正苦于以下问题:C# PhpStack.PeekReferenceUnchecked方法的具体用法?C# PhpStack.PeekReferenceUnchecked怎么用?C# PhpStack.PeekReferenceUnchecked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHP.Core.PhpStack
的用法示例。
在下文中一共展示了PhpStack.PeekReferenceUnchecked方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InvokeMethodDynamic
public static object InvokeMethodDynamic(string moduleName, string className, string methodName, PhpObject self,
PhpStack stack, int[] refInfo)
{
int arg_count = stack.ArgCount;
object[] args = new object[arg_count];
PhpReference[] references = new PhpReference[arg_count];
// convert arguments on calling stack into the args array
stack.CalleeName = methodName;
int ref_ptr = (refInfo != null && refInfo.Length > 0 ? 0 : -1);
for (int i = 0; i < arg_count; i++)
{
if (ref_ptr >= 0)
{
if (i == refInfo[ref_ptr])
{
args[i] = references[i] = stack.PeekReferenceUnchecked(i + 1);
if (++ref_ptr >= refInfo.Length) ref_ptr = -1;
continue;
}
else if (refInfo[ref_ptr] == -1)
{
args[i] = references[i] = stack.PeekReferenceUnchecked(i + 1);
continue;
}
}
args[i] = stack.PeekValueUnchecked(i + 1);
}
stack.RemoveFrame();
if (refInfo == null || refInfo.Length == 0)
{
return InvokeMethod(moduleName, className, methodName, self, stack.Context, ref args, null);
}
else
{
object ret_val = InvokeMethod(moduleName, className, methodName, self, stack.Context, ref args, refInfo);
// propagate back byref parameters
for (int i = 0; i < arg_count; i++)
{
if (references[i] != null) references[i].Value = args[i];
}
return ret_val;
}
}