-
Notifications
You must be signed in to change notification settings - Fork 0
Tools
class Tools
Useful static functions
GET Value used, when a property is not changed, just read.
U16L UTF16LE encoding
UTF UTF-8 encoding
function g($arr,$fld)
Warning-less $arr[ $fld ]( $fld ) or null
function gg($arr,$fld)
Returns $arr[ $fld ]( $fld ) or throws EVygu if not exists
function ga($arr,array $flds)
Returns the first existing $arr[ $f ]( $f ) from $flds or null
function gd($arr,$fld,$def)
Returns $arr[ $fld ]( $fld ), or if not exists, $def
function arrayRemove( array & $arr, $x )
Removes first occurence $x from $arr (strict)
function bits($x,$at,$n)
Some bits of an integer
-
$xThe integer -
$atFirst returned bit index -
$nNumber of returned bits -
returnThe queried bits as integer
function withBits($x,$at,$n,$v)
An integer with some bits changed
-
$xThe input integer -
$atFirst changed bit index -
$nNumber of changed bits -
$vChanged bit values -
returnA new integer with bits changed
function div($a,$b)
Integer division
function divu($a,$b)
Integer division rounding up
function utf($uni)
An utf-8 character from Unicode value
function ulen($s)
Char length of an utf8 string
function ulower($s)
Lowercase utf8 string
function notImpl( $obj, $meth )
Throws an EVygu saying $obj not implements $meth
function sysBits()
Number of bits in system processor (32,64)
function loadFile($fname)
Loads a file or throws EVygu
function debug()
Shows debug values for all arguments on STDERR
function str($x)
Converts any value to string
function cIsNull($x)
Is $x an FFI NULL value
function cstr( \FFI\CData $x )
Converts FFI value to string
function isAssoc($x)
Is $x an associative array
function type($x)
Type (or class name) of $x