/** * Create a new instance * * @param string $val Value of this string */ public function __construct($val) { parent::__construct($val); // Validate... if (!is_string($this->val)) { return $this->panic(); } }
/** * Create a new instance * * @param int|float $val Value of this number */ public function __construct($val) { parent::__construct($val); // Validate... if (!(is_integer($this->val) || is_float($this->val))) { return $this->panic(); } }
/** * @param string $type * @param int $length */ public function __construct($type, $length) { parent::__construct($type); $this->length = (int) $length; }