var $myTestVar = 0;
public|private|protected $myTestVar;
var $myTestVar = 0;
уже делает ее статической, поэтому $this->myTestVar пустуетpublic function __construct()
{
$this->myTestVar = 0;
}
var bpm = 132;
// Intro
var intro = beeplay({bpm: bpm})
.play(null, 2)
.play('D#5', 1/4).play('E5', 1/4).play('F#5', 1/2)
.play('B5', 1/2).play('D#5', 1/4).play('E5', 1/4)
.play('F#5', 1/4).play('B5', 1/4).play('C#6', 1/4).play('D#6', 1/4)
.play('C#6', 1/4).play('A#5', 1/4).play('B5', 1/2)
.play('F#5', 1/2).play('D#5', 1/4).play('E5', 1/4)
.play('F#5', 1/2).play('B5', 1/2)
.play('C#6', 1/4).play('A#5', 1/4).play('B5', 1/4).play('C#6', 1/4)
.play('E6', 1/4).play('D#6', 1/4).play('E6', 1/4).play('C#6', 1/4);
class Chain
{
protected $data;
public static function first() {
$c = new Chain();
return $c;
}
public function second($data) {
$r = current($data);
while(next($data)) {
var_dump($r);
$this->data[] = $r + 3;
$this->second($data);
}
return $this;
}
public function three() {var_dump($this->data); }
}
$a = array(1,2,3);
Chain::first()->second($a)->three();