value = (string)trim($value); preg_match('/^(?P(\d*\D+ (\d* )?)+)(?P\d+.*)$/', $this->value, $match); $this->name = $match['name']; $this->number = $match['number']; } // }}} public function __get(string $field): string { switch ($field) { case 'name': return $this->name; case 'number': return $this->number; default: throw new \OutOfRangeException('A Street Object is composed of only street->name and street->number'); } } public function __set(string $field, string $value) { switch ($field) { case 'name': $this->name = trim($value); break; case 'number': $this->number = trim($value); break; default: throw new \OutOfRangeException('A Street Object is composed of only street->name and street->number'); } $this->value = "$this->name $this->value"; } } /* jEdit buffer local properties {{{ * :folding=explicit:collapseFolds=1: }}}*/