C# Class Pchp.Core.PhpArray

Implements ordered keyed array of PhpValue with PHP semantics.
Inheritance: PhpHashtable, IPhpConvertible, IPhpArray, IPhpComparable, IPhpEnumerable
Mostra file Open project: iolevel/peachpie Class Usage Examples

Protected Properties

Property Type Description
_intrinsicEnumerator OrderedDictionary.Enumerator

Public Methods

Method Description
AddValue ( PhpValue value ) : void
Compare ( PhpValue obj ) : int
DeepCopy ( ) : PhpArray

Creates copy of this instance using shared underlaying hashtable.

EnsureItemAlias ( IntStringKey key ) : PhpAlias
EnsureItemArray ( IntStringKey key ) : IPhpArray
EnsureItemObject ( IntStringKey key ) : object
GetEnumerator ( ) : OrderedDictionary.Enumerator

Gets PHP enumerator for this array.

GetForeachEnumerator ( bool aliasedValues ) : IPhpEnumerator

Creates an enumerator used in foreach statement.

GetForeachEnumerator ( bool aliasedValues, RuntimeTypeHandle caller ) : IPhpEnumerator

Creates an enumerator used in foreach statement.

Used for internal purposes only!

GetItemValue ( IntStringKey key ) : PhpValue
Keyed ( ) : PhpArray

Creates an instance of PhpArray filled by given entries.

If the length of keysValues is odd then its last item is added without a key.

New ( ) : PhpArray

Creates an instance of PhpArray filled by given values.

New ( PhpValue value ) : PhpArray

Creates an instance of PhpArray filled by given values.

PhpArray ( ) : System

Creates a new instance of PhpArray with specified capacities for integer and string keys respectively.

PhpArray ( Array values ) : System

Creates a new instance of PhpArray initialized with all values from System.Array.

PhpArray ( Array values, int index, int length ) : System

Creates a new instance of PhpArray initialized with a portion of System.Array.

PhpArray ( IEnumerable data ) : System

Creates a new instance of PhpArray filled by data from an enumerator.

PhpArray ( PhpArray array, bool preserveMaxInt ) : System

Copy constructor. Creates PhpArray that shares internal data table with another PhpArray.

PhpArray ( int capacity ) : System

Creates a new instance of PhpArray with specified capacities for integer and string keys respectively.

PhpArray ( int intCapacity, int stringCapacity ) : System

Creates a new instance of PhpArray with specified capacities for integer and string keys respectively.

RemoveKey ( IntStringKey key ) : void
RestartIntrinsicEnumerator ( ) : void

Restarts intrinsic enumerator - moves it to the first item.

If the intrinsic enumerator has never been used on this instance nothing happens.

SetItemAlias ( IntStringKey key, PhpAlias alias ) : void
SetItemValue ( IntStringKey key, PhpValue value ) : void
ToBoolean ( ) : bool
ToClass ( ) : object
ToDouble ( ) : double
ToLong ( ) : long
ToNumber ( PhpNumber &number ) : Convert.NumberInfo
ToString ( Context ctx ) : string
ToStringOrThrow ( Context ctx ) : string

Method Details

AddValue() public method

public AddValue ( PhpValue value ) : void
value PhpValue
return void

Compare() public method

public Compare ( PhpValue obj ) : int
obj PhpValue
return int

DeepCopy() public method

Creates copy of this instance using shared underlaying hashtable.
public DeepCopy ( ) : PhpArray
return PhpArray

EnsureItemAlias() public method

public EnsureItemAlias ( IntStringKey key ) : PhpAlias
key IntStringKey
return PhpAlias

EnsureItemArray() public method

public EnsureItemArray ( IntStringKey key ) : IPhpArray
key IntStringKey
return IPhpArray

EnsureItemObject() public method

public EnsureItemObject ( IntStringKey key ) : object
key IntStringKey
return object

GetEnumerator() public method

Gets PHP enumerator for this array.
public GetEnumerator ( ) : OrderedDictionary.Enumerator
return OrderedDictionary.Enumerator

GetForeachEnumerator() public method

Creates an enumerator used in foreach statement.
public GetForeachEnumerator ( bool aliasedValues ) : IPhpEnumerator
aliasedValues bool Whether the values returned by enumerator are assigned by reference.
return IPhpEnumerator

GetForeachEnumerator() public method

Creates an enumerator used in foreach statement.
Used for internal purposes only!
public GetForeachEnumerator ( bool aliasedValues, RuntimeTypeHandle caller ) : IPhpEnumerator
aliasedValues bool Whether the values returned by enumerator are assigned by reference.
caller System.RuntimeTypeHandle Type of the caller (ignored).
return IPhpEnumerator

GetItemValue() public method

public GetItemValue ( IntStringKey key ) : PhpValue
key IntStringKey
return PhpValue

Keyed() public static method

Creates an instance of PhpArray filled by given entries.
If the length of keysValues is odd then its last item is added without a key.
public static Keyed ( ) : PhpArray
return PhpArray

New() public static method

Creates an instance of PhpArray filled by given values.
public static New ( ) : PhpArray
return PhpArray

New() public static method

Creates an instance of PhpArray filled by given values.
public static New ( PhpValue value ) : PhpArray
value PhpValue Value to be added to the new instance. /// Keys will correspond order of values in the array.
return PhpArray

PhpArray() public method

Creates a new instance of PhpArray with specified capacities for integer and string keys respectively.
public PhpArray ( ) : System
return System

PhpArray() public method

Creates a new instance of PhpArray initialized with all values from System.Array.
public PhpArray ( Array values ) : System
values System.Array
return System

PhpArray() public method

Creates a new instance of PhpArray initialized with a portion of System.Array.
public PhpArray ( Array values, int index, int length ) : System
values System.Array
index int
length int
return System

PhpArray() public method

Creates a new instance of PhpArray filled by data from an enumerator.
public PhpArray ( IEnumerable data ) : System
data IEnumerable The enumerator containing values added to the new instance.
return System

PhpArray() public method

Copy constructor. Creates PhpArray that shares internal data table with another PhpArray.
public PhpArray ( PhpArray array, bool preserveMaxInt ) : System
array PhpArray Table to be shared.
preserveMaxInt bool True to copy the from . /// Otherwise the value will be recomputed when needed. See http://phalanger.codeplex.com/workitem/31484 for more details.
return System

PhpArray() public method

Creates a new instance of PhpArray with specified capacities for integer and string keys respectively.
public PhpArray ( int capacity ) : System
capacity int
return System

PhpArray() public method

Creates a new instance of PhpArray with specified capacities for integer and string keys respectively.
public PhpArray ( int intCapacity, int stringCapacity ) : System
intCapacity int
stringCapacity int
return System

RemoveKey() public method

public RemoveKey ( IntStringKey key ) : void
key IntStringKey
return void

RestartIntrinsicEnumerator() public method

Restarts intrinsic enumerator - moves it to the first item.
If the intrinsic enumerator has never been used on this instance nothing happens.
public RestartIntrinsicEnumerator ( ) : void
return void

SetItemAlias() public method

public SetItemAlias ( IntStringKey key, PhpAlias alias ) : void
key IntStringKey
alias PhpAlias
return void

SetItemValue() public method

public SetItemValue ( IntStringKey key, PhpValue value ) : void
key IntStringKey
value PhpValue
return void

ToBoolean() public method

public ToBoolean ( ) : bool
return bool

ToClass() public method

public ToClass ( ) : object
return object

ToDouble() public method

public ToDouble ( ) : double
return double

ToLong() public method

public ToLong ( ) : long
return long

ToNumber() public method

public ToNumber ( PhpNumber &number ) : Convert.NumberInfo
number PhpNumber
return Convert.NumberInfo

ToString() public method

public ToString ( Context ctx ) : string
ctx Context
return string

ToStringOrThrow() public method

public ToStringOrThrow ( Context ctx ) : string
ctx Context
return string

Property Details

_intrinsicEnumerator protected_oe property

Intrinsic enumerator associated with the array. Initialized lazily.
protected OrderedDictionary.Enumerator _intrinsicEnumerator
return OrderedDictionary.Enumerator