C# Class Pchp.Core.Comparison

PHP comparison semantic.
Mostrar archivo Open project: iolevel/peachpie

Public Methods

Method Description
Ceq ( double dx, string sy ) : bool
Ceq ( long lx, bool by ) : bool
Ceq ( long lx, double dy ) : bool
Ceq ( long lx, string sy ) : bool
Ceq ( string sx, bool by ) : bool
Ceq ( string sx, double dy ) : bool
Ceq ( string sx, long ly ) : bool
Cgt ( long lx, double dy ) : bool
Clt ( long lx, double dy ) : bool
Compare ( PhpNumber x, PhpValue y ) : int
Compare ( PhpValue x, PhpValue y ) : int
Compare ( bool bx, PhpValue y ) : int
Compare ( bool bx, bool by ) : int
Compare ( double dx, PhpValue y ) : int
Compare ( double x, double y ) : int

Compares two double values.

We cannot used Math.Sign(double) on x - y since the result can be NaN.

Compare ( long lx, PhpValue y ) : int
Compare ( long x, long y ) : int

Compares two long integer values.

Compare ( string sx, PhpValue y ) : int
Compare ( string sx, double dy ) : int

Compares a string with double.

Compare ( string sx, long ly ) : int

Compares a string with long.

Compare ( string sx, string sy ) : int

Compares string in a manner of PHP.

Note that this comparison is not transitive (e.g. {"2","10","10a"} leads to a contradiction).

CompareNull ( PhpValue y ) : int
Equals ( string x, double dy ) : bool

Compares two objects for equality in a manner of the PHP regular comparison.

Equals ( string x, long ly ) : bool

Compares two objects for equality in a manner of the PHP regular comparison.

Method Details

Ceq() public static method

public static Ceq ( double dx, string sy ) : bool
dx double
sy string
return bool

Ceq() public static method

public static Ceq ( long lx, bool by ) : bool
lx long
by bool
return bool

Ceq() public static method

public static Ceq ( long lx, double dy ) : bool
lx long
dy double
return bool

Ceq() public static method

public static Ceq ( long lx, string sy ) : bool
lx long
sy string
return bool

Ceq() public static method

public static Ceq ( string sx, bool by ) : bool
sx string
by bool
return bool

Ceq() public static method

public static Ceq ( string sx, double dy ) : bool
sx string
dy double
return bool

Ceq() public static method

public static Ceq ( string sx, long ly ) : bool
sx string
ly long
return bool

Cgt() public static method

public static Cgt ( long lx, double dy ) : bool
lx long
dy double
return bool

Clt() public static method

public static Clt ( long lx, double dy ) : bool
lx long
dy double
return bool

Compare() public static method

public static Compare ( PhpNumber x, PhpValue y ) : int
x PhpNumber
y PhpValue
return int

Compare() public static method

public static Compare ( PhpValue x, PhpValue y ) : int
x PhpValue
y PhpValue
return int

Compare() public static method

public static Compare ( bool bx, PhpValue y ) : int
bx bool
y PhpValue
return int

Compare() public static method

public static Compare ( bool bx, bool by ) : int
bx bool
by bool
return int

Compare() public static method

public static Compare ( double dx, PhpValue y ) : int
dx double
y PhpValue
return int

Compare() public static method

Compares two double values.
We cannot used Math.Sign(double) on x - y since the result can be NaN.
public static Compare ( double x, double y ) : int
x double
y double
return int

Compare() public static method

public static Compare ( long lx, PhpValue y ) : int
lx long
y PhpValue
return int

Compare() public static method

Compares two long integer values.
public static Compare ( long x, long y ) : int
x long
y long
return int

Compare() public static method

public static Compare ( string sx, PhpValue y ) : int
sx string
y PhpValue
return int

Compare() public static method

Compares a string with double.
public static Compare ( string sx, double dy ) : int
sx string
dy double
return int

Compare() public static method

Compares a string with long.
public static Compare ( string sx, long ly ) : int
sx string
ly long
return int

Compare() public static method

Compares string in a manner of PHP.
Note that this comparison is not transitive (e.g. {"2","10","10a"} leads to a contradiction).
public static Compare ( string sx, string sy ) : int
sx string
sy string
return int

CompareNull() public static method

public static CompareNull ( PhpValue y ) : int
y PhpValue
return int

Equals() public static method

Compares two objects for equality in a manner of the PHP regular comparison.
public static Equals ( string x, double dy ) : bool
x string The first object.
dy double The second object.
return bool

Equals() public static method

Compares two objects for equality in a manner of the PHP regular comparison.
public static Equals ( string x, long ly ) : bool
x string The first object.
ly long The second object.
return bool