29 lines
366 B
PHP
29 lines
366 B
PHP
<?php
|
|
|
|
namespace Program;
|
|
|
|
class Word
|
|
{
|
|
public string $register;
|
|
public int $value;
|
|
|
|
|
|
public function __construct(string $register, int $value)
|
|
{
|
|
$this->register = $register;
|
|
$this->value = $value;
|
|
}
|
|
|
|
|
|
public function toString(): string
|
|
{
|
|
return "{$this->register}{$this->value}";
|
|
}
|
|
|
|
|
|
public function __toString()
|
|
{
|
|
return $this->toString();
|
|
}
|
|
}
|