public function testUnshiftArray() { $array = CArray::fromElements("a", "b", "c"); $newLength = CArray::unshiftArray($array, CArray::fromElements("d", "e")); $this->assertTrue(CArray::equals($array, CArray::fromElements("d", "e", "a", "b", "c"))); $this->assertTrue($newLength == 5); }
/** * Adds the elements of an array to the start of another array. * * It is *this* array that grows with the operation. * * @param array $addArray The array containing the elements to be added. * * @return int The array's new length. */ public function unshiftArray($addArray) { return CArray::unshiftArray($this->m_splArray, $addArray); }