Ejemplo n.º 1
0
    function __construct($u)
    {
        $this->uList = $u;
    }
    function showList()
    {
        echo "<ul>";
        foreach ($this->uList as $v) {
            echo "<li>{$v}<br>";
        }
        echo "</ul>";
    }
}
$books = new Books(array("PHP5", "JS"));
$users = new Users(array("Вася", "Петя"));
$books->showList();
$users->showList();
final class Math
{
    static $about = "Математика";
    static function random()
    {
        return rand() / getrandmax();
    }
}
echo Math::$about;
echo Math::random(), "<br>";
echo "<hr>";
if ($car1 instanceof Car) {
    echo "car1 cоздан Car";
} else {