lastKey() public method

Evaluate an expression and return the last key
public lastKey ( ) : mixed
return mixed
コード例 #1
0
ファイル: JSONPathTest.php プロジェクト: arunahk/JSONPath
 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);
 }