php class private xuj public function setX value this- value public fu

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
<?php
class A {
private $x = 'xuj';
public function setX($value) {
$this->x = $value;
}
public function getX() {
return $this->x;
}
}
$a = new A();
$a->setX('pizda');
echo $a->getX();