firstKey() public méthode

Evaluate an expression and return the first key
public firstKey ( ) : mixed
Résultat mixed
Exemple #1
0
 public function testFirstKey()
 {
     // Array test for array
     $jsonPath = new JSONPath(array('a' => 'A', 'b', 'B'));
     $firstKey = $jsonPath->firstKey();
     $this->assertEquals('a', $firstKey);
     // Array test for object
     $jsonPath = new JSONPath((object) array('a' => 'A', 'b', 'B'));
     $firstKey = $jsonPath->firstKey();
     $this->assertEquals('a', $firstKey);
 }