lastKey() public méthode

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