offsetGet() public method

public offsetGet ( $offset )
示例#1
0
 public function testOffsetUnset()
 {
     $data = array("route" => array(array("name" => "A", "type" => "type of A"), array("name" => "B", "type" => "type of B")));
     $data = json_encode($data);
     $jsonIterator = new JSONPath(json_decode($data));
     /** @var JSONPath $route */
     $route = $jsonIterator->offsetGet('route');
     $route->offsetUnset(0);
     $first = $route->first();
     $this->assertEquals("B", $first['name']);
 }