Example #1
0
            public void Append(PhpString value)
            {
                if (value != null && !value.IsEmpty)
                {
                    Debug.Assert(value._blob._chunks != null);

                    if (value._blob.IsArrayOfChunks)
                    {
                        AddChunk(value.DeepCopy());
                    }
                    else
                    {
                        // if containing only one chunk, add it directly
                        var chunk = value._blob._chunks;
                        InplaceDeepCopy(ref chunk);
                        AddChunk(chunk);
                    }

                    _flags |= (value._blob._flags & (Flags.ContainsBinary | Flags.ContainsMutables));    // maintain the binary data flag
                }
            }
Example #2
0
 public static stdClass ToObject(PhpString value) => new stdClass(PhpValue.Create(value.DeepCopy()));