php class Zoo public static voice null cat new Zoo dog new Zoo Zoo voi

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
<?php
class Zoo {
public static $voice = null;
}
$cat = new Zoo;
$dog = new Zoo;
Zoo::$voice = "Мяу";
printf("Cat says: %s\n", $cat::$voice);
printf("Dog says: %s\n", $dog::$voice);
Zoo::$voice = "Гав";
printf("Cat says: %s\n", $cat::$voice);
printf("Dog says: %s\n", $dog::$voice);