コード例 #1
0
ファイル: bootstrap.php プロジェクト: titon/utility-old
 function array_key_of(array $set, $match)
 {
     return Hash::keyOf($set, $match);
 }
コード例 #2
0
ファイル: HashTest.php プロジェクト: titon/utility-old
 /**
  * Test that keyOf() returns the key name based on the provided value; will drill down.
  */
 public function testKeyOf()
 {
     $data = $this->expanded;
     $this->assertEquals(null, Hash::keyOf($data, 'fakeValue'));
     $this->assertEquals('boolean', Hash::keyOf($data, true));
     $this->assertEquals('one.two.three.depth', Hash::keyOf($data, 3));
 }