Documentation

BlobObject extends BasicObject
in package

Table of Contents

ACCESS_NONE  = null
ACCESS_PRIVATE  = 3
ACCESS_PROTECTED  = 2
ACCESS_PUBLIC  = 1
OPERATOR_ARRAY  = 1
OPERATOR_NONE  = null
OPERATOR_OBJECT  = 2
OPERATOR_STATIC  = 3
$access  : mixed
$access_path  : mixed
$char_encodings  : array<string|int, mixed>
$const  : mixed
$depth  : mixed
$encoding  : mixed
$hints  : mixed
$legacy_encodings  : array<string|int, mixed>
$name  : mixed
$operator  : mixed
$owner_class  : mixed
$reference  : mixed
$size  : mixed
$static  : mixed
$type  : mixed
$value  : mixed
$representations  : mixed
__construct()  : mixed
addRepresentation()  : mixed
blank()  : BasicObject
Creates a new basic object with a name and access path.
clearRepresentations()  : mixed
detectEncoding()  : mixed
getAccess()  : mixed
getAccessPath()  : mixed
getModifiers()  : mixed
getName()  : mixed
getOperator()  : mixed
getRepresentation()  : mixed
getRepresentations()  : mixed
getSize()  : mixed
getType()  : mixed
getValueShort()  : mixed
removeRepresentation()  : mixed
replaceRepresentation()  : mixed
sortByAccess()  : mixed
sortByName()  : mixed
strlen()  : mixed
substr()  : mixed
transplant()  : mixed

Constants

Properties

$char_encodings

public static array<string|int, mixed> $char_encodings = array('ASCII', 'UTF-8')

Character encodings to detect

Tags
see
https://secure.php.net/function.mb-detect-order

In practice, mb_detect_encoding can only successfully determine the difference between the following common charsets at once without breaking things for one of the other charsets:

  • ASCII
  • UTF-8
  • SJIS
  • EUC-JP

The order of the charsets is significant. If you put UTF-8 before ASCII it will never match ASCII, because UTF-8 is a superset of ASCII. Similarly, SJIS and EUC-JP frequently match UTF-8 strings, so you should check UTF-8 first. SJIS and EUC-JP seem to work either way, but SJIS is more common so it should probably be first.

While you're free to experiment with other charsets, remember to keep this behavior in mind when setting up your char_encodings array.

This depends on the mbstring extension

$legacy_encodings

public static array<string|int, mixed> $legacy_encodings = array()

Legacy character encodings to detect

Tags
see
https://secure.php.net/function.iconv

Assuming the other encoding checks fail, this will perform a simple iconv conversion to check for invalid bytes. If any are found it will not match.

This can be useful for ambiguous single byte encodings like windows-125x and iso-8859-x which have practically undetectable differences because they use every single byte available.

This is NOT reliable and should not be trusted implicitly. As with char_encodings, the order of the charsets is significant.

This depends on the iconv extension

$operator

public mixed $operator = self::OPERATOR_NONE

$representations

protected mixed $representations = array()

Methods

__construct()

public __construct() : mixed
Return values
mixed

blank()

Creates a new basic object with a name and access path.

public static blank([null|string $name = null ][, null|string $access_path = null ]) : BasicObject
Parameters
$name : null|string = null
$access_path : null|string = null
Return values
BasicObject

clearRepresentations()

public clearRepresentations() : mixed
Return values
mixed

detectEncoding()

public static detectEncoding(mixed $string) : mixed
Parameters
$string : mixed
Return values
mixed

getAccess()

public getAccess() : mixed
Return values
mixed

getAccessPath()

public getAccessPath() : mixed
Return values
mixed

getModifiers()

public getModifiers() : mixed
Return values
mixed

getName()

public getName() : mixed
Return values
mixed

getOperator()

public getOperator() : mixed
Return values
mixed

getRepresentation()

public getRepresentation(mixed $name) : mixed
Parameters
$name : mixed
Return values
mixed

getRepresentations()

public getRepresentations() : mixed
Return values
mixed

getSize()

public getSize() : mixed
Return values
mixed

getType()

public getType() : mixed
Return values
mixed

getValueShort()

public getValueShort() : mixed
Return values
mixed

removeRepresentation()

public removeRepresentation(mixed $rep) : mixed
Parameters
$rep : mixed
Return values
mixed

strlen()

public static strlen(mixed $string[, mixed $encoding = false ]) : mixed
Parameters
$string : mixed
$encoding : mixed = false
Return values
mixed

substr()

public static substr(mixed $string, mixed $start[, mixed $length = null ][, mixed $encoding = false ]) : mixed
Parameters
$string : mixed
$start : mixed
$length : mixed = null
$encoding : mixed = false
Return values
mixed

Search results