class Decoder{
private $inputStr;
private $pos;
private $out;
private $length;
public function __construct(string $str) {
$this->inputStr = $str;
$this->$pos = 0;
$this->$out = '';
$this->$length = mb_strlen($str);
}
public function decode(): string {
return $this->$out;
}
}
$cipher = 'chiper';
$decrypted = new Decoder($cipher);
echo $decrypted->decode();
class Decoder{
private $inputStr;
private $pos;
private $out;
private $length;
public function __construct(string $str) {
$this->inputStr = $str;
$this->pos = 0; // Было $this->$pos
$this->out = ''; // Было $this->$out
$this->length = mb_strlen($str); // Было $this->$length
}
public function decode(): string {
return $this->out; // // Было $this->$out
}
}
$this->$length = mb_strlen($str);
=> $this->null = mb_strlen($str);
return $this->$out;
=> return $this->null // 6