本文整理匯總了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();