Pchp.Core.PhpString.IPhpArray C# (CSharp) Method

IPhpArray() private method

Sets value at specific index. Value must not be an alias.
private IPhpArray ( IntStringKey key, PhpValue value ) : void
key IntStringKey
value PhpValue
return void
        void IPhpArray.SetItemValue(IntStringKey key, PhpValue value)
        {
            int index = key.IsInteger ? key.Integer : (int)Convert.StringToLongInteger(key.String);

            char ch;

            switch (value.TypeCode)
            {
                case PhpTypeCode.Long:
                    ch = (char)value.Long;
                    break;

                case PhpTypeCode.String:
                    ch = (value.String.Length != 0) ? value.String[0] : '\0';
                    break;

                case PhpTypeCode.WritableString:
                    ch = value.WritableString[0];
                    break;

                // TODO: other types

                default:
                    throw new NotSupportedException(value.TypeCode.ToString());
            }

            this[key.Integer] = ch;
        }

Same methods

PhpString::IPhpArray ( IntStringKey key ) : IPhpArray
PhpString::IPhpArray ( IntStringKey key ) : PhpAlias
PhpString::IPhpArray ( IntStringKey key ) : PhpValue
PhpString::IPhpArray ( IntStringKey key ) : object
PhpString::IPhpArray ( IntStringKey key ) : void
PhpString::IPhpArray ( IntStringKey key, PhpAlias alias ) : void
PhpString::IPhpArray ( PhpValue value ) : void