class Fruit { public $count = 3; public $type; }
$apple = new Fruit();
$apple->type = "apple";
print $apple->count; // 3 print
$apple->type; // apple
Asked
Active
Viewed 12 times
0

Qirel
- 25,449
- 7
- 45
- 62

Yuya Kawahara
- 107
- 1
- 1
- 4
-
You're looking at object oriented programming. – Qirel Mar 25 '17 at 16:17
-
ever heard of `$this` ? http://php.net/manual/en/language.oop5.php – Funk Forty Niner Mar 25 '17 at 16:20