Php constructor
<?php
class Foo {
private $x;
public function foo($x) {
$this->x = $x;
}
public function bar() {
return $this->x;
}
}
$foo = new Foo(3);
echo $foo->bar();INFO
<?php
class Foo {
private $x;
public function foo($x) {
$this->x = $x;
}
public function bar() {
return $this->x;
}
}
$foo = new Foo(3);
echo $foo->bar();