Ejemplo n.º 1
0
 /**
  * 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();
     }
 }
Ejemplo n.º 2
0
 /**
  * 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();
     }
 }
Ejemplo n.º 3
0
 /**
  * @param string $type
  * @param int $length
  */
 public function __construct($type, $length)
 {
     parent::__construct($type);
     $this->length = (int) $length;
 }