Webiny\Component\StdLib\StdObject\ArrayObject\ArrayObject::keys PHP Method

keys() public method

Get only the keys of current array.
public keys ( ) : ArrayObject
return ArrayObject An ArrayObject containing only the keys of current array.
    public function keys()
    {
        return new ArrayObject(array_keys($this->val()));
    }

Usage Example

Example #1
0
 /**
  * @dataProvider arraySet1
  */
 public function testKeys($array)
 {
     $a = new ArrayObject($array);
     $keys = $a->keys();
     $this->assertSame(array_keys($array), $keys->val());
 }