本文整理汇总了C#中Pchp.Core.PhpValue.AsCallable方法的典型用法代码示例。如果您正苦于以下问题:C# PhpValue.AsCallable方法的具体用法?C# PhpValue.AsCallable怎么用?C# PhpValue.AsCallable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pchp.Core.PhpValue
的用法示例。
在下文中一共展示了PhpValue.AsCallable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: is_callable
/// <summary>
/// Verifies that the contents of a variable can be called as a function.
/// </summary>
/// <param name="variable">The variable.</param>
/// <param name="syntaxOnly">If <B>true</B>, it is only checked that has <pararef name="variable"/>
/// a valid structure to be used as a callback. if <B>false</B>, the existence of the function (or
/// method) is also verified.</param>
/// <returns><B>true</B> if <paramref name="variable"/> denotes a function, <B>false</B>
/// otherwise.</returns>
public static bool is_callable(PhpValue variable, bool syntaxOnly = false)
{
return PhpVariable.IsValidCallback(variable.AsCallable()); // TODO: check syntaxOnly || can be bound
}
示例2: AsCallable
/// <summary>
/// Gets value as a callable object that can be invoked dynamically.
/// </summary>
public static IPhpCallable AsCallable(PhpValue value) => value.AsCallable();