C# Class Pchp.Core.PhpArray

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

Protected Properties

Свойство Type Description
_intrinsicEnumerator OrderedDictionary.Enumerator

Méthodes publiques

Méthode 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 méthode

public AddValue ( PhpValue value ) : void
value PhpValue
Résultat void

Compare() public méthode

public Compare ( PhpValue obj ) : int
obj PhpValue
Résultat int

DeepCopy() public méthode

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

EnsureItemAlias() public méthode

public EnsureItemAlias ( IntStringKey key ) : PhpAlias
key IntStringKey
Résultat PhpAlias

EnsureItemArray() public méthode

public EnsureItemArray ( IntStringKey key ) : IPhpArray
key IntStringKey
Résultat IPhpArray

EnsureItemObject() public méthode

public EnsureItemObject ( IntStringKey key ) : object
key IntStringKey
Résultat object

GetEnumerator() public méthode

Gets PHP enumerator for this array.
public GetEnumerator ( ) : OrderedDictionary.Enumerator
Résultat OrderedDictionary.Enumerator

GetForeachEnumerator() public méthode

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

GetForeachEnumerator() public méthode

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).
Résultat IPhpEnumerator

GetItemValue() public méthode

public GetItemValue ( IntStringKey key ) : PhpValue
key IntStringKey
Résultat PhpValue

Keyed() public static méthode

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
Résultat PhpArray

New() public static méthode

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

New() public static méthode

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.
Résultat PhpArray

PhpArray() public méthode

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

PhpArray() public méthode

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

PhpArray() public méthode

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
Résultat System

PhpArray() public méthode

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.
Résultat System

PhpArray() public méthode

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.
Résultat System

PhpArray() public méthode

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

PhpArray() public méthode

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
Résultat System

RemoveKey() public méthode

public RemoveKey ( IntStringKey key ) : void
key IntStringKey
Résultat void

RestartIntrinsicEnumerator() public méthode

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
Résultat void

SetItemAlias() public méthode

public SetItemAlias ( IntStringKey key, PhpAlias alias ) : void
key IntStringKey
alias PhpAlias
Résultat void

SetItemValue() public méthode

public SetItemValue ( IntStringKey key, PhpValue value ) : void
key IntStringKey
value PhpValue
Résultat void

ToBoolean() public méthode

public ToBoolean ( ) : bool
Résultat bool

ToClass() public méthode

public ToClass ( ) : object
Résultat object

ToDouble() public méthode

public ToDouble ( ) : double
Résultat double

ToLong() public méthode

public ToLong ( ) : long
Résultat long

ToNumber() public méthode

public ToNumber ( PhpNumber &number ) : Convert.NumberInfo
number PhpNumber
Résultat Convert.NumberInfo

ToString() public méthode

public ToString ( Context ctx ) : string
ctx Context
Résultat string

ToStringOrThrow() public méthode

public ToStringOrThrow ( Context ctx ) : string
ctx Context
Résultat string

Property Details

_intrinsicEnumerator protected_oe property

Intrinsic enumerator associated with the array. Initialized lazily.
protected OrderedDictionary.Enumerator _intrinsicEnumerator
Résultat OrderedDictionary.Enumerator