コード例 #1
0
ファイル: StackTest.php プロジェクト: twhiston/twlib
 public function testArrayCount()
 {
     $d1 = 23;
     $d2 = 'string it';
     $d3 = 'more';
     $d4 = 'd4';
     $s = new Stack();
     $s->takeReference($d1);
     $s->takeReference($d2);
     $this->assertCount(2, $s);
     $p = $s->pop();
     $this->assertCount(1, $s);
     $d3 = 'when it all falls down';
     $s->takeReference($d3);
     $this->assertCount(2, $s);
 }
コード例 #2
0
ファイル: PointerTest.php プロジェクト: twhiston/twlib
 public function testTakeReferenceFromReference()
 {
     $data = $this->getData();
     $s = new Stack();
     $s->takeReference($data[0]);
     $ref =& $data['bees'];
     $s->takeReference($ref);
     $ref = 'i hear your voice just calling me';
 }