コード例 #1
0
                public static PhpString Serialize(Context ctx, PhpValue variable, RuntimeTypeHandle caller)
                {
                    ObjectWriter writer;

                    variable.Accept(writer = new ObjectWriter(ctx, caller));
                    return(new PhpString(writer._result));
                }
コード例 #2
0
                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);
                }
コード例 #3
0
                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
                }