Some maintenance is scheduled for today which requires LiveJournal to be down briefly. Please see this post for details.

Дон Карлос (kastaneda) wrote,
<?php

class непонятка {
    var 
$шум=0;

    function 
гав($сколько_раз=1) {
        
$this->шум += $сколько_раз;
        echo 
str_repeat('Гав! ',$сколько_раз);
        return 
$this;
    }

    function 
мяу() {
        
$this->шум++;
        echo 
'Мя-я-я-я-у. ';
        return 
$this;
    }
}

$зверь = new непонятка;
$зверь -> гав(3) -> мяу() -> гав();

echo 
'<br />Итого: '.$зверь->шум;

?>
Tags: q-revo
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded  

  • 11 comments