_is_assoc() public method

Determines if an array is associative or not, since PHP doesn't really distinguish between the two, but Perl/OPS does.
public _is_assoc ( &$array ) : boolean
return boolean true if the array is associative
Exemplo n.º 1
0
 /**
  * Should return true for associative, and false for plain.
  */
 public function testIsAssoc()
 {
     $ops = new Ops();
     $no = array(1, 2, 3, 4);
     $yes = array('this' => 'is', 'associative');
     $this->assertFalse($ops->_is_assoc($no));
     $this->assertTrue($ops->_is_assoc($yes));
 }