public function cast($value)
    {
        $fn = 'cast' . ucfirst(gettype($value));
        return method_exists($this, $fn) ? $this->$fn($value) : $this->dontCast($value);
    }
public function cast($value)
    {
        $fn = 'cast' . ucfirst(gettype($value));
        return method_exists($this, $fn) ? $this->$fn($value) : $this->dontCast($value);
    }
public function cast ( $ value ) { $ fn = 'cast' . ucfirst ( gettype ( $ value ) ) ; return method_exists ( $ this , $ fn ) ? $ this -> $ fn ( $ value ) : $ this -> dontCast ( $ value ) ; }
Cast value to a number

@param mixed $value
@return int|float|mixed
Cast value to a number