public static PhpString Serialize(Context ctx, PhpValue variable, RuntimeTypeHandle caller) { ObjectWriter writer; variable.Accept(writer = new ObjectWriter(ctx, caller)); return(new PhpString(writer._result)); }
public static PhpString Serialize(Context ctx, PhpValue variable, JsonEncodeOptions encodeOptions, RuntimeTypeHandle caller) { ObjectWriter writer; variable.Accept(writer = new ObjectWriter(ctx, encodeOptions, caller)); return(writer._result); }
public static string Serialize(Context ctx, PhpValue variable, JsonEncodeOptions encodeOptions, RuntimeTypeHandle caller) { var str = StringBuilderUtilities.Pool.Get(); variable.Accept(new ObjectWriter(ctx, str, encodeOptions, caller)); return(StringBuilderUtilities.GetStringAndReturn(str)); // note: str is cleared }